STM32 RTOS
0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Toggle main menu visibility
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
42
typedef
enum
ExtiEdge_e
43
{
44
EXTI_EDGE_RISING
= 1,
45
EXTI_EDGE_FALLING
= 2,
46
EXTI_EDGE_BOTH
= 3,
47
}
ExtiEdge_e
;
48
60
DRIVER_MUST_CHECK
DriverStatus_e
extiSelectPort
(
SyscfgRegisters_t
*syscfg, uint32_t line,
61
const
GpioRegisters_t
*port);
62
76
DRIVER_MUST_CHECK
DriverStatus_e
extiConfigure
(
ExtiRegisters_t
*exti, uint32_t line,
77
ExtiEdge_e
edge);
78
86
DRIVER_MUST_CHECK
DriverStatus_e
extiEnableInterrupt
(
ExtiRegisters_t
*exti, uint32_t line);
87
95
DRIVER_MUST_CHECK
DriverStatus_e
extiDisableInterrupt
(
ExtiRegisters_t
*exti, uint32_t line);
96
109
DRIVER_MUST_CHECK
DriverStatus_e
extiTriggerSoftware
(
ExtiRegisters_t
*exti, uint32_t line);
110
119
DRIVER_MUST_CHECK
DriverStatus_e
extiIsPending
(
const
ExtiRegisters_t
*exti, uint32_t line,
120
bool
*pending);
121
135
DRIVER_MUST_CHECK
DriverStatus_e
extiClearPending
(
ExtiRegisters_t
*exti, uint32_t line);
136
138
139
#endif
/* EXTI_H */
driver_status.h
The status every fallible driver function returns.
exti_reg.h
EXTI registers: external interrupt and event lines (RM0390 section 10.3).
gpio_reg.h
GPIO registers for ports A to H (RM0390 section 7.4).
DriverStatus_e
DriverStatus_e
Outcome of a driver call: a category for control flow, not a diagnosis.
Definition
driver_status.h:32
DRIVER_MUST_CHECK
#define DRIVER_MUST_CHECK
Make ignoring a function's result a compile error (with -Werror).
Definition
driver_status.h:22
extiIsPending
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
ExtiEdge_e
Which edges of a line's input set its pending bit.
Definition
exti.h:43
extiTriggerSoftware
DRIVER_MUST_CHECK DriverStatus_e extiTriggerSoftware(ExtiRegisters_t *exti, uint32_t line)
Raise line's interrupt from software (SWIER).
Definition
exti.c:178
extiSelectPort
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
extiDisableInterrupt
DRIVER_MUST_CHECK DriverStatus_e extiDisableInterrupt(ExtiRegisters_t *exti, uint32_t line)
Mask line's interrupt (IMR).
Definition
exti.c:166
extiClearPending
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
extiEnableInterrupt
DRIVER_MUST_CHECK DriverStatus_e extiEnableInterrupt(ExtiRegisters_t *exti, uint32_t line)
Unmask line's interrupt (IMR).
Definition
exti.c:154
extiConfigure
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
@ EXTI_EDGE_RISING
Rising edge only (RTSR).
Definition
exti.h:44
EXTI_EDGE_BOTH
@ EXTI_EDGE_BOTH
Both edges.
Definition
exti.h:46
EXTI_EDGE_FALLING
@ EXTI_EDGE_FALLING
Falling edge only (FTSR).
Definition
exti.h:45
ExtiRegisters_t
EXTI register block.
Definition
exti_reg.h:23
GpioRegisters_t
GPIO port register block.
Definition
gpio_reg.h:33
SyscfgRegisters_t
SYSCFG register block.
Definition
syscfg_reg.h:23
syscfg_reg.h
SYSCFG registers: EXTI line routing and the I/O compensation cell (RM0390 section 8....
drivers
inc
exti.h
Generated by
1.18.0