Epson Research and Development
Page 71
Vancouver Design Center
Programming Notes and Examples
S1D13503
Issue Date: 01/01/30
X18A-G-002-06
for (x = 0; x < 16; ++x)
{
WriteRegister(0x0e, x);
WriteRegister(0x0f, MonoLUT16[x]);
}
str = Gray16;
}
else // 16 colors
{
val = ReadRegister(1);
val |= 0x08; // Set AUX[01] bit 3
WriteRegister(1, val);
val = ReadRegister(3);
val &= 0xfb; // Clear AUX[03] bit 2
val |= 0x02; // Set AUX[03] bit 1
WriteRegister(3, val);
//
// Update Lookup Table for 16 colors
//
for (x = 0; x < 16; ++x)
{
WriteRegister(0x0e, x);
WriteRegister(0x0f, ColorLUT16Red[x]);
WriteRegister(0x0f, ColorLUT16Green[x]);
WriteRegister(0x0f, ColorLUT16Blue[x]);
}
str = Color16;
}
//
// Update Line Byte Count register for 16 colors/gray shades
//
// Since 16 colors/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
val2 = ReadRegister(3);
val2 &= 0xfe; // Clear bit 0
val2 |= (val >> 8) & 0x01;
WriteRegister(3, val2); // Mode Register 1
electronic components distributor