Chapter 4: Software
Omnii HDK API Functions
44
Psion Teklogix Omnii HDK User Manual
The following restrictions apply to the pin mode configuration:
1. Omnii XT10 only allows level-trigger interrupts to be configured, and only one type (low or
high, not both).
2. Future Omnii models will allow both edge- and level-triggered interrupts to be
configured, but not at the same time. If level-triggered interrupts are configured, only one
type can be enabled (low or high, not both). If edge-triggered interrupts are configured,
either one type (high-low or low-high) or both types can be configured. If a driver or
application attempts to configure both level- and edge-triggered interrupts at the same
time, the level-triggered interrupts take precedence.
The pin mode only needs to be configured if a pin is being used as a GPIO line.
A non-zero pin mode should only be set for pins configured as inputs (see
“Hdk7545_ExpansionSetPinDirection” on page 41).
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_PARAMETER – the specified pin is not valid.
•
ERROR_INVALID_DATA - an exception was generated.
•
Other errors are possible.
Sample Code
4.7.4.11 Hdk7545_ExpansionGetPinMode
Syntax
DWORD Hdk7545_ExpansionGetPinMode( HANDLE hdk, DWORD pin, DWORD *mode );
Parameters
•
hdk – [in] an open HDK handle.
// set the RX & CTSN pins as inputs, and configure their modes to level-triggered
// interrupts [high and low, respectively].
DWORD SetMode()
{
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_ExpansionSetPinDirection(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO1_RXD,Hdk7545_PinDirection_Input);
Hdk7545_ExpansionSetPinDirection(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO2_CTSN,Hdk7545_PinDirection_Input);
Hdk7545_ExpansionSetPinMode(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO1_RXD,Hdk7545_PinMode_InterruptHigh);
Hdk7545_ExpansionSetPinMode(hdkHandle,
HDK7545_GPIO_PIN_EXPANSION_GPIO2_CTSN,Hdk7545_PinMode_InterruptLow);
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: ......