
SC5305A Operating & Programming Manual
Rev 2.1.0
40
Function:
sc5305a_ReadUserEeprom
Definition:
int sc5305a_ReadUserEeprom(unsigned int *deviceHandle, unsigned int memAdd,
unsigned char *byteData)
Return:
The status of the function
Input:
unsigned int *deviceHandle
(handle to the opened device)
unsigned int memAdd
(EEPROM memory address)
Output:
unsigned char *byteData
(the read byte data)
Description:
sc5305a_ReadUserEeprom
reads back a byte from the memory address of the user
EEPROM.
Function:
sc5305a_ReadUserEepromBulk
Definition:
int sc5305a_ReadUserEepromBulk(unsigned int *deviceHandle,
unsigned int startMemAdd, unsigned char *byteDataArray)
Return:
The status of the function
Input:
unsigned int *deviceHandle
(handle to the opened device)
unsigned int memAdd
(EEPROM start memory address)
Output:
unsigned char *byteData
(the read 64 bytes of data)
Description:
sc5305a_ReadUserEepromBulk
reads back 64 bytes beginning at the start memory
address of the user EEPROM.
Example:
Code to read back 512 bytes of data starting at address 1024 into eepromData:
unsigned
char
eepromData = (
unsigned
char
*)malloc(512);
unsigned
char
*bufferIn = (
unsigned
char
*)malloc(64);
int
i = 0;
int
bufferCount = 0;
unsigned
int
add = 1024;
while
(bufferCount < 8){
int
status = sc5305a_ReadUserEepromBulk(deviceHandle, add+bufferCount*64, bufferIn);
for
(i = 0; i < 64; i++) eepromData[i + bufferCount*64] = bufferIn[i];
buffe+;
}
free(bufferIn);