Skip to content

File syn_exti.c

FileList > drivers > syn_exti.c

Go to the source code of this file

GPIO interrupt dispatcher implementation.

  • #include "../util/syn_assert.h"
  • #include "syn_exti.h"
  • #include <string.h>

Classes

Type Name
struct EXTI_Entry
EXTI callback table entry.

Public Static Attributes

Type Name
size_t exti_count
EXTI_Entry exti_table

Public Functions

Type Name
size_t syn_exti_count (void)
Get the number of registered callbacks.
void syn_exti_disable (SYN_GPIO_Pin pin)
Disable interrupt for a pin.
void syn_exti_enable (SYN_GPIO_Pin pin)
Enable interrupt for a registered pin.
void syn_exti_init (void)
void syn_exti_irq_handler (SYN_GPIO_Pin pin)
IRQ handler — call from platform ISR.
SYN_Status syn_exti_register (SYN_GPIO_Pin pin, SYN_EXTI_Edge edge, SYN_EXTI_Callback cb, void * ctx)
Register a callback for a pin interrupt.
void syn_exti_unregister (SYN_GPIO_Pin pin)
Unregister a pin callback.

Public Static Functions

Type Name
EXTI_Entry * find_entry (SYN_GPIO_Pin pin)
Find the table entry for a given pin.

Public Static Attributes Documentation

variable exti_count

size_t exti_count;

Number of registered.


variable exti_table

EXTI_Entry exti_table[SYN_EXTI_MAX_PINS];

Registered callbacks.


Public Functions Documentation

function syn_exti_count

Get the number of registered callbacks.

size_t syn_exti_count (
    void
) 

Returns:

Registration count.


function syn_exti_disable

Disable interrupt for a pin.

void syn_exti_disable (
    SYN_GPIO_Pin pin
) 

Parameters:

  • pin GPIO pin.

function syn_exti_enable

Enable interrupt for a registered pin.

void syn_exti_enable (
    SYN_GPIO_Pin pin
) 

Parameters:

  • pin GPIO pin.

function syn_exti_init

void syn_exti_init (
    void
) 

Initialize the EXTI dispatcher.


function syn_exti_irq_handler

IRQ handler — call from platform ISR.

void syn_exti_irq_handler (
    SYN_GPIO_Pin pin
) 

Looks up the registered callback for pin and invokes it. This is the glue between hardware ISR and the dispatcher.

Parameters:

  • pin GPIO pin that triggered the interrupt.

function syn_exti_register

Register a callback for a pin interrupt.

SYN_Status syn_exti_register (
    SYN_GPIO_Pin pin,
    SYN_EXTI_Edge edge,
    SYN_EXTI_Callback cb,
    void * ctx
) 

Parameters:

  • pin GPIO pin.
  • edge Trigger edge.
  • cb Callback (runs in ISR context).
  • ctx User context passed to callback.

Returns:

SYN_OK, or SYN_ERROR if table full.


function syn_exti_unregister

Unregister a pin callback.

void syn_exti_unregister (
    SYN_GPIO_Pin pin
) 

Parameters:

  • pin GPIO pin.

Public Static Functions Documentation

function find_entry

Find the table entry for a given pin.

static EXTI_Entry * find_entry (
    SYN_GPIO_Pin pin
) 

Parameters:

  • pin GPIO pin.

Returns:

Pointer to entry, or NULL if not found.



The documentation for this class was generated from the following file src/syntropic/drivers/syn_exti.c