Page 72
Epson Research and Development
Vancouver Design Center
S1D13503
Programming Notes and Examples
X18A-G-002-06
Issue Date: 01/01/30
PanelGrayLevel = 16;
ShowVerticalBars(pVideo, 0);
//
// Show text. The lightest color/gray shade is set to PanelGrayLevel-1.
//
ShowText(pVideo, BANK0, str, PanelGrayLevel-1);
SetDisplay(ON);
Delay(2000);
//--------------------------------------
if (PanelD == PANEL_COLOR)
{
SetDisplay(OFF);
ClearLCDScreen();
//
// Select 256 colors
//
val = ReadRegister(3);
val |= 0x06; // Set AUX[03] bits 1 and 2
WriteRegister(3, val);
//
// Update Lookup Table for 256 colors
//
for (x = 0; x < 16; ++x)
{
WriteRegister(0x0e, x);
WriteRegister(0x0f, ColorLUT256Red[x]);
WriteRegister(0x0f, ColorLUT256Green[x]);
WriteRegister(0x0f, ColorLUT256Blue[x]);
}
//
// Update Line Byte/Word Count register for 256 colors
//
// Since 256 colors have one pixel per byte, there
// are (x horizontal pixels) bytes per scan line. This means that
// there are ((x horizontal pixels)/2) words per scan line.
//
// Since the Memory Interface is set to 16 bits, the Line Byte/Word Count
// refers to words.
//
val = (PanelX / 2) - 1;
BytesPerScanLine = PanelX;
WriteRegister(2, val & 0xff); // Line Byte Count Register
electronic components distributor