STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches
exti.h
Go to the documentation of this file.
1
22#ifndef EXTI_H
23#define EXTI_H
24
25#include "driver_status.h"
26#include "exti_reg.h"
27#include "gpio_reg.h"
28#include "syscfg_reg.h"
29
30#include <stdbool.h>
31#include <stdint.h>
32
37
38#define EXTI_LINE_MAX (22U)
39#define EXTI_GPIO_LINE_MAX (15U)
40
48
61 const GpioRegisters_t *port);
62
77 ExtiEdge_e edge);
78
87
96
110
120 bool *pending);
121
136
138
139#endif /* EXTI_H */
The status every fallible driver function returns.
EXTI registers: external interrupt and event lines (RM0390 section 10.3).
GPIO registers for ports A to H (RM0390 section 7.4).
DriverStatus_e
Outcome of a driver call: a category for control flow, not a diagnosis.
#define DRIVER_MUST_CHECK
Make ignoring a function's result a compile error (with -Werror).
DRIVER_MUST_CHECK DriverStatus_e extiIsPending(const ExtiRegisters_t *exti, uint32_t line, bool *pending)
Report whether line's pending bit (PR) is set.
Definition exti.c:191
ExtiEdge_e
Which edges of a line's input set its pending bit.
Definition exti.h:43
DRIVER_MUST_CHECK DriverStatus_e extiTriggerSoftware(ExtiRegisters_t *exti, uint32_t line)
Raise line's interrupt from software (SWIER).
Definition exti.c:178
DRIVER_MUST_CHECK DriverStatus_e extiSelectPort(SyscfgRegisters_t *syscfg, uint32_t line, const GpioRegisters_t *port)
Route GPIO pin line of port to EXTI line line.
Definition exti.c:86
DRIVER_MUST_CHECK DriverStatus_e extiDisableInterrupt(ExtiRegisters_t *exti, uint32_t line)
Mask line's interrupt (IMR).
Definition exti.c:166
DRIVER_MUST_CHECK DriverStatus_e extiClearPending(ExtiRegisters_t *exti, uint32_t line)
Clear line's pending bit, and its SWIER bit with it.
Definition exti.c:208
DRIVER_MUST_CHECK DriverStatus_e extiEnableInterrupt(ExtiRegisters_t *exti, uint32_t line)
Unmask line's interrupt (IMR).
Definition exti.c:154
DRIVER_MUST_CHECK DriverStatus_e extiConfigure(ExtiRegisters_t *exti, uint32_t line, ExtiEdge_e edge)
Set which edges trigger line; the other edge is cleared.
Definition exti.c:118
@ EXTI_EDGE_RISING
Rising edge only (RTSR).
Definition exti.h:44
@ EXTI_EDGE_BOTH
Both edges.
Definition exti.h:46
@ EXTI_EDGE_FALLING
Falling edge only (FTSR).
Definition exti.h:45
EXTI register block.
Definition exti_reg.h:23
GPIO port register block.
Definition gpio_reg.h:33
SYSCFG register block.
Definition syscfg_reg.h:23
SYSCFG registers: EXTI line routing and the I/O compensation cell (RM0390 section 8....