3#include <stm32wbxx_ll_gpio.h>
4#include <stm32wbxx_ll_system.h>
5#include <stm32wbxx_ll_exti.h>
14#define GPIO_NUMBER (16U)
19typedef void (*GpioExtiCallback)(
void* ctx);
25 GpioExtiCallback callback;
34 GpioModeOutputPushPull,
35 GpioModeOutputOpenDrain,
36 GpioModeAltFunctionPushPull,
37 GpioModeAltFunctionOpenDrain,
39 GpioModeInterruptRise,
40 GpioModeInterruptFall,
41 GpioModeInterruptRiseFall,
44 GpioModeEventRiseFall,
72 GpioAltFn0JTMS_SWDIO = 0,
73 GpioAltFn0JTCK_SWCLK = 0,
75 GpioAltFn0RTC_OUT = 0,
76 GpioAltFn0JTD_TRACE = 0,
78 GpioAltFn0RTC_REFIN = 0,
79 GpioAltFn0TRACED0 = 0,
80 GpioAltFn0TRACED1 = 0,
81 GpioAltFn0TRACED2 = 0,
82 GpioAltFn0TRACED3 = 0,
83 GpioAltFn0TRIG_INOUT = 0,
84 GpioAltFn0TRACECK = 0,
106 GpioAltFn6RF_DTB0 = 6,
107 GpioAltFn6RF_DTB1 = 6,
108 GpioAltFn6RF_DTB2 = 6,
109 GpioAltFn6RF_DTB3 = 6,
110 GpioAltFn6RF_DTB4 = 6,
111 GpioAltFn6RF_DTB5 = 6,
112 GpioAltFn6RF_DTB6 = 6,
113 GpioAltFn6RF_DTB7 = 6,
114 GpioAltFn6RF_DTB8 = 6,
115 GpioAltFn6RF_DTB9 = 6,
116 GpioAltFn6RF_DTB10 = 6,
117 GpioAltFn6RF_DTB11 = 6,
118 GpioAltFn6RF_DTB12 = 6,
119 GpioAltFn6RF_DTB13 = 6,
120 GpioAltFn6RF_DTB14 = 6,
121 GpioAltFn6RF_DTB15 = 6,
122 GpioAltFn6RF_DTB16 = 6,
123 GpioAltFn6RF_DTB17 = 6,
124 GpioAltFn6RF_DTB18 = 6,
125 GpioAltFn6RF_MISO = 6,
126 GpioAltFn6RF_MOSI = 6,
127 GpioAltFn6RF_SCK = 6,
128 GpioAltFn6RF_NSS = 6,
130 GpioAltFn7USART1 = 7,
132 GpioAltFn8LPUART1 = 8,
137 GpioAltFn10QUADSPI = 10,
142 GpioAltFn12COMP1 = 12,
143 GpioAltFn12COMP2 = 12,
144 GpioAltFn12TIM1 = 12,
146 GpioAltFn13SAI1 = 13,
148 GpioAltFn14TIM2 = 14,
149 GpioAltFn14TIM16 = 14,
150 GpioAltFn14TIM17 = 14,
151 GpioAltFn14LPTIM2 = 14,
153 GpioAltFn15EVENTOUT = 15,
155 GpioAltFnUnused = 16,
171void furi_hal_gpio_init_simple(
const GpioPin* gpio,
const GpioMode mode);
180void furi_hal_gpio_init(
184 const GpioSpeed speed);
194void furi_hal_gpio_init_ex(
198 const GpioSpeed speed,
199 const GpioAltFn alt_fn);
207void furi_hal_gpio_add_int_callback(
const GpioPin* gpio, GpioExtiCallback cb,
void* ctx);
213void furi_hal_gpio_enable_int_callback(
const GpioPin* gpio);
219void furi_hal_gpio_disable_int_callback(
const GpioPin* gpio);
225void furi_hal_gpio_remove_int_callback(
const GpioPin* gpio);
232static inline void furi_hal_gpio_write(
const GpioPin* gpio,
const bool state) {
235 gpio->port->BSRR = gpio->pin;
237 gpio->port->BSRR = (uint32_t)gpio->pin << GPIO_NUMBER;
248 furi_hal_gpio_write_port_pin(GPIO_TypeDef* port, uint16_t pin,
const bool state) {
253 port->BSRR = pin << GPIO_NUMBER;
262static inline bool furi_hal_gpio_read(
const GpioPin* gpio) {
263 if((gpio->port->IDR & gpio->pin) != 0x00U) {
276static inline bool furi_hal_gpio_read_port_pin(GPIO_TypeDef* port, uint16_t pin) {
277 if((port->IDR & pin) != 0x00U) {
Gpio interrupt type.
Definition furi_hal_gpio.h:24
Gpio structure.
Definition furi_hal_gpio.h:161