# GPIOINT
[EM_Drivers]

General Purpose Input/Output (GPIO) Interrupt Dispatcher API. More...

Collaboration diagram for GPIOINT:

## Typedefs

typedef void(* | GPIOINT_IrqCallbackPtr_t )(uint8_t pin)
| GPIO interrupt callback function pointer.

## Functions

void | GPIOINT_Init (void)
| Initialization of GPIOINT module.
void | GPIOINT_CallbackRegister (uint8_t pin, GPIOINT_IrqCallbackPtr_t callbackPtr)
| Registers user callback for given pin number.
static __INLINE void | GPIOINT_CallbackUnRegister (uint8_t pin)
| Unregisters user callback for given pin number.

## Detailed Description

General Purpose Input/Output (GPIO) Interrupt Dispatcher API.

This is a GPIO interrupt dispatcher module. It consists of gpiointerrupt.c and gpiointerrupt.h. EFM32 has two GPIO interrupts (Odd and Even). If more than two interrupts are used then interrupt routine must dispatch. This driver provides small dispatcher for both GPIO interrupts enabling handling of up to 16 GPIO pin interrupts.

It is up to the user to set up and enable interrupt on given pin. Dispatcher handles cleaning of interrupt flags.

In order to use GPIO Interrupt Dispatcher it has to be initialized first by calling GPIOINT_Init(). Then each pin must be configured by first registering the callback for given pin (GPIOINT_CallbackRegister()) and then setting up and enabling the interrupt in GPIO module.

## Typedef Documentation

typedef void(* GPIOINT_IrqCallbackPtr_t)(uint8_t pin)

GPIO interrupt callback function pointer.

Parameters:

- pin - The pin index the callback function is invoked for.

Definition at line 66 of file gpiointerrupt.h.

## Function Documentation

void GPIOINT_CallbackRegister | ( | uint8_t | pin,
|  | GPIOINT_IrqCallbackPtr_t | callbackPtr |
| ) |  |  |

Registers user callback for given pin number.

Use this function to register a callback which shall be called upon interrupt generated from given pin number (port is irrelevant). Interrupt itself must be configured externally. Function overwrites previously registered callback.

Parameters:

  `[in]` | pin | Pin number for the callback.
  `[in]` | callbackPtr | A pointer to callback function.

Definition at line 141 of file gpiointerrupt.c.

Referenced by GPIOINT_CallbackUnRegister().

Here is the caller graph for this function:

static __INLINE void GPIOINT_CallbackUnRegister | ( | uint8_t | pin | ) | `[static]`

Unregisters user callback for given pin number.

Use this function to unregister a callback.

Parameters:

  `[in]` | pin | Pin number for the callback.

Definition at line 86 of file gpiointerrupt.h.

References GPIOINT_CallbackRegister().

Here is the call graph for this function:

void GPIOINT_Init | ( | void |  | ) |

Initialization of GPIOINT module.

Definition at line 117 of file gpiointerrupt.c.