User`s manual
9: SAMPLE CODE
S1D13504 PROGRAMMING NOTES EPSON 2-39
AND EXAMPLES (S19A-G-002-06)
9.1.2 Sample Code Without Using 13504HAL API
/*
**===========================================================================
** INIT1354.C - sample code demonstrating the initialization of the S1D13504.
** Beta release 2.0 98-10-22
**
** The code in this example will perform initialization to the following
** specification:
**
** - 320 x 240 single 8-bit color passive panel.
** - 75 Hz frame rate.
** - 8 BPP (256 colors).
** - 33 MHz input clock.
** - 2 MB of 60 ns FPM memory.
**
** *** This is sample code only! ***
** This means:
** 1) Generic C is used. I assume that pointers can access the
** relevant memory addresses (this is not always the case).
** i.e. using the 1354B0B card on an Intel 16 bit platform will require
** changes to use a DOS extender to access memory and registers.
** 2) Register setup is done with discreet writes rather than being
** table driven. This allows for clearer commenting. A real program
** would probably store the register settings in an array and loop
** through the array writing each element to a control register.
** 3) The pointer assignment for the register offset does not work on
** Intel 16 bit platforms.
**
**---------------------------------------------------------------------------
** Created 1998, Epson Research & Development
** Vancouver Design Centre
** Copyright (c) 1998 Epson Research and Development, Inc.
** All rights reserved.
**---------------------------------------------------------------------------
**
** $Header: $
**
** $Revision: $
**
** $Log: $
**
**===========================================================================
*/
unsigned char LUT8[8*3] = {
0x00, 0x00, 0x00,
0x02, 0x02, 0x05,
0x04, 0x04, 0x0A,
0x06, 0x06, 0x0F,
0x09, 0x09, 0x00,
0x0B, 0x0B, 0x00,
0x0D, 0x0D, 0x00,
0x0F, 0x0F, 0x00,
};
/*
** REGISTER_OFFSET points to the starting address of the SED1354 registers
*/
#define REGISTER_OFFSET ((unsigned char *) 0x1234)
void main(void)
{
unsigned char * pRegs;
unsigned char * pLUT;
int idx;
int rgb;
pRegs = REGISTER_OFFSET;
/*
** Initialize the chip.
*/
/*
** Step 1: Enable the host interface.
**