Chapter 4: Software
Omnii HDK API Functions
Psion Teklogix Omnii HDK User Manual
53
Sample Code
4.7.4.19 Hdk7545_WriteEepromHeader
Syntax
DWORD Hdk7545_WriteEepromHeader( HANDLE hdk, Hdk7545_Eeprom *eeprom );
Parameters
•
hdk – [in] an open HDK handle.
•
eeprom – [in] pointer to an instance of Hdk7545_Eeprom containing the information to be
written to the EEPROM header.
Description
This function is used to modify the contents of the EEPROM header of the EEPROM on the
connector specified in the call to Hdk7545_Open().
The caller must set the correct version [HDK7545_EEPROM_VERSION] and the correct size
[sizeof(Hdk7545_Eeprom)] in the supplied Hdk7545_Eeprom structure. If the values supplied are
not correct, an error is returned.
The caller must also set a valid EEPROM size (m_EepromSize = 128|256|etc.). The EEPROM
size must be the actual total size of the EEPROM on the connector in bytes, and a multiple of 128.
If a size that is larger than the actual size of the EEPROM is written, the behaviour of further
DWORD ReadEeprom()
{
Hdk7545_Connector expansionSlot = Hdk7545_Connector_Expansion1;
HANDLE hdkHandle = INVALID_HANDLE_VALUE;
DWORD result = Hdk7545_Open(&hdkHandle, expansionSlot);
if( result != ERROR_SUCCESS ) {
return ERROR_NOT_SUPPORTED;
}
Hdk7545_Eeprom eeprom = { 0 };
eeprom.m_Size = sizeof(eeprom);
eeprom.m_Version = HDK7545_EEPROM_VERSION;
result = Hdk7545_ReadEepromHeader(hdkHandle, &eeprom);
if( result != ERROR_SUCCESS )
{
// found the EEPROM
}
else if( result == ERROR_NOT_FOUND )
{
// Expansion 1 is empty - no EEPROM found
}
else if( result == ERROR_REVISION_MISMATCH )
{
// software mismatch. the OS image or HDK expects the
// Hdk7545_Eeprom size to be different.
}
else
{
// some other error occurred.
}
Hdk7545_Close(&hdkHandle);
return ERROR_SUCCESS;
}
Summary of Contents for OMNii HDK XT10
Page 4: ......
Page 10: ......
Page 12: ......
Page 18: ......
Page 20: ......
Page 24: ......
Page 26: ......
Page 32: ......
Page 72: ......
Page 90: ......
Page 92: ......
Page 116: ......
Page 124: ......
Page 126: ......
Page 130: ......
Page 132: ......
Page 154: ......
Page 168: ......
Page 170: ......
Page 182: ......
Page 184: ......
Page 188: ......