
Page 48
Epson Research and Development
Vancouver Design Center
SED1352
Programming Notes and Examples
X16-BG-007-04
Issue Date: 98/10/08
6.2 Initialization Code
//-------------------------------------------------------------------------
//
// FUNCTION: Initialize()
//
// DESCRIPTION: Intialize SED1352 registers.
//
// INPUTS: This function looks at the followingl global variables to
// determine the appropriate register settings:
// PanelX, PanelY, PanelType
//
// OUTPUTS: The following global variables are changed:
// PanelGrayLevel, BytesPerScanLine
//
//-------------------------------------------------------------------------
void Initialize(void)
{
static unsigned int val;
static unsigned int x;
PanelGrayLevel = 16;
//--------------------------------------
//
// Mode Register:
// Display = ON
// Panel = SINGLE
// Mask XSCL = NOT MASKED
// LCDE = NOT ENABLED
// Gray Scale = 16 Gray Shades (4 bits/pixel)
// LCD Data Width = 8 bit data transfer
// Memory Interface = 16 bits
// RAMS = Addressing for 8Kx8 SRAM
//
val = 0x8C;
if (PanelType == TYPE_DUAL)
{
val |= 0x40; // Set panel type to DUAL
val &= ~0x04; // Set LCD Data Width to 4 bit data transfer
}
WriteRegister(1, val); // Write to Mode Register
//--------------------------------------
//
// Line Byte/Word Count Register
//