ACR89U-A1 – Reference Manual
Version 1.04
www.acs.com.hk
Page 44 of 57
4.2.3.2. AS_AccessEEProm
This function allows user to write or read data to/from the EEPROM. Maximum allowed data length is
256 bytes.
AS_STATUS AS_DECL
AS_AccessEEPRom
(
IN INT nDevId,
IN PACCESSEEPROM pEEPRom);
Parameters:
nDevId
[in] Handle returned by a previous call to AS_Open.
pEEPRom
[in] Pointer to an
ACCESSEEPROM
structure that contains the data to be written to
ACR89. or the data read from the ACR89. See also
Section 4.1.4.2
information about the
ACCESSEEPROM
structure.
Return Values:
AS_STATUS
This functions returns different values depending on whether it succeeds or
fails.
AS_STATUS.DllError
contains the status as returned by the DLL.
AS_STATUS.W32Error
contains the Win32 error code associated with the
DLL error, if any. See also Appendix A for the possible return codes.
Example:
4.2.3.3. AS_AccessSerialFlash
This function allows user to write or read data to/from the serial flash. Maximum allowed data length is
256 bytes.
AS_STATUS AS_DECL
AS_AccessSerialFlash
(
IN INT nDevId,
IN PACCESSSERIALFLASH pSerialFlash);
INT nDid;
ACCESSEEPROM eeprom;
BYTE aData[256];
AS_STATUS status;
//read the EEPROM data from address 0x0000
//assumed is a connection has already been established
eeprom.cbAccessMode = READ_EEPROM;
eeprom.wAddress = 0x0000;
eeprom.wDataLength = 0x0100;
eeprom.pData = aData;
status = AS_AccessEEPRom(nDid, &eeprom);
if (status.DLLError == CMD_SUCCESS) {
//do something with the data read
}
else {
//error occurred
}
return status;