PER Firmware
Loading...
Searching...
No Matches
exti.c File Reference

G4 EXTI public API implementation. More...

Include dependency graph for exti.c:

Functions

static bool exti_validate_config (const PHAL_EXTI_InitConfig_t config[], size_t config_len)
 
bool PHAL_EXTI_init (const PHAL_EXTI_InitConfig_t config[], size_t config_len)
 Configure GPIO EXTI lines from a configuration table.
 
bool PHAL_EXTI_deinit (GPIO_TypeDef *bank, uint8_t pin)
 Disable a configured GPIO EXTI line.
 
static void exti_dispatch (uint32_t line_mask)
 
void PHAL_EXTI_callback (GPIO_TypeDef *bank, uint8_t pin)
 Weak callback invoked for each pending GPIO EXTI line.
 
void EXTI0_IRQHandler (void)
 
void EXTI1_IRQHandler (void)
 
void EXTI2_IRQHandler (void)
 
void EXTI3_IRQHandler (void)
 
void EXTI4_IRQHandler (void)
 
void EXTI9_5_IRQHandler (void)
 
void EXTI15_10_IRQHandler (void)
 

Detailed Description

G4 EXTI public API implementation.

Author
Ronak Jain (jain7.nosp@m.17@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ EXTI0_IRQHandler()

void EXTI0_IRQHandler ( void )
Here is the call graph for this function:

◆ EXTI15_10_IRQHandler()

void EXTI15_10_IRQHandler ( void )
Here is the call graph for this function:

◆ EXTI1_IRQHandler()

void EXTI1_IRQHandler ( void )
Here is the call graph for this function:

◆ EXTI2_IRQHandler()

void EXTI2_IRQHandler ( void )
Here is the call graph for this function:

◆ EXTI3_IRQHandler()

void EXTI3_IRQHandler ( void )
Here is the call graph for this function:

◆ EXTI4_IRQHandler()

void EXTI4_IRQHandler ( void )
Here is the call graph for this function:

◆ EXTI9_5_IRQHandler()

void EXTI9_5_IRQHandler ( void )
Here is the call graph for this function:

◆ exti_dispatch()

static void exti_dispatch ( uint32_t line_mask)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exti_validate_config()

static bool exti_validate_config ( const PHAL_EXTI_InitConfig_t config[],
size_t config_len )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_EXTI_callback()

void PHAL_EXTI_callback ( GPIO_TypeDef * bank,
uint8_t pin )

Weak callback invoked for each pending GPIO EXTI line.

Called from an EXTI interrupt handler. Keep overrides short and non-blocking. For both-edge triggers, sample the GPIO input to determine its current level. The default implementation does nothing.

Parameters
bankGPIO port that generated the interrupt
pinPin number, 0-15
Here is the caller graph for this function:

◆ PHAL_EXTI_deinit()

bool PHAL_EXTI_deinit ( GPIO_TypeDef * bank,
uint8_t pin )

Disable a configured GPIO EXTI line.

The line is disabled only when its current SYSCFG route matches bank/pin. A shared NVIC interrupt is disabled when no GPIO EXTI lines in its group remain enabled.

Parameters
bankGPIO port containing the input pin
pinPin number, 0-15
Returns
true if the route matched and the line was disabled; false otherwise
Here is the call graph for this function:

◆ PHAL_EXTI_init()

bool PHAL_EXTI_init ( const PHAL_EXTI_InitConfig_t config[],
size_t config_len )

Configure GPIO EXTI lines from a configuration table.

Configure the corresponding GPIO pins as inputs separately with PHAL_GPIO_init(). Only pins 0-15 can be used, and each pin number can be routed from one GPIO port at a time. Configuring a line selects its port, trigger edge, interrupt mask, and shared NVIC interrupt. Entries are all validated before any line is changed; duplicate pin numbers are rejected. The IRQ priority is set from each entry's irq_priority. Lines 0-4 each have a separate IRQ; lines 5-9 share EXTI9_5_IRQn and lines 10-15 share EXTI15_10_IRQn. Entries sharing a vector must specify the same priority, including any already-enabled sibling lines. Priorities must fit the device's implemented NVIC priority bits.

Parameters
configArray of line configurations; may be nullptr when config_len is zero
config_lenNumber of entries in config
Returns
true if every configuration is valid and applied; false otherwise
Here is the call graph for this function:
Here is the caller graph for this function: