Page 62
Epson Research and Development
Vancouver Design Center
S1D13503
Programming Notes and Examples
X18A-G-002-06
Issue Date: 01/01/30
case 2:
BytesPerScanLine = (PanelX / 8);
break;
case 4:
BytesPerScanLine = (PanelX / 4);
break;
case 16:
BytesPerScanLine = (PanelX / 2);
break;
case 256:
BytesPerScanLine = PanelX;
break;
}
//--------------------------------------
//
// Total Display Line Count Register
// Screen 1 Display Line Count Register
//
// To show a full image on Screen 1, copy the Total Display Line Count
// into the Screen 1 Display Line Count.
//
//
// Old programs had previously assumed that all panels smaller
// than 400 lines use a 4 bit interface. However, newer panels
// which are less than 400 lines may use an 8 bit interface.
// Consequently this program must be told which interface to use.
//
// Set the Mask XSCL bit to MASKED (1) when using a 4 bit interface.
//
if (Interface == 4)
{
val = ReadRegister(1);
val &= 0xfb; // Set LCD Data Width to 4 bit data transfer
val |= 0x20; // Set Mask XSCL to MASKED
WriteRegister(1, val); // Write to Mode Register; LCD Data Width = 4 bits
}
val = PanelY;
//
// A dual panel LCD will, of course, have two panels. Each panel will
// show either the top or bottom half of the image, which is half of the
// vertical resolution.
//
if (PanelType == TYPE_DUAL)
val /= 2;
electronic components distributor