SDK3.5
This document shows Ameba SDK 3.5 APIs
Enumerator
GPIO_IRQ

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
objgpio irq object define in application software.
Return values
none
void gpio_irq_enable ( gpio_irq_t *  obj)

Enable gpio interrupt.

Parameters
objgpio 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
objgpio 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
objgpio irq object define in application software.
pinPinName according to pinmux spec.
handlerInterrupt handler to be assigned to the specified pin.
idhandler 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
objgpio irq object define in application software.
eventgpio 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
enablethis 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
objgpio irq object define in application software.
eventgpio 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