Epson S1D13705 Computer Monitor User Manual


 
Epson Research and Development Page 29
Vancouver Design Center
Programming Notes and Examples S1D13705
Issue Date: 02/01/22 X27A-G-002-03
5.2.2 Examples
For the following examples we base our calculations on a 4 bit-per-pixel image displayed
on a 256w x 64h panel. We have set up a virtual size of 320w x 240h. Width is greater than
height so we are in landscape display mode. Refer to Section 2, “Initialization” on page 8
and Section 5.1, “Virtual Display” on page 25 for assistance with these settings.
These examples are shown using a C-like syntax.
Example 3: Panning (Right and Left)
To pan to the right increase the start address value by one. To pan to the left decrease the
start address value. Keep in mind that, with the exception of 8 bit-per-pixel portrait display
mode, the display will jump by more than one pixel as a result of changing the start address
registers.
Panning to the right.
StartWord = GetStartAddress();
StartWord ++;
SetStartAddress(StartWord);
Panning to the left.
StartWord = GetStartAddress();
StartWord --;
if (StartWord < 0)
StartWord = 0;
SetStartAddress(StartWord);
The routine GetStartAddress() is one which will read the start address registers and return
the start address as a long value. It would be written similar to:
long GetStartAddress()
{
return ((REG[10] & 1) * 65536) + (REG[0D] * 256) + (REG[0C]);
}
The routine SetStartAddress() break up its long integer argument into three register values
and store the values.
void SetStartAddress(long SA)
{
REG[0C] = SA & 0xFF;
REG[0D] = (SA >> 8) & 0xFF;
Reg[10] = (SA >> 16) & 0xFF;
}
In this example code the notation REG[] refers to whatever mechanism is employed to
read/write the registers.