
Page 80
Epson Research and Development
Vancouver Design Center
S1D13706
Programming Notes and Examples
X31B-G-003-03
Issue Date: 01/02/23
10.2.4 Register Access
The Register Access functions provide a convenient method of accessing the control
registers of the S1D13706 controller using byte, word or dword widths.
To reduce the overhead of the function call as much as possible, two steps were taken:
• To gain maximum efficiency on all compilers and platforms, byte and word size argu-
ments are passed between the application and the HAL as unsigned integers. This typi-
cally allows a compiler to produce more efficient code for the platform.
• Index alignment for word and dword accesses is not tested. On non-Intel platforms
attempting to access a word or dword on a non-aligned boundary may result in a
processor trap. It is the responsibility of the caller to ensure that the requested index
offset is correctly aligned for the target platform.
• The word and dword register functions will swap bytes if the endian of the host CPU
differs from the S1D13706 (the S1D13706 is little-endian).
unsigned seReadRegByte(DWORD Index)
Description:
This routine reads the register specified by Index and returns the value.
Parameters:
Index
Offset, in bytes, to the register to read.
Return Value:
The least significant byte of the return value is the byte read from the register.
unsigned seReadRegWord(DWORD Index)
Description:
This routine reads two consecutive registers as a word and returns the value.
Parameters:
Index
Offset to the first register to read.
Return Value:
The least significant word of the return value is the word read from the S1D13706 regis-
ters.
DWORD seReadRegDword(DWORD Index)
Description:
This routine reads four consecutive registers as a dword and returns the value.
Parameters:
Index
Offset to the first of the four registers to read.
Return Value:
The return value is the dword read from the S1D13706 registers.
void seWriteRegByte(DWORD Index, unsigned Value)
Description:
This routine writes Value to the register specified by Index.
Parameters:
Index
Offset to the register to be written
Value
The value, in the least significant byte, to write to the register
Return Value: None