PebbleOS
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
External interrupts

GPIO edge interrupts. More...

Typedefs

typedef void(* ExtiHandlerCallback) (void)
 Interrupt handler, called in ISR context.
 

Enumerations

enum  ExtiTrigger { ExtiTrigger_Rising , ExtiTrigger_Falling , ExtiTrigger_RisingFalling }
 Edge that triggers the interrupt. More...
 

Functions

void exti_enable (ExtiConfig config)
 Enable the interrupt of a configured pin.
 
void exti_disable (ExtiConfig config)
 Disable the interrupt of a pin.
 
void exti_configure_pin (ExtiConfig cfg, ExtiTrigger trigger, ExtiHandlerCallback cb)
 Configure a pin as an interrupt source and register its handler.
 

Detailed Description

GPIO edge interrupts.

The pin is described by the board's ExtiConfig.

static void prv_int_handler(void) {
system_task_add_callback_from_isr(prv_handle_int, NULL);
}
exti_configure_pin(dev->int_exti, ExtiTrigger_Falling, prv_int_handler);
exti_enable(dev->int_exti);
void exti_configure_pin(ExtiConfig cfg, ExtiTrigger trigger, ExtiHandlerCallback cb)
Configure a pin as an interrupt source and register its handler.
void exti_enable(ExtiConfig config)
Enable the interrupt of a configured pin.
@ ExtiTrigger_Falling
Falling edge.
Definition exti.h:31
bool system_task_add_callback_from_isr(SystemTaskEventCallback cb, void *data)
Queue a callback from an ISR.

Typedef Documentation

◆ ExtiHandlerCallback

typedef void(* ExtiHandlerCallback) (void)

Interrupt handler, called in ISR context.

Enumeration Type Documentation

◆ ExtiTrigger

Edge that triggers the interrupt.

Enumerator
ExtiTrigger_Rising 

Rising edge.

ExtiTrigger_Falling 

Falling edge.

ExtiTrigger_RisingFalling 

Both edges.

Function Documentation

◆ exti_configure_pin()

void exti_configure_pin ( ExtiConfig  cfg,
ExtiTrigger  trigger,
ExtiHandlerCallback  cb 
)

Configure a pin as an interrupt source and register its handler.

The interrupt is delivered once enabled with exti_enable().

Parameters
cfgPin to configure.
triggerEdge that triggers the interrupt.
cbHandler, called in ISR context.

◆ exti_disable()

void exti_disable ( ExtiConfig  config)

Disable the interrupt of a pin.

Parameters
configPin configured with exti_configure_pin().

◆ exti_enable()

void exti_enable ( ExtiConfig  config)

Enable the interrupt of a configured pin.

Parameters
configPin configured with exti_configure_pin().