Chapter 4: Software
Omnii HDK API Functions
50
Psion Teklogix Omnii HDK User Manual
4.7.4.16 Hdk7545_ExpansionSetPullUpDown
Syntax
DWORD Hdk7545_ExpansionSetPullUpDown( HANDLE hdk, DWORD pin,
Hdk7545_PullUpDown upDown, BOOL enable );
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.
•
upDown – [in] set to
Hdk7545_PullUpDown_Pullup
to enable/disable a pull-up, or to
Hdk7545_PullUpDown_PullDown
to enable/disable a pull-down.
•
enable – [in] if TRUE, the pull-up/pull-down is enabled. If FALSE it is disabled.
Description
Used to enable/disable a pull-up or pull-down on a pin.
It is not possible to enable both a pull-up and pull-down on the same pin simultaneously. If a
pull-up is enabled, an existing pull-down is disabled, and vice versa.
This function is not supported on
Omnii XT10
.
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_PARAMETER – the specified pin is not valid.
•
ERROR_INVALID_FUNCTION – the computer does not support setting a pull-up/pull-
down on this pin.
•
ERROR_INVALID_DATA - an exception was generated.
•
Other errors are possible.
Sample Code
// enable a pull-up on the Expansion 1
// HDK7545_GPIO_PIN_EXPANSION_GPIO0_CTSN pin.
DWORD SetPulldown()
{
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_ExpansionSetPullUpDown(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO0_TXD,
Hdk7545_PullUpDown_Pullup, FALSE);
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: ......