Page 54
Epson Research and Development
Vancouver Design Center
S1D13504
Programming Notes and Examples
X19A-G-002-07
Issue Date: 01/02/01
9 Sample Code
9.1 Introduction
The following code samples demonstrate two approaches to initializing the S1D13504 color
graphics controller with/without using the 13504HAL API. These code samples are for example
purposes only.
9.1.1 Sample code using 13504HAL API
/*
**-------------------------------------------------------------------------
**
** Created 1998, Epson Research & Development
** Vancouver Design Centre
** Copyright (c) 1998 Epson Research and Development, Inc.
** All rights reserved.
**
**-------------------------------------------------------------------------
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hal.h"
#include "appcfg.h"
/*--------------------------------------------------------------------------*/
void main(void)
{
BYTE ChipId;
int Device;
switch (seRegisterDevice(&Cfg.DeviceInfo[0], &Cfg.DeviceChip, &Device))
{
case ERR_OK:
break;
case HAL_DEVICE_ERR:
printf("ERROR: Too many devices registered.\n");
exit(1);
default:
printf("ERROR: Could not register S1D13504 device.\n");
exit(1);
}