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;
}
Содержание OMNii HDK XT10
Страница 4: ......
Страница 10: ......
Страница 12: ......
Страница 18: ......
Страница 20: ......
Страница 24: ......
Страница 26: ......
Страница 32: ......
Страница 72: ......
Страница 90: ......
Страница 92: ......
Страница 116: ......
Страница 124: ......
Страница 126: ......
Страница 130: ......
Страница 132: ......
Страница 154: ......
Страница 168: ......
Страница 170: ......
Страница 182: ......
Страница 184: ......
Страница 188: ......