
Epson Research and Development
Page 53
Vancouver Design Center
Programming Notes and Examples
SED1352
Issue Date: 98/10/08
X16-BG-007-04
Initialize();
ClearLCDScreen();
//
// For 64k only
//
FP_SEG(pVideo) = 0xd000;
FP_OFF(pVideo) = 0x0000;
//
// Update Look-Up Table for 16 gray shades
//
for (x = 0; x < 16; ++x)
{
WriteRegister(0x0e, x);
WriteRegister(0x0f, x);
}
//
// Change Mode Register for 16 gray shades
//
val = ReadRegister(1);
val |= 0x08;
WriteRegister(1, val);
//
// Update Line Byte Count register for 16 gray shades
//
// Since 16 gray shades corresponds to 2 pixels per byte, there
// are ((x horizontal pixels)/2) bytes per scan line. This means that
// there are ((x horizontal pixels)/4) words per scan line.
//
// Since the Memory Interface is set to 16 bits, the Line Byte/Word Count
// refers to words.
//
val = (PanelX / 4) - 1;
BytesPerScanLine = (PanelX / 2);
WriteRegister(2, val & 0xff); // Line Byte Count Register
WriteRegister(3, (val >> 8) & 0x01); // Line Byte Count/Power Save Reg
PanelGrayLevel = 16;
ShowVerticalBars(pVideo);
//
// Show text. The lightest gray shade is set to PanelGrayLevel-1.
//
ShowText(pVideo, "VERTICAL BARS AT SIXTEEN GRAY SHADES", PanelGrayLevel-1);
}