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;
}
Содержание 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: ......