SDK4.0 This document shows Ameba SDK 4.0 APIs

- Main Page
- Modules
- Data Structures
- Files

Enumerator
GPIO_IRQ
Ameba SDK » HAL

gpio IRQ functions More...

## Ameba Common
enum | gpio_irq_event { IRQ_NONE, IRQ_RISE, IRQ_FALL }
typedef void(* | gpio_irq_handler) (uint32_t id, gpio_irq_event event)
int | gpio_irq_init (gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id)
| Initializes the GPIO device interrupt mode, include mode/trigger/polarity registers. More...
void | gpio_irq_free (gpio_irq_t *obj)
| Deinitializes the GPIO device interrupt mode, include mode/trigger/polarity registers. More...
void | gpio_irq_set (gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
| Enable/Disable gpio interrupt. More...
void | gpio_irq_enable (gpio_irq_t *obj)
| Enable gpio interrupt. More...
void | gpio_irq_disable (gpio_irq_t *obj)
| Disable gpio interrupt. More...
void | gpio_irq_set_event (gpio_irq_t *obj, gpio_irq_event event)
| Enable the specified gpio interrupt event. More...

## Detailed Description

gpio IRQ functions

## Function Documentation

void gpio_irq_disable | ( | gpio_irq_t * | obj | ) |

Disable gpio interrupt.

Parameters

  obj | gpio irq object define in application software.

Return values

  none |

void gpio_irq_enable | ( | gpio_irq_t * | obj | ) |

Enable gpio interrupt.

Parameters

  obj | gpio irq object define in application software.

Return values

  none |

void gpio_irq_free | ( | gpio_irq_t * | obj | ) |

Deinitializes the GPIO device interrupt mode, include mode/trigger/polarity registers.

Parameters

  obj | gpio irq object define in application software.

Return values

  none |

Note
  this API only works for Port A pins

int gpio_irq_init | ( | gpio_irq_t * | obj,
|  | PinName | pin,
|  | gpio_irq_handler | handler,
|  | uint32_t | id
| ) |  |

Initializes the GPIO device interrupt mode, include mode/trigger/polarity registers.

Parameters

  obj | gpio irq object define in application software.
  pin | PinName according to pinmux spec.
  handler | Interrupt handler to be assigned to the specified pin.
  id | handler id.

Return values

  none |

Note
  this API only works for Port A pins

void gpio_irq_set | ( | gpio_irq_t * | obj,
|  | gpio_irq_event | event,
|  | uint32_t | enable
| ) |  |

Enable/Disable gpio interrupt.

Parameters

  obj | gpio irq object define in application software.
  event | gpio interrupt event, this parameter can be one of the following values: IRQ_RISE: rising edge interrupt event IRQ_FALL: falling edge interrupt event IRQ_LOW: low level interrupt event IRQ_HIGH: high level interrupt event IRQ_NONE: no interrupt event
  enable | this parameter can be one of the following values: 0 disable gpio interrupt 1 enable gpio interrupt

Return values

  none |

void gpio_irq_set_event | ( | gpio_irq_t * | obj,
|  | gpio_irq_event | event
| ) |  |

Enable the specified gpio interrupt event.

Parameters

  obj | gpio irq object define in application software.
  event | gpio interrupt event, this parameter can be one of the following values: IRQ_RISE: rising edge interrupt event IRQ_FALL: falling edge interrupt event IRQ_LOW: low level interrupt event IRQ_HIGH: high level interrupt event IRQ_NONE: no interrupt event

Return values

  none |