Interrupts library.
More...
|
#define | NUM_STM32L433X_INTERRUPT_CHANNELS 83U |
| Indexed number of STM32L433 NVIC entires from data sheet and IRQn_Type enum.
|
|
#define | NUM_STM32L433X_EXTI_LINES 16U |
| Number of external interrupt lines.
|
|
|
typedef struct InterruptSettings | InterruptSettings |
| Interrupt configuration structure.
|
|
Interrupts library.
◆ InterruptClass
Interrupt class selection.
Enumerator |
---|
INTERRUPT_TYPE_INTERRUPT | Interrupt type runs a callback as soon as the interrupt is triggered
|
INTERRUPT_TYPE_EVENT | Event type wakes the device without running a callback
|
NUM_INTERRUPT_CLASSES | Number of supported interrupt classes
|
◆ InterruptEdge
Defines on what edge of an input signal the interrupt triggers on.
Not necessarily applicable for all interrupts, however external interrupts will use them
Enumerator |
---|
INTERRUPT_EDGE_RISING | Rising edge interrupt triggers when a signal goes from LOW to HIGH
|
INTERRUPT_EDGE_FALLING | Falling edge interrupt triggers when a signal goes from HIGH to LOW
|
INTERRUPT_EDGE_TRANSITION | Transition interrupt triggers when a signal goes from LOW to HIGH or from HIGH to LOW
|
NUM_INTERRUPT_EDGES | Number of supported interrupt edges
|
◆ InterruptPriority
Interrupt priority level selection.
Start counting at configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY, as ISR safe FreeRTOS API can only be called from interrupts that have a priority <= configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY. Since priorities decrease with greater value (0 is highest priority, but is reserved), interrupt priorities must be greater than configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY.
◆ interrupt_exti_clear_pending()
StatusCode interrupt_exti_clear_pending |
( |
uint8_t |
line | ) |
|
Clears the pending flag for an external interrupt.
- Parameters
-
line | Numeric ID of the EXTI line (GPIO Pin number) |
- Returns
- STATUS_CODE_OK if the channel is successfully initialized STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect
◆ interrupt_exti_enable()
Enables an external interrupt line with the given settings.
- Parameters
-
address | Pointer to the GPIO address |
settings | Pointer to the interrupt settings |
- Returns
- STATUS_CODE_OK if the channel is successfully initialized STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect
◆ interrupt_exti_get_pending()
StatusCode interrupt_exti_get_pending |
( |
uint8_t |
line, |
|
|
uint8_t * |
pending_bit |
|
) |
| |
Get the pending flag for an external interrupt.
- Parameters
-
line | Numeric ID of the EXTI line (GPIO Pin number) |
pending_bit | Pointer to a variable that is updated with the pending bit |
- Returns
- STATUS_CODE_OK if the channel is successfully initialized STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect
◆ interrupt_exti_set_mask()
StatusCode interrupt_exti_set_mask |
( |
uint8_t |
line, |
|
|
bool |
masked |
|
) |
| |
Masks or clears the external interrupt on a given line.
- Parameters
-
line | Numeric ID of the EXTI line (GPIO Pin number) |
masked | 0: Clears the interrupt 1: Mask the lines interrupt |
- Returns
- STATUS_CODE_OK if the channel is successfully initialized STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect
◆ interrupt_exti_trigger()
Triggers a software interrupt on a given external interrupt channel.
- Parameters
-
line | Numeric ID of the EXTI line (GPIO Pin number) |
- Returns
- STATUS_CODE_OK if the channel is successfully initialized STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect
◆ interrupt_init()
void interrupt_init |
( |
void |
| ) |
|
Initializes the interrupt internals.
If called multiple times the subsequent attempts will clear everything resulting in needing to re-initialize all interrupts
◆ interrupt_nvic_enable()
Enables the nested interrupt vector controller for a given channel.
- Parameters
-
irq_channel | Numeric ID of the interrupt channel from the NVIC |
priority | Priority level of the interrupt |
- Returns
- STATUS_CODE_OK if the channel is successfully initialized STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect