inc/extio.h File Reference

#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
  • initialize GPIO port F.

int extio_startup (void)
 startup external i/o
  • startup GPIO port F

int extio_ledConfig (extio_output iotype)
 Configure LED as an output.
int extio_ledOn (extio_output)
 Turn on one led
  • Turn on one led according to input parameter.

int extio_ledOff (extio_output)
 Turn off one led
  • Turn off one led according to input parameter.

int extio_ledToggle (extio_output)
 Toggle one led
  • Toggle one led according to input parameter.

iostatus extio_ledStatus (extio_output)
 Check led status
  • Check led status.

int extio_ledGroupOn (unsigned char ledMask)
 Turn on group of leds
  • Turn on group of leds according to ledMask.

int extio_ledGroupOff (unsigned char ledMask)
 Turn off group of leds
  • Turn off group of leds according to ledMask.

int extio_ledGroupToggle (unsigned char ledMask)
 Toggle group of leds
  • Toggle group of leds according to ledMask.

unsigned char extio_ledGroupStatus (unsigned char ledMask)
 Check the status of a group of leds
  • Check the status of a group of leds.

int extio_eventSubscribe (extio_input IOInput)
 Subscribe an external io event to the callback table
  • Subscribe an external io event to the callback table.

int extio_eventUnsubscribe (extio_input IOInput)
 Unsubscribe an external io event to the callback table
  • 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
  • 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
  • Unregister call back function to the callback table.

int extio_eventGet (extio_input *pEvent)
 Get an external io event from a queue
  • 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 Documentation

#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 Documentation

typedef struct extio extio_t

Structure definition for the external io module.

typedef struct extioDisp_call extioDisp_call_t

function pointer and argument to call


Enumeration Type Documentation

enum extio_input

Input events from external IO.

Enumerator:
EXTIO_INPUT_FIRST 
EXTIO_PB0_HIGH 
EXTIO_PB0_LOW 
EXTIO_PB1_HIGH 
EXTIO_PB1_LOW 
EXTIO_SW2_HIGH 
EXTIO_SW2_LOW 
EXTIO_SW3_HIGH 
EXTIO_SW3_LOW 
EXTIO_SW4_HIGH 
EXTIO_SW4_LOW 
EXTIO_SW5_HIGH 
EXTIO_SW5_LOW 
EXTIO_SW6_HIGH 
EXTIO_SW6_LOW 
EXTIO_SW7_HIGH 
EXTIO_SW7_LOW 
EXTIO_INVALID 

enum extio_output

Outputs on the External IO.

Enumerator:
EXTIO_LED_FIRST 
EXTIO_LED0 
EXTIO_LED1 
EXTIO_LED2 
EXTIO_LED3 
EXTIO_LED4 
EXTIO_LED5 
EXTIO_LED6 
EXTIO_LED7 
EXTO_LED_INVALID 

enum iostatus

io status

Enumerator:
EXTIO_LED_OFF 
EXTIO_SWITCH_OFF 
EXTIO_LED_ON 
EXTIO_SWITCH_ON 


Function Documentation

int extio_callbackRegister ( extio_input  IOInput,
tFuncPtr  pFunc,
void *  pArg 
)

Register call back function to the callback table

Parameters:

Parameters:
IOInput the event id
pFunc callback function pointer
pArg callback function parameter
Returns:
Zero on success. Negative value on failure.

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:

Parameters:
IOInput the event id
pFunc callback function pointer
pArg callback function parameter
Returns:
Zero on success. Negative value on failure.

int extio_eventGet ( extio_input pEvent  ) 

Get an external io event from a queue

Parameters:

Parameters:
pEvent the pointer to the io event
Returns:
the pointer to the external io event

int extio_eventSubscribe ( extio_input  IOInput  ) 

Subscribe an external io event to the callback table

Parameters:

Parameters:
IOInput the event id
Returns:
Zero on success. Negative value on failure.

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:

Parameters:
IOInput the event id
Returns:
Zero on success. Negative value on failure.

int extio_init ( isrDisp_t pIsrDisp  ) 

Initialize external i/o

Parameters:

Parameters:
pIsrDisp pointer to ISR Dispatcher
Returns:
Zero on success. Negative value on failure.

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:

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:

Parameters:
ledMask led mask
Returns:
Zero on success. Negative value on failure.

int extio_ledGroupOn ( unsigned char  ledMask  ) 

Turn on group of leds

Parameters:

Parameters:
ledMask led mask
Returns:
Zero on success. Negative value on failure.

unsigned char extio_ledGroupStatus ( unsigned char  ledMask  ) 

Check the status of a group of leds

Parameters:

Parameters:
ledMask led mask
Returns:
an unsigned char indicating the leds status.

int extio_ledGroupToggle ( unsigned char  ledMask  ) 

Toggle group of leds

Parameters:

Parameters:
ledMask led mask
Returns:
Zero on success. Negative value on failure.

int extio_ledOff ( extio_output  led  ) 

Turn off one led

Parameters:

Parameters:
iotype led number
Returns:
Zero on success. Negative value on failure.

int extio_ledOn ( extio_output  led  ) 

Turn on one led

Parameters:

Parameters:
iotype led number
Returns:
Zero on success. Negative value on failure.

iostatus extio_ledStatus ( extio_output  led  ) 

Check led status

Parameters:

Parameters:
iotype led number
Returns:
iostatus of the led

int extio_ledToggle ( extio_output  led  ) 

Toggle one led

Parameters:

Parameters:
iotype led number
Returns:
Zero on success. Negative value on failure.

int extio_startup ( void   ) 

startup external i/o

Parameters:

Returns:
Zero on success. Negative value on failure.

int extio_swConfig ( extio_input  itype  ) 

Configure switch as an input.

Parameters:

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:

Parameters:
IOInput switch to query (could be pushed or released)
Returns:
status of the switch EXTIO_SWITCH_ON if pushed / switched on EXTIO_SWITCH_OFF if not pushed / switched off

iostatus extio_switchStatusGet ( extio_input  IOInput  ) 

Query the current status of a switch.

Parameters:

Parameters:
IOInput switch to query (could be pushed or released)
Returns:
status of the switch EXTIO_SWITCH_ON if pushed / switched on EXTIO_SWITCH_OFF if not pushed / switched off


Generated on 3 Mar 2014 for PAL bare-c Library by  doxygen 1.4.7