Chapter 4: Software
Omnii HDK API Functions
Psion Teklogix Omnii HDK User Manual
47
4.7.4.13 Hdk7545_ExpansionGetPinFunction
Syntax
DWORD Hdk7545_ExpansionGetPinFunction( HANDLE hdk, DWORD pin,
Hdk7545_PinFunction *function );
Parameters
•
hdk – [in] an open HDK handle.
•
pin – [in] the ID of the expansion connector pin. The pin parameter must be set to one of the
HDK7545_GPIO_PIN_EXPANSION_xxx values.
•
function – [out] pointer to the current pin function (GPIO or alternate).
Description
Retrieves the currently configured function of the specified pin. See the description for
“Hdk7545_ExpansionSetPinFunction”
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_PARAMETER – the specified pin is not valid, or the pin function pointer
is null.
•
ERROR_INVALID_DATA - an exception was generated.
•
Other errors are possible.
Sample Code
Hdk7545_ExpansionSetPinFunction(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO7_CSN,Hdk7545_PinFunction_Alternate);
Hdk7545_Close(&hdkHandle);
Hdk7545_Close(&hdkHandle);
return ERROR_SUCCESS;
}
// get and print the current functions for Expansion 1's GPIO 0 - 3
DWORD GetFunction()
{
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_PinFunction functions[4] = {
Hdk7545_PinFunction_GPIO,Hdk7545_PinFunction_GPIO,
Hdk7545_PinFunction_GPIO,Hdk7545_PinFunction_GPIO
} ;
Hdk7545_ExpansionGetPinFunction(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO0_TXD, &functions[0]);
Hdk7545_ExpansionGetPinFunction(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO1_RXD, &functions[1]);
Hdk7545_ExpansionGetPinFunction(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO2_CTSN, &functions[2]);
Hdk7545_ExpansionGetPinFunction(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO3_RTSN, &functions[3]);
Содержание 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: ......