Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gpio_intc_stm32.h File Reference
#include <zephyr/types.h>
#include <zephyr/drivers/gpio.h>

Go to the source code of this file.

Typedefs

typedef uint32_t stm32_gpio_irq_line_t
 GPIO interrupt controller API for STM32 MCUs.
 
typedef void(* stm32_gpio_irq_cb_t) (gpio_port_pins_t pin, void *user)
 GPIO interrupt callback function signature.
 

Enumerations

enum  stm32_gpio_irq_trigger {
  STM32_GPIO_IRQ_TRIG_NONE = 0x0 , STM32_GPIO_IRQ_TRIG_RISING = 0x1 , STM32_GPIO_IRQ_TRIG_FALLING = 0x2 , STM32_GPIO_IRQ_TRIG_BOTH = 0x3 ,
  STM32_GPIO_IRQ_TRIG_HIGH_LEVEL = 0x4 , STM32_GPIO_IRQ_TRIG_LOW_LEVEL = 0x5
}
 GPIO interrupt trigger flags. More...
 

Functions

stm32_gpio_irq_line_t stm32_gpio_intc_get_pin_irq_line (uint32_t port, gpio_pin_t pin)
 Get the GPIO interrupt line value corresponding to specified pin of GPIO port port.
 
void stm32_gpio_intc_enable_line (stm32_gpio_irq_line_t line)
 Enable GPIO interrupts for specified line.
 
void stm32_gpio_intc_disable_line (stm32_gpio_irq_line_t line)
 Disable GPIO interrupts for specified line.
 
void stm32_gpio_intc_select_line_trigger (stm32_gpio_irq_line_t line, uint32_t trg)
 Select trigger for interrupt on specified GPIO line.
 
int stm32_gpio_intc_set_irq_callback (stm32_gpio_irq_line_t line, stm32_gpio_irq_cb_t cb, void *user)
 Set callback invoked when an interrupt occurs on specified GPIO line.
 
void stm32_gpio_intc_remove_irq_callback (stm32_gpio_irq_line_t line)
 Removes the interrupt callback of specified EXTI line.
 

Typedef Documentation

◆ stm32_gpio_irq_cb_t

typedef void(* stm32_gpio_irq_cb_t) (gpio_port_pins_t pin, void *user)

GPIO interrupt callback function signature.

Parameters
pinGPIO pin on which interrupt occurred
userdata provided to stm32_gpio_intc_set_irq_callback
Note
This callback is invoked in ISR context.

◆ stm32_gpio_irq_line_t

GPIO interrupt controller API for STM32 MCUs.

This API is used to interact with the GPIO interrupt controller of STM32 microcontrollers.

Opaque type representing a GPIO interrupt line

Enumeration Type Documentation

◆ stm32_gpio_irq_trigger

GPIO interrupt trigger flags.

Enumerator
STM32_GPIO_IRQ_TRIG_NONE 
STM32_GPIO_IRQ_TRIG_RISING 
STM32_GPIO_IRQ_TRIG_FALLING 
STM32_GPIO_IRQ_TRIG_BOTH 
STM32_GPIO_IRQ_TRIG_HIGH_LEVEL 
STM32_GPIO_IRQ_TRIG_LOW_LEVEL 

Function Documentation

◆ stm32_gpio_intc_disable_line()

void stm32_gpio_intc_disable_line ( stm32_gpio_irq_line_t  line)

Disable GPIO interrupts for specified line.

Parameters
lineGPIO interrupt line

◆ stm32_gpio_intc_enable_line()

void stm32_gpio_intc_enable_line ( stm32_gpio_irq_line_t  line)

Enable GPIO interrupts for specified line.

Parameters
lineGPIO interrupt line

◆ stm32_gpio_intc_get_pin_irq_line()

stm32_gpio_irq_line_t stm32_gpio_intc_get_pin_irq_line ( uint32_t  port,
gpio_pin_t  pin 
)

Get the GPIO interrupt line value corresponding to specified pin of GPIO port port.

◆ stm32_gpio_intc_remove_irq_callback()

void stm32_gpio_intc_remove_irq_callback ( stm32_gpio_irq_line_t  line)

Removes the interrupt callback of specified EXTI line.

Parameters
lineEXTI interrupt line

◆ stm32_gpio_intc_select_line_trigger()

void stm32_gpio_intc_select_line_trigger ( stm32_gpio_irq_line_t  line,
uint32_t  trg 
)

Select trigger for interrupt on specified GPIO line.

Parameters
lineGPIO interrupt line
trgInterrupt trigger (see stm32_gpio_irq_trigger)

◆ stm32_gpio_intc_set_irq_callback()

int stm32_gpio_intc_set_irq_callback ( stm32_gpio_irq_line_t  line,
stm32_gpio_irq_cb_t  cb,
void *  user 
)

Set callback invoked when an interrupt occurs on specified GPIO line.

Parameters
lineGPIO interrupt line
cbInterrupt callback function
userCustom user data for usage by the callback
Returns
0 on success, -EBUSY if a callback is already set for line