Epson S1D13708 Manuel D’Utilisation

Page de 574
Epson Research and Development
Page 67
Vancouver Design Center
Programming Notes and Examples
S1D13708
Issue Date: 01/11/20 
X39A-G-003-01
ADVANCE
D
 IN
FOR
MAT
ION
Subje
ct to C
ha
nge
void halWriteDisplay16(UInt32 Offset, UInt16 Value, UInt32 Count)
Description:
Writes a word into display memory at the requested offset.
Parameters:
Offset
a 32 bit byte offset to the byte to be written to display memory. To prevent
system slowdowns and possibly memory faults, Offset should be a word
multiple.
Value
the word value to be written to display memory.
Count
the number of times to repeat the Value in memory. By including a count (or
loop) value this function can efficiently fill display memory.
Return Value:
Nothing.
void halWriteDisplay32(UInt32 Offset, UInt32 Value, UInt32 Count)
Description:
Writes a dword into display memory at the requested offset.
Parameters:
Offset
A 32 bit byte offset to the byte to be written to display memory. To prevent
system slowdowns and possibly memory faults, Offset should be a dword
multiple.
Value
 The dword value to be written to display memory.
Count
The number of times to repeat the Value in memory. By including a count
(or loop) value this function can efficiently fill display memory.
Return Value:
Nothing.
9.2.3   Register Access
The S1D13708 HAL includes six register access functions. The primary purpose of the 
register access functions is to demonstrate how to access the S1D13708 control registers 
using the C programming language. Most programs that need to access the registers will 
bypass the HAL and instead use register pointers.
There are some register values which must be combined, such as the Main Window Line 
Address Offset in REG[78h] and REG[79h]. Software must take into account whether the 
given platform is big or little endian when combining such register values. To guarantee 
that the combined register values are correct, do the following in C:
Read word from reg[index]
val16 = (halReadReg8(index+1) << 8) |
halReadReg8(index);
Read dword from reg[index]
val32 =(halReadReg8(index+3) << 24) |
(halReadReg8(index+2) << 16) |
(halReadReg8(index+1) << 8)
halReadReg8(index);
Write word (val16) to reg[index]
halWriteReg8(index, (val16 & 0xff));
halWriteReg8(index+1, (val16 >> 8) & 0xff);
Write dword (val32) to reg[index]
halWriteReg8(index, (val32 & 0xff));
halWriteReg8(index+1, (val32 >> 8) & 0xff);
halWriteReg8(index+2, (val32 >> 16) & 0xff);
halWriteReg8(index+3, (val32 >> 24) & 0xff);