Initialization Code - Epson S1D13503 Series Technical Manual

Dot matrix graphics lcd controller
Hide thumbs Also See for S1D13503 Series:
Table of Contents

Advertisement

EPSON

7.2 Initialization Code

//-------------------------------------------------------------------------
//
// FUNCTION: Initialize()
//
// DESCRIPTION: Intialize S1D13503 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, val2;
static unsigned int x;
if (PanelD == PANEL_MONO)
PanelGrayLevel = 16;
else
PanelGrayLevel = 256;
//--------------------------------------
//
// Mode Register:
//
Display = OFF
//
Panel = SINGLE
//
Mask XSCL = NOT MASKED
//
LCDE = NOT ENABLED
//
Gray Shade/Color = 16 Gray Shades (bit is ignored for 256 colors)
//
LCD Data Width = 8 bit data transfer
//
Memory Interface = 16 bits
//
RAMS = Addressing for 8Kx8 SRAM
//
val = 0x0C;
if (Interface == 4)
val &= 0xfb;
// Clear AUX[01] bit 2 so that Memory Interface = 4 bits
if (PanelType == TYPE_DUAL)
val |= 0x40;
// Set panel type to DUAL
WriteRegister(1, val);
//--------------------------------------
//
// Line Byte/Word Count Register
//
// Bits 0-7 are in AUX[2], Bit 8 is in AUX[3].
//
// Because the Memory Interface is set to 16 bits, the
// Line Byte/Word Count Register counts in words.
// To calculate the Line Byte Count for different numbers of
// gray shades/colors, use the following formula:
//
//
BitsPerPixel
//
----------------------
2-46
// Write to Mode Register
x Horizontal Resolution
- 1
S18A-G-002-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1d13503d00aS1d13503f00aS1d13503f01aS1d13503p00c

Table of Contents