#include "queue.h"
#include "isrDisp.h"
#include <eventManager.h>
Include dependency graph for extio.h:
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | extioDisp_call |
function pointer and argument to call More... | |
struct | extio |
Structure definition for the external io module. More... | |
Defines | |
#define | EXTIO_SW0_HIGH EXTIO_PB0_HIGH |
#define | EXTIO_SW0_LOW EXTIO_PB0_LOW |
#define | EXTIO_SW1_HIGH EXTIO_PB1_HIGH |
#define | EXTIO_SW1_LOW EXTIO_PB1_LOW |
#define | EXTIO_SW2_HIGH EXTIO_PB2_HIGH |
#define | EXTIO_SW2_LOW EXTIO_PB2_LOW |
#define | EXTIO_SW3_HIGH EXTIO_PB3_HIGH |
#define | EXTIO_SW3_LOW EXTIO_PB3_LOW |
Typedefs | |
typedef extioDisp_call | extioDisp_call_t |
function pointer and argument to call | |
typedef extio | extio_t |
Structure definition for the external io module. | |
Enumerations | |
enum | extio_output { EXTIO_LED_FIRST = 0, EXTIO_LED0 = 0, EXTIO_LED1 = 1, EXTIO_LED2 = 2, EXTIO_LED3 = 3, EXTIO_LED4 = 4, EXTIO_LED5 = 5, EXTIO_LED6 = 6, EXTIO_LED7 = 7, EXTO_LED_INVALID = 8 } |
Outputs on the External IO. More... | |
enum | extio_input { EXTIO_INPUT_FIRST = 1, EXTIO_PB0_HIGH = EXTIO_INPUT_FIRST, EXTIO_PB0_LOW = 2, EXTIO_PB1_HIGH = 3, EXTIO_PB1_LOW = 4, EXTIO_SW2_HIGH = 5, EXTIO_SW2_LOW = 6, EXTIO_SW3_HIGH = 7, EXTIO_SW3_LOW = 8, EXTIO_SW4_HIGH = 9, EXTIO_SW4_LOW = 10, EXTIO_SW5_HIGH = 11, EXTIO_SW5_LOW = 12, EXTIO_SW6_HIGH = 13, EXTIO_SW6_LOW = 14, EXTIO_SW7_HIGH = 15, EXTIO_SW7_LOW = 16, EXTIO_INVALID = 17 } |
Input events from external IO. More... | |
enum | iostatus { EXTIO_LED_OFF = 0, EXTIO_SWITCH_OFF = 0, EXTIO_LED_ON = 1, EXTIO_SWITCH_ON = 1 } |
io status More... | |
Functions | |
int | extio_init (isrDisp_t *pIsrDisp) |
Initialize external i/o
| |
int | extio_startup (void) |
startup external i/o
| |
int | extio_ledConfig (extio_output iotype) |
Configure LED as an output. | |
int | extio_ledOn (extio_output) |
Turn on one led
| |
int | extio_ledOff (extio_output) |
Turn off one led
| |
int | extio_ledToggle (extio_output) |
Toggle one led
| |
iostatus | extio_ledStatus (extio_output) |
Check led status
| |
int | extio_ledGroupOn (unsigned char ledMask) |
Turn on group of leds
| |
int | extio_ledGroupOff (unsigned char ledMask) |
Turn off group of leds
| |
int | extio_ledGroupToggle (unsigned char ledMask) |
Toggle group of leds
| |
unsigned char | extio_ledGroupStatus (unsigned char ledMask) |
Check the status of a group of leds
| |
int | extio_eventSubscribe (extio_input IOInput) |
Subscribe an external io event to the callback table
| |
int | extio_eventUnsubscribe (extio_input IOInput) |
Unsubscribe an external io event to the callback table
| |
int | extio_callbackRegister (extio_input IOInput, tFuncPtr pFunc, void *pArg) |
Register call back function to the callback table
| |
int | extio_callbackUnregister (extio_input IOInput, tFuncPtr pFunc, void *pArg) |
Unregister call back function to the callback table
| |
int | extio_eventGet (extio_input *pEvent) |
Get an external io event from a queue
| |
iostatus | extio_switchStatusGet (extio_input IOInput) |
Query the current status of a switch. | |
unsigned char | extio_switchGroupStatusGet (unsigned char switchMask) |
Query the current status of switch. | |
int | extio_swConfig (extio_input itype) |
Configure switch as an input. |
#define EXTIO_SW0_HIGH EXTIO_PB0_HIGH |
#define EXTIO_SW0_LOW EXTIO_PB0_LOW |
#define EXTIO_SW1_HIGH EXTIO_PB1_HIGH |
#define EXTIO_SW1_LOW EXTIO_PB1_LOW |
#define EXTIO_SW2_HIGH EXTIO_PB2_HIGH |
#define EXTIO_SW2_LOW EXTIO_PB2_LOW |
#define EXTIO_SW3_HIGH EXTIO_PB3_HIGH |
#define EXTIO_SW3_LOW EXTIO_PB3_LOW |
typedef struct extioDisp_call extioDisp_call_t |
function pointer and argument to call
enum extio_input |
Input events from external IO.
enum extio_output |
enum iostatus |
int extio_callbackRegister | ( | extio_input | IOInput, | |
tFuncPtr | pFunc, | |||
void * | pArg | |||
) |
Register call back function to the callback table
Parameters:
IOInput | the event id | |
pFunc | callback function pointer | |
pArg | callback function parameter |
return error if GPIO is used in a different function
register only if nothing is registered yet
int extio_callbackUnregister | ( | extio_input | IOInput, | |
tFuncPtr | pFunc, | |||
void * | pArg | |||
) |
Unregister call back function to the callback table
Parameters:
IOInput | the event id | |
pFunc | callback function pointer | |
pArg | callback function parameter |
int extio_eventGet | ( | extio_input * | pEvent | ) |
Get an external io event from a queue
Parameters:
pEvent | the pointer to the io event |
int extio_eventSubscribe | ( | extio_input | IOInput | ) |
Subscribe an external io event to the callback table
Parameters:
IOInput | the event id |
register event put as a call back, it will place the according event in queue
int extio_eventUnsubscribe | ( | extio_input | IOInput | ) |
Unsubscribe an external io event to the callback table
Parameters:
IOInput | the event id |
int extio_init | ( | isrDisp_t * | pIsrDisp | ) |
Initialize external i/o
Parameters:
pIsrDisp | pointer to ISR Dispatcher |
initialize event queue
register own ISR with isr dispatcher
initialize the event table
return error if GPIO is used in a different function
Default initialization Set 0-7 as OUTPUT 8-15 as input
int extio_ledConfig | ( | extio_output | iotype | ) |
Configure LED as an output.
Parameters:
iotype | LED to configure |
return error if GPIO is used in a different function
int extio_ledGroupOff | ( | unsigned char | ledMask | ) |
Turn off group of leds
Parameters:
ledMask | led mask |
int extio_ledGroupOn | ( | unsigned char | ledMask | ) |
Turn on group of leds
Parameters:
ledMask | led mask |
unsigned char extio_ledGroupStatus | ( | unsigned char | ledMask | ) |
Check the status of a group of leds
Parameters:
ledMask | led mask |
int extio_ledGroupToggle | ( | unsigned char | ledMask | ) |
Toggle group of leds
Parameters:
ledMask | led mask |
int extio_ledOff | ( | extio_output | led | ) |
Turn off one led
Parameters:
iotype | led number |
int extio_ledOn | ( | extio_output | led | ) |
Turn on one led
Parameters:
iotype | led number |
iostatus extio_ledStatus | ( | extio_output | led | ) |
Check led status
Parameters:
iotype | led number |
int extio_ledToggle | ( | extio_output | led | ) |
Toggle one led
Parameters:
iotype | led number |
int extio_startup | ( | void | ) |
startup external i/o
Parameters:
int extio_swConfig | ( | extio_input | itype | ) |
Configure switch as an input.
Parameters:
iotype | switch to configure |
return error if GPIO is used in a different function
unsigned char extio_switchGroupStatusGet | ( | unsigned char | switchMask | ) |
Query the current status of switch.
Parameters:
IOInput | switch to query (could be pushed or released) |
iostatus extio_switchStatusGet | ( | extio_input | IOInput | ) |
Query the current status of a switch.
Parameters:
IOInput | switch to query (could be pushed or released) |