hal_gpio.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file hal_gpio.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of GPIO HAL library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup HAL_DRIVER HAL Driver
43 * @{
44 */
45
46 /** @defgroup HAL_GPIO GPIO
47 * @brief GPIO HAL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef HAL_GPIO_H
53 #define HAL_GPIO_H
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "ll_gpio.h"
61 #include "hal_def.h"
62
63 /* Exported types ------------------------------------------------------------*/
64 /** @addtogroup HAL_GPIO_CALLBACK_STRUCTURES Callback Structures
65 * @{
66 */
67
68 /** @defgroup HAL_GPIO_Callback Callback
69 * @{
70 */
71
72 /**
73 * @brief HAL_GPIO Callback function definition
74 */
75
76 typedef struct
77 {
78 void (*gpio_callback)(gpio_regs_t *GPIOx, uint16_t gpio_pin); /**< GPIO pin detection callback */
79 } hal_gpio_callback_t;
80
81 /** @} */
82
83 /** @} */
84
85 /** @addtogroup HAL_GPIO_ENUMERATIONS Enumerations
86 * @{
87 */
88
89 /**
90 * @brief GPIO Bit SET and Bit RESET Enumerations
91 */
92 typedef enum
93 {
94 GPIO_PIN_RESET = 0U, /**< GPIO pin low level.*/
95 GPIO_PIN_SET /**< GPIO pin high level.*/
96 } gpio_pin_state_t;
97
98 /** @} */
99
100
101 /** @addtogroup HAL_GPIO_STRUCTURES Structures
102 * @{
103 */
104
105 /**
106 * @brief GPIO init structure definition
107 */
108 typedef struct
109 {
110 uint32_t pin; /**< Specifies the GPIO pins to be configured.
111 This parameter can be any value of @ref GPIO_pins */
112
113 uint32_t mode; /**< Specifies the operating mode for the selected pins.
114 This parameter can be a value of @ref GPIO_mode */
115
116 uint32_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins.
117 This parameter can be a value of @ref GPIO_pull */
118
119 uint32_t mux; /**< Specifies the Peripheral to be connected to the selected pins.
120 This parameter can be a value of @ref GPIO_MUX. */
121
122 uint32_t speed; /**< Specifies the Speed for the selected pins.
123 This parameter can be a value of @ref GPIO_speed */
124
125 uint32_t strength; /**< Specifies the Speed for the selected pins.
126 This parameter can be a value of @ref GPIO_strength */
127
128 uint32_t input_type; /**< Specifies the input type for the selected pins.
129 This parameter can be a value of @ref GPIO_input_type */
130 } gpio_init_t;
131
132 /** @} */
133
134 /**
135 * @defgroup HAL_GPIO_MACRO Defines
136 * @{
137 */
138
139 /* Exported constants --------------------------------------------------------*/
140 /** @defgroup GPIO_Exported_Constants GPIO Exported Constants
141 * @{
142 */
143
144 /** @defgroup GPIO_pins GPIO pins
145 * @{
146 */
147 #define GPIO_PIN_0 ((uint16_t)0x0001U) /**< Pin 0 selected */
148 #define GPIO_PIN_1 ((uint16_t)0x0002U) /**< Pin 1 selected */
149 #define GPIO_PIN_2 ((uint16_t)0x0004U) /**< Pin 2 selected */
150 #define GPIO_PIN_3 ((uint16_t)0x0008U) /**< Pin 3 selected */
151 #define GPIO_PIN_4 ((uint16_t)0x0010U) /**< Pin 4 selected */
152 #define GPIO_PIN_5 ((uint16_t)0x0020U) /**< Pin 5 selected */
153 #define GPIO_PIN_6 ((uint16_t)0x0040U) /**< Pin 6 selected */
154 #define GPIO_PIN_7 ((uint16_t)0x0080U) /**< Pin 7 selected */
155 #define GPIO_PIN_8 ((uint16_t)0x0100U) /**< Pin 8 selected */
156 #define GPIO_PIN_9 ((uint16_t)0x0200U) /**< Pin 9 selected */
157 #define GPIO_PIN_10 ((uint16_t)0x0400U) /**< Pin 10 selected */
158 #define GPIO_PIN_11 ((uint16_t)0x0800U) /**< Pin 11 selected */
159 #define GPIO_PIN_12 ((uint16_t)0x1000U) /**< Pin 12 selected */
160 #define GPIO_PIN_13 ((uint16_t)0x2000U) /**< Pin 13 selected */
161 #define GPIO_PIN_14 ((uint16_t)0x4000U) /**< Pin 14 selected */
162 #define GPIO_PIN_15 ((uint16_t)0x8000U) /**< Pin 15 selected */
163 #define GPIO_PIN_ALL ((uint16_t)0xFFFFU) /**< All pins selected */
164
165 #define GPIO_PIN_MASK (0x0000FFFFU) /**< PIN mask for assert test */
166 /** @} */
167
168 /** @defgroup GPIO_MUX Alternate Function
169 * @{
170 */
171 #define HAL_GPIO_MUX_0 ((uint32_t)0x0U) /*!< Select alternate function 0 */
172 #define HAL_GPIO_MUX_1 ((uint32_t)0x1U) /*!< Select alternate function 1 */
173 #define HAL_GPIO_MUX_2 ((uint32_t)0x2U) /*!< Select alternate function 2 */
174 #define HAL_GPIO_MUX_3 ((uint32_t)0x3U) /*!< Select alternate function 3 */
175 #define HAL_GPIO_MUX_4 ((uint32_t)0x4U) /*!< Select alternate function 4 */
176 #define HAL_GPIO_MUX_5 ((uint32_t)0x5U) /*!< Select alternate function 5 */
177 #define HAL_GPIO_MUX_6 ((uint32_t)0x6U) /*!< Select alternate function 6 */
178 #ifndef IO_MUX_GPIO
179 #define IO_MUX_GPIO HAL_GPIO_MUX_0
180 #endif
181 /** @} */
182
183 /** @defgroup GPIO_mode GPIO mode
184 * @brief GPIO Configuration Mode
185 * Elements values convention: 0x000000YX
186 * - X : IO Direction mode (Input, Output, Mux)
187 * - Y : IT trigger detection
188 * @{
189 */
190 #define GPIO_MODE_NONE (LL_GPIO_MODE_NONE) /**< Disable input and output mode */
191 #define GPIO_MODE_INPUT (LL_GPIO_MODE_INPUT) /**< Input Mode */
192 #define GPIO_MODE_OUTPUT (LL_GPIO_MODE_OUTPUT) /**< Output Mode */
193 #define GPIO_MODE_MUX (LL_GPIO_MODE_INOUT) /**< Mux Mode */
194 #ifdef LL_GPIO_MODE_ANALOG
195 #define GPIO_MODE_ANALOG (LL_GPIO_MODE_ANALOG) /**< Analog Mode */
196 #endif
197 #define GPIO_MODE_IT_RISING (LL_GPIO_TRIGGER_RISING << 4 | GPIO_MODE_INPUT ) /**< Interrupt Mode with Rising edge trigger detection */
198 #define GPIO_MODE_IT_FALLING (LL_GPIO_TRIGGER_FALLING << 4 | GPIO_MODE_INPUT) /**< Interrupt Mode with Falling edge trigger detection */
199 #define GPIO_MODE_IT_HIGH (LL_GPIO_TRIGGER_HIGH << 4 | GPIO_MODE_INPUT) /**< Interrupt Mode with High-level trigger detection */
200 #define GPIO_MODE_IT_LOW (LL_GPIO_TRIGGER_LOW << 4 | GPIO_MODE_INPUT) /**< Interrupt Mode with Low-level trigger detection */
201 #define GPIO_MODE_IT_BOTH_EDGE (LL_GPIO_TRIGGER_BOTH_EDGE << 4 | GPIO_MODE_INPUT) /**< Interrupt Mode with Rising and Falling edge trigger detection */
202
203 /** @} */
204
205 /** @defgroup GPIO_pull GPIO pull
206 * @brief GPIO Pull-Up or Pull-Down Activation
207 * @{
208 */
209 #define GPIO_NOPULL LL_GPIO_PULL_NO /**< No Pull-up or Pull-down activation */
210 #define GPIO_PULLUP LL_GPIO_PULL_UP /**< Pull-up activation */
211 #define GPIO_PULLDOWN LL_GPIO_PULL_DOWN /**< Pull-down activation */
212 /** @} */
213
214 /** @defgroup GPIO_speed GPIO speed
215 * @brief GPIO speed selection
216 * @{
217 */
218 #define GPIO_SPEED_MEDIUM LL_GPIO_SPEED_MEDIUM /*!< Select medium speed */
219 #define GPIO_SPEED_HIGH LL_GPIO_SPEED_HIGH /*!< Select high speed */
220 /** @} */
221
222 /** @defgroup GPIO_strength GPIO Strength
223 * @brief GPIO drive strength selection
224 * @{
225 */
226 #define GPIO_STRENGTH_LOW LL_GPIO_STRENGTH_LOW /*!< Select low output driver strength */
227 #define GPIO_STRENGTH_MEDIUM LL_GPIO_STRENGTH_MEDIUM /*!< Select medium output driver strength */
228 #define GPIO_STRENGTH_HIGH LL_GPIO_STRENGTH_HIGH /*!< Select high output driver strength */
229 #define GPIO_STRENGTH_ULTRA LL_GPIO_STRENGTH_ULTRA /*!< Select high output driver strength */
230 /** @} */
231
232 /** @defgroup GPIO_input_type GPIO input type
233 * @brief GPIO input type selection
234 * @{
235 */
236 #define GPIO_INPUT_TYPE_CMOS LL_GPIO_INPUT_TYPE_CMOS /**< CMOS input */
237 #define GPIO_INPUT_TYPE_SCHMITT LL_GPIO_INPUT_TYPE_SCHMITT /**< Schmitt input */
238 /** @} */
239 /**
240 * @brief GPIO_default_config InitStruct default configuration
241 */
242 #define GPIO_DEFAULT_CONFIG \
243 { \
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, \
251 }
252
253 /** @} */
254
255 /* Exported macro ------------------------------------------------------------*/
256 /** @defgroup GPIO_Exported_Macros GPIO Exported Macros
257 * @{
258 */
259
260 /**
261 * @brief Check whether the specified GPIO pin is asserted or not.
262 * @param __GPIOX__ Where X can be (0, 1) to select the GPIO peripheral port
263 * @param __GPIO_PIN__ Specifies the GPIO pin to check.
264 * This parameter can be GPIO_PIN_x where x can be (0..15)
265 * @retval The new state of __GPIO_PIN__ (SET or RESET).
266 */
267 #define __HAL_GPIO_IT_GET_IT(__GPIOX__, __GPIO_PIN__) ll_gpio_read_flag_it(__GPIOX__, __GPIO_PIN__)
268
269 /**
270 * @brief Clear the GPIO pin pending bits.
271 * @param __GPIOX__ Where X can be (0, 1) to select the GPIO peripheral port
272 * @param __GPIO_PIN__ Specifies the GPIO pins to clear.
273 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
274 * @retval None
275 */
276 #define __HAL_GPIO_IT_CLEAR_IT(__GPIOX__, __GPIO_PIN__) ll_gpio_clear_flag_it(__GPIOX__, __GPIO_PIN__)
277
278 /** @} */
279
280 /* Private macros ------------------------------------------------------------*/
281 /** @addtogroup GPIO_Private_Macros GPIO Private Macros
282 * @{
283 */
284
285 /**
286 * @brief Check if GPIO pin action is valid.
287 * @param __ACTION__ GPIO pin action.
288 * @retval SET (__ACTION__ is valid) or RESET (__ACTION__ is invalid)
289 */
290 #define IS_GPIO_PIN_ACTION(__ACTION__) (((__ACTION__) == GPIO_PIN_RESET) || ((__ACTION__) == GPIO_PIN_SET))
291
292 /**
293 * @brief Check if GPIO pins are valid.
294 * @param __PIN__ GPIO pins.
295 * @retval SET (__PIN__ is valid) or RESET (__PIN__ is invalid)
296 */
297 #define IS_GPIO_PIN(__PIN__) ((((__PIN__) & GPIO_PIN_MASK) != 0x00U) &&\
298 (((__PIN__) & ~GPIO_PIN_MASK) == 0x00U))
299
300 /**
301 * @brief Check if GPIO mode is valid.
302 * @param __MODE__ GPIO mode.
303 * @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
304 */
305
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))
314
315 /**
316 * @brief Check if GPIO pull type is valid.
317 * @param __PULL__ GPIO pull type.
318 * @retval SET (__PULL__ is valid) or RESET (__PULL__ is invalid)
319 */
320 #define IS_GPIO_PULL(__PULL__) (((__PULL__) == GPIO_NOPULL) ||\
321 ((__PULL__) == GPIO_PULLUP) || \
322 ((__PULL__) == GPIO_PULLDOWN))
323
324 /** @} */
325
326 /** @} */
327
328 /* Exported functions --------------------------------------------------------*/
329 /** @addtogroup HAL_GPIO_DRIVER_FUNCTIONS Functions
330 * @{
331 */
332
333 /** @addtogroup GPIO_Exported_Functions_Group1 Initialization/de-initialization functions
334 * @brief Initialization and de-initialization functions
335 * @{
336 */
337
338 /**
339 ****************************************************************************************
340 * @brief Initialize the GPIOx peripheral according to the specified parameters in the p_gpio_init.
341 *
342 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
343 * @param[in] p_gpio_init: Pointer to a gpio_init_t structure that contains the configuration information
344 * for the specified GPIO peripheral port.
345 ****************************************************************************************
346 */
347 void hal_gpio_init(gpio_regs_t *GPIOx, const gpio_init_t *p_gpio_init);
348
349 /**
350 ****************************************************************************************
351 * @brief De-initialize the GPIOx peripheral registers to their default reset values.
352 *
353 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
354 * @param[in] gpio_pin: Specifies the port bit to be written.
355 * This parameter can be a combination of the following values:
356 * @arg @ref GPIO_PIN_0
357 * @arg @ref GPIO_PIN_1
358 * @arg @ref GPIO_PIN_2
359 * @arg @ref GPIO_PIN_3
360 * @arg @ref GPIO_PIN_4
361 * @arg @ref GPIO_PIN_5
362 * @arg @ref GPIO_PIN_6
363 * @arg @ref GPIO_PIN_7
364 * @arg @ref GPIO_PIN_8
365 * @arg @ref GPIO_PIN_9
366 * @arg @ref GPIO_PIN_10
367 * @arg @ref GPIO_PIN_11
368 * @arg @ref GPIO_PIN_12
369 * @arg @ref GPIO_PIN_13
370 * @arg @ref GPIO_PIN_ALL
371 ****************************************************************************************
372 */
373 void hal_gpio_deinit(gpio_regs_t *GPIOx, uint32_t gpio_pin);
374
375 /** @} */
376
377 /** @addtogroup GPIO_Exported_Functions_Group2 IO operation functions
378 * @{
379 */
380
381 /**
382 ****************************************************************************************
383 * @brief Read the specified input port pin.
384 *
385 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
386 * @param[in] gpio_pin: Specifies the port bit to be read.
387 * This parameter can be a one of the following values:
388 * @arg @ref GPIO_PIN_0
389 * @arg @ref GPIO_PIN_1
390 * @arg @ref GPIO_PIN_2
391 * @arg @ref GPIO_PIN_3
392 * @arg @ref GPIO_PIN_4
393 * @arg @ref GPIO_PIN_5
394 * @arg @ref GPIO_PIN_6
395 * @arg @ref GPIO_PIN_7
396 * @arg @ref GPIO_PIN_8
397 * @arg @ref GPIO_PIN_9
398 * @arg @ref GPIO_PIN_10
399 * @arg @ref GPIO_PIN_11
400 * @arg @ref GPIO_PIN_12
401 * @arg @ref GPIO_PIN_13
402 *
403 * @retval ::GPIO_PIN_RESET: GPIO pin low level.
404 * @retval ::GPIO_PIN_SET: GPIO pin high level.
405 ****************************************************************************************
406 */
407 gpio_pin_state_t hal_gpio_read_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin);
408
409 /**
410 ****************************************************************************************
411 * @brief Set or clear the selected data port bit.
412 *
413 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
414 * @param[in] gpio_pin: Specifies the port bit to be written.
415 * This parameter can be a combination of the following values:
416 * @arg @ref GPIO_PIN_0
417 * @arg @ref GPIO_PIN_1
418 * @arg @ref GPIO_PIN_2
419 * @arg @ref GPIO_PIN_3
420 * @arg @ref GPIO_PIN_4
421 * @arg @ref GPIO_PIN_5
422 * @arg @ref GPIO_PIN_6
423 * @arg @ref GPIO_PIN_7
424 * @arg @ref GPIO_PIN_8
425 * @arg @ref GPIO_PIN_9
426 * @arg @ref GPIO_PIN_10
427 * @arg @ref GPIO_PIN_11
428 * @arg @ref GPIO_PIN_12
429 * @arg @ref GPIO_PIN_13
430 * @arg @ref GPIO_PIN_ALL
431 * @param[in] pin_state: Specifies the value to be written to the selected bit.
432 * This parameter can be one of the GPIO_PinState enum values:
433 * @arg @ref GPIO_PIN_RESET clear the port pin
434 * @arg @ref GPIO_PIN_SET set the port pin
435 ****************************************************************************************
436 */
437 void hal_gpio_write_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin, gpio_pin_state_t pin_state);
438
439 /**
440 ****************************************************************************************
441 * @brief Toggle the specified GPIO pin.
442 *
443 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
444 * @param[in] gpio_pin: Specifies the pin to be toggled.
445 * This parameter can be a combination of the following values:
446 * @arg @ref GPIO_PIN_0
447 * @arg @ref GPIO_PIN_1
448 * @arg @ref GPIO_PIN_2
449 * @arg @ref GPIO_PIN_3
450 * @arg @ref GPIO_PIN_4
451 * @arg @ref GPIO_PIN_5
452 * @arg @ref GPIO_PIN_6
453 * @arg @ref GPIO_PIN_7
454 * @arg @ref GPIO_PIN_8
455 * @arg @ref GPIO_PIN_9
456 * @arg @ref GPIO_PIN_10
457 * @arg @ref GPIO_PIN_11
458 * @arg @ref GPIO_PIN_12
459 * @arg @ref GPIO_PIN_13
460 * @arg @ref GPIO_PIN_ALL
461 ****************************************************************************************
462 */
463 void hal_gpio_toggle_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin);
464
465 /** @} */
466
467 /** @addtogroup GPIO_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
468 * @brief IRQ Handler and Callbacks functions
469 * @{
470 */
471
472 /**
473 ****************************************************************************************
474 * @brief Handle GPIO interrupt request.
475 *
476 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
477 ****************************************************************************************
478 */
479 void hal_gpio_exti_irq_handler(gpio_regs_t *GPIOx);
480
481 /**
482 ****************************************************************************************
483 * @brief GPIO pin detection callback.
484 *
485 * @note This function should not be modified. When the callback is needed,
486 * the hal_gpio_exti_callback can be implemented in the user file.
487 *
488 * @param[in] GPIOx: Where x can be (0, 1) to select the GPIO peripheral port
489 * @param[in] gpio_pin: Indicate the port pin whose interrupt was triggered.
490 * This parameter can be a combination of the following values:
491 * @arg @ref GPIO_PIN_0
492 * @arg @ref GPIO_PIN_1
493 * @arg @ref GPIO_PIN_2
494 * @arg @ref GPIO_PIN_3
495 * @arg @ref GPIO_PIN_4
496 * @arg @ref GPIO_PIN_5
497 * @arg @ref GPIO_PIN_6
498 * @arg @ref GPIO_PIN_7
499 * @arg @ref GPIO_PIN_8
500 * @arg @ref GPIO_PIN_9
501 * @arg @ref GPIO_PIN_10
502 * @arg @ref GPIO_PIN_11
503 * @arg @ref GPIO_PIN_12
504 * @arg @ref GPIO_PIN_13
505 * @arg @ref GPIO_PIN_ALL
506 ****************************************************************************************
507 */
508 void hal_gpio_exti_callback(gpio_regs_t *GPIOx, uint16_t gpio_pin);
509
510 /** @} */
511
512 /** @} */
513
514 #ifdef __cplusplus
515 }
516 #endif
517
518 #endif /* HAL_GPIO_H */
519
520 /** @} */
521
522 /** @} */
523
524 /** @} */
gpio_pin_state_t
gpio_pin_state_t
GPIO Bit SET and Bit RESET Enumerations.
Definition: hal_gpio.h:93
gpio_init_t::mux
uint32_t mux
Definition: hal_gpio.h:119
hal_gpio_exti_callback
void hal_gpio_exti_callback(gpio_regs_t *GPIOx, uint16_t gpio_pin)
GPIO pin detection callback.
gpio_init_t::mode
uint32_t mode
Definition: hal_gpio.h:113
gpio_init_t::pull
uint32_t pull
Definition: hal_gpio.h:116
GPIO_PIN_SET
@ GPIO_PIN_SET
Definition: hal_gpio.h:95
gpio_init_t::pin
uint32_t pin
Definition: hal_gpio.h:110
GPIO_PIN_RESET
@ GPIO_PIN_RESET
Definition: hal_gpio.h:94
hal_gpio_read_pin
gpio_pin_state_t hal_gpio_read_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin)
Read the specified input port pin.
gpio_init_t
GPIO init structure definition.
Definition: hal_gpio.h:109
hal_gpio_init
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.
hal_gpio_toggle_pin
void hal_gpio_toggle_pin(gpio_regs_t *GPIOx, uint16_t gpio_pin)
Toggle the specified GPIO pin.
gpio_init_t::strength
uint32_t strength
Definition: hal_gpio.h:125
hal_gpio_exti_irq_handler
void hal_gpio_exti_irq_handler(gpio_regs_t *GPIOx)
Handle GPIO interrupt request.
hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
hal_gpio_callback_t
HAL_GPIO Callback function definition.
Definition: hal_gpio.h:77
gpio_init_t::speed
uint32_t speed
Definition: hal_gpio.h:122
hal_gpio_deinit
void hal_gpio_deinit(gpio_regs_t *GPIOx, uint32_t gpio_pin)
De-initialize the GPIOx peripheral registers to their default reset values.
hal_gpio_write_pin
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.
ll_gpio.h
Header file containing functions prototypes of GPIO LL library.
gpio_init_t::input_type
uint32_t input_type
Definition: hal_gpio.h:128