Go to the documentation of this file.
78 void (*gpio_callback)(gpio_regs_t *GPIOx, uint16_t gpio_pin);
147 #define GPIO_PIN_0 ((uint16_t)0x0001U)
148 #define GPIO_PIN_1 ((uint16_t)0x0002U)
149 #define GPIO_PIN_2 ((uint16_t)0x0004U)
150 #define GPIO_PIN_3 ((uint16_t)0x0008U)
151 #define GPIO_PIN_4 ((uint16_t)0x0010U)
152 #define GPIO_PIN_5 ((uint16_t)0x0020U)
153 #define GPIO_PIN_6 ((uint16_t)0x0040U)
154 #define GPIO_PIN_7 ((uint16_t)0x0080U)
155 #define GPIO_PIN_8 ((uint16_t)0x0100U)
156 #define GPIO_PIN_9 ((uint16_t)0x0200U)
157 #define GPIO_PIN_10 ((uint16_t)0x0400U)
158 #define GPIO_PIN_11 ((uint16_t)0x0800U)
159 #define GPIO_PIN_12 ((uint16_t)0x1000U)
160 #define GPIO_PIN_13 ((uint16_t)0x2000U)
161 #define GPIO_PIN_14 ((uint16_t)0x4000U)
162 #define GPIO_PIN_15 ((uint16_t)0x8000U)
163 #define GPIO_PIN_ALL ((uint16_t)0xFFFFU)
165 #define GPIO_PIN_MASK (0x0000FFFFU)
171 #define HAL_GPIO_MUX_0 ((uint32_t)0x0U)
172 #define HAL_GPIO_MUX_1 ((uint32_t)0x1U)
173 #define HAL_GPIO_MUX_2 ((uint32_t)0x2U)
174 #define HAL_GPIO_MUX_3 ((uint32_t)0x3U)
175 #define HAL_GPIO_MUX_4 ((uint32_t)0x4U)
176 #define HAL_GPIO_MUX_5 ((uint32_t)0x5U)
177 #define HAL_GPIO_MUX_6 ((uint32_t)0x6U)
179 #define IO_MUX_GPIO HAL_GPIO_MUX_0
190 #define GPIO_MODE_NONE (LL_GPIO_MODE_NONE)
191 #define GPIO_MODE_INPUT (LL_GPIO_MODE_INPUT)
192 #define GPIO_MODE_OUTPUT (LL_GPIO_MODE_OUTPUT)
193 #define GPIO_MODE_MUX (LL_GPIO_MODE_INOUT)
194 #ifdef LL_GPIO_MODE_ANALOG
195 #define GPIO_MODE_ANALOG (LL_GPIO_MODE_ANALOG)
197 #define GPIO_MODE_IT_RISING (LL_GPIO_TRIGGER_RISING << 4 | GPIO_MODE_INPUT )
198 #define GPIO_MODE_IT_FALLING (LL_GPIO_TRIGGER_FALLING << 4 | GPIO_MODE_INPUT)
199 #define GPIO_MODE_IT_HIGH (LL_GPIO_TRIGGER_HIGH << 4 | GPIO_MODE_INPUT)
200 #define GPIO_MODE_IT_LOW (LL_GPIO_TRIGGER_LOW << 4 | GPIO_MODE_INPUT)
201 #define GPIO_MODE_IT_BOTH_EDGE (LL_GPIO_TRIGGER_BOTH_EDGE << 4 | GPIO_MODE_INPUT)
209 #define GPIO_NOPULL LL_GPIO_PULL_NO
210 #define GPIO_PULLUP LL_GPIO_PULL_UP
211 #define GPIO_PULLDOWN LL_GPIO_PULL_DOWN
218 #define GPIO_SPEED_MEDIUM LL_GPIO_SPEED_MEDIUM
219 #define GPIO_SPEED_HIGH LL_GPIO_SPEED_HIGH
226 #define GPIO_STRENGTH_LOW LL_GPIO_STRENGTH_LOW
227 #define GPIO_STRENGTH_MEDIUM LL_GPIO_STRENGTH_MEDIUM
228 #define GPIO_STRENGTH_HIGH LL_GPIO_STRENGTH_HIGH
229 #define GPIO_STRENGTH_ULTRA LL_GPIO_STRENGTH_ULTRA
236 #define GPIO_INPUT_TYPE_CMOS LL_GPIO_INPUT_TYPE_CMOS
237 #define GPIO_INPUT_TYPE_SCHMITT LL_GPIO_INPUT_TYPE_SCHMITT
242 #define GPIO_DEFAULT_CONFIG \
244 .pin = GPIO_PIN_ALL, \
245 .mode = GPIO_MODE_INPUT, \
246 .pull = GPIO_PULLDOWN, \
247 .mux = IO_MUX_GPIO, \
248 .speed = GPIO_SPEED_MEDIUM, \
249 .strength = GPIO_STRENGTH_MEDIUM, \
250 .input_type = GPIO_INPUT_TYPE_CMOS, \
267 #define __HAL_GPIO_IT_GET_IT(__GPIOX__, __GPIO_PIN__) ll_gpio_read_flag_it(__GPIOX__, __GPIO_PIN__)
276 #define __HAL_GPIO_IT_CLEAR_IT(__GPIOX__, __GPIO_PIN__) ll_gpio_clear_flag_it(__GPIOX__, __GPIO_PIN__)
290 #define IS_GPIO_PIN_ACTION(__ACTION__) (((__ACTION__) == GPIO_PIN_RESET) || ((__ACTION__) == GPIO_PIN_SET))
297 #define IS_GPIO_PIN(__PIN__) ((((__PIN__) & GPIO_PIN_MASK) != 0x00U) &&\
298 (((__PIN__) & ~GPIO_PIN_MASK) == 0x00U))
306 #define IS_GPIO_MODE(__MODE__) (((__MODE__) == GPIO_MODE_INPUT) ||\
307 ((__MODE__) == GPIO_MODE_OUTPUT) ||\
308 ((__MODE__) == GPIO_MODE_MUX) ||\
309 ((__MODE__) == GPIO_MODE_IT_RISING) ||\
310 ((__MODE__) == GPIO_MODE_IT_FALLING) ||\
311 ((__MODE__) == GPIO_MODE_IT_HIGH) ||\
312 ((__MODE__) == GPIO_MODE_IT_LOW) ||\
313 ((__MODE__) == GPIO_MODE_IT_BOTH_EDGE))
320 #define IS_GPIO_PULL(__PULL__) (((__PULL__) == GPIO_NOPULL) ||\
321 ((__PULL__) == GPIO_PULLUP) || \
322 ((__PULL__) == GPIO_PULLDOWN))
gpio_pin_state_t
GPIO Bit SET and Bit RESET Enumerations.
void hal_gpio_exti_callback(gpio_regs_t *GPIOx, uint16_t gpio_pin)
GPIO pin detection callback.
gpio_pin_state_t hal_gpio_read_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin)
Read the specified input port pin.
GPIO init structure definition.
void hal_gpio_init(gpio_regs_t *GPIOx, const gpio_init_t *p_gpio_init)
Initialize the GPIOx peripheral according to the specified parameters in the p_gpio_init.
void hal_gpio_toggle_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin)
Toggle the specified GPIO pin.
void hal_gpio_exti_irq_handler(gpio_regs_t *GPIOx)
Handle GPIO interrupt request.
This file contains HAL common definitions, enumeration, macros and structures definitions.
HAL_GPIO Callback function definition.
void hal_gpio_deinit(gpio_regs_t *GPIOx, uint32_t gpio_pin)
De-initialize the GPIOx peripheral registers to their default reset values.
void hal_gpio_write_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin, gpio_pin_state_t pin_state)
Set or clear the selected data port bit.
Header file containing functions prototypes of GPIO LL library.