Page 68
Epson Research and Development
Vancouver Design Center
S1D13503
Programming Notes and Examples
X18A-G-002-06
Issue Date: 01/01/30
// are ((x horizontal pixels)/8) bytes per scan line. This means that
// there are ((x horizontal pixels)/16) words per scan line.
//
// Since the Memory Interface is set to 16 bits, the Line Byte/Word Count
// refers to words.
//
val = (PanelX / 16) - 1;
BytesPerScanLine = (PanelX / 8);
WriteRegister(2, val & 0xff); // Line Byte Count Register
val2 = ReadRegister(3);
val2 &= 0xfe; // Clear bit 0
val2 |= (val >> 8) & 0x01;
WriteRegister(3, val2); // Mode Register 1
PanelGrayLevel = 2;
ShowVerticalBars(pVideo, 0);
//
// Show text. The lightest gray shade is set to PanelGrayLevel-1.
//
ShowText(pVideo, BANK0, "Vertical Bars for Black and White", PanelGrayLevel-1);
SetDisplay(ON);
Delay(2000);
}
//--------------------------------------
SetDisplay(OFF);
ClearLCDScreen();
//
// Select 4 gray shades/colors
//
if (PanelD == PANEL_MONO)
{
val = ReadRegister(1);
val &= 0xf7; // Clear AUX[01] bit 3
WriteRegister(1, val);
val = ReadRegister(3);
val &= 0xf9; // Clear AUX[03] bits 1 and 2
WriteRegister(3, val);
//
// Update Lookup Table for 4 gray shades
//
for (x = 0; x < 16; ++x)
{
WriteRegister(0x0e, x);
WriteRegister(0x0f, MonoLUT4[x]);
}
electronic components distributor