inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NYX 0:85b3fd62ea1a 1 /**
NYX 0:85b3fd62ea1a 2 ******************************************************************************
NYX 0:85b3fd62ea1a 3 * @file stm32f4xx_hal_gpio.h
NYX 0:85b3fd62ea1a 4 * @author MCD Application Team
NYX 0:85b3fd62ea1a 5 * @version V1.7.1
NYX 0:85b3fd62ea1a 6 * @date 14-April-2017
NYX 0:85b3fd62ea1a 7 * @brief Header file of GPIO HAL module.
NYX 0:85b3fd62ea1a 8 ******************************************************************************
NYX 0:85b3fd62ea1a 9 * @attention
NYX 0:85b3fd62ea1a 10 *
NYX 0:85b3fd62ea1a 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
NYX 0:85b3fd62ea1a 12 *
NYX 0:85b3fd62ea1a 13 * Redistribution and use in source and binary forms, with or without modification,
NYX 0:85b3fd62ea1a 14 * are permitted provided that the following conditions are met:
NYX 0:85b3fd62ea1a 15 * 1. Redistributions of source code must retain the above copyright notice,
NYX 0:85b3fd62ea1a 16 * this list of conditions and the following disclaimer.
NYX 0:85b3fd62ea1a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
NYX 0:85b3fd62ea1a 18 * this list of conditions and the following disclaimer in the documentation
NYX 0:85b3fd62ea1a 19 * and/or other materials provided with the distribution.
NYX 0:85b3fd62ea1a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
NYX 0:85b3fd62ea1a 21 * may be used to endorse or promote products derived from this software
NYX 0:85b3fd62ea1a 22 * without specific prior written permission.
NYX 0:85b3fd62ea1a 23 *
NYX 0:85b3fd62ea1a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
NYX 0:85b3fd62ea1a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
NYX 0:85b3fd62ea1a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
NYX 0:85b3fd62ea1a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
NYX 0:85b3fd62ea1a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NYX 0:85b3fd62ea1a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
NYX 0:85b3fd62ea1a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
NYX 0:85b3fd62ea1a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
NYX 0:85b3fd62ea1a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
NYX 0:85b3fd62ea1a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NYX 0:85b3fd62ea1a 34 *
NYX 0:85b3fd62ea1a 35 ******************************************************************************
NYX 0:85b3fd62ea1a 36 */
NYX 0:85b3fd62ea1a 37
NYX 0:85b3fd62ea1a 38 /* Define to prevent recursive inclusion -------------------------------------*/
NYX 0:85b3fd62ea1a 39 #ifndef __STM32F4xx_HAL_GPIO_H
NYX 0:85b3fd62ea1a 40 #define __STM32F4xx_HAL_GPIO_H
NYX 0:85b3fd62ea1a 41
NYX 0:85b3fd62ea1a 42 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 43 extern "C" {
NYX 0:85b3fd62ea1a 44 #endif
NYX 0:85b3fd62ea1a 45
NYX 0:85b3fd62ea1a 46 /* Includes ------------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 47 #include "stm32f4xx_hal_def.h"
NYX 0:85b3fd62ea1a 48
NYX 0:85b3fd62ea1a 49 /** @addtogroup STM32F4xx_HAL_Driver
NYX 0:85b3fd62ea1a 50 * @{
NYX 0:85b3fd62ea1a 51 */
NYX 0:85b3fd62ea1a 52
NYX 0:85b3fd62ea1a 53 /** @addtogroup GPIO
NYX 0:85b3fd62ea1a 54 * @{
NYX 0:85b3fd62ea1a 55 */
NYX 0:85b3fd62ea1a 56
NYX 0:85b3fd62ea1a 57 /* Exported types ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 58 /** @defgroup GPIO_Exported_Types GPIO Exported Types
NYX 0:85b3fd62ea1a 59 * @{
NYX 0:85b3fd62ea1a 60 */
NYX 0:85b3fd62ea1a 61
NYX 0:85b3fd62ea1a 62 /**
NYX 0:85b3fd62ea1a 63 * @brief GPIO Init structure definition
NYX 0:85b3fd62ea1a 64 */
NYX 0:85b3fd62ea1a 65 typedef struct
NYX 0:85b3fd62ea1a 66 {
NYX 0:85b3fd62ea1a 67 uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
NYX 0:85b3fd62ea1a 68 This parameter can be any value of @ref GPIO_pins_define */
NYX 0:85b3fd62ea1a 69
NYX 0:85b3fd62ea1a 70 uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
NYX 0:85b3fd62ea1a 71 This parameter can be a value of @ref GPIO_mode_define */
NYX 0:85b3fd62ea1a 72
NYX 0:85b3fd62ea1a 73 uint32_t Pull; /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
NYX 0:85b3fd62ea1a 74 This parameter can be a value of @ref GPIO_pull_define */
NYX 0:85b3fd62ea1a 75
NYX 0:85b3fd62ea1a 76 uint32_t Speed; /*!< Specifies the speed for the selected pins.
NYX 0:85b3fd62ea1a 77 This parameter can be a value of @ref GPIO_speed_define */
NYX 0:85b3fd62ea1a 78
NYX 0:85b3fd62ea1a 79 uint32_t Alternate; /*!< Peripheral to be connected to the selected pins.
NYX 0:85b3fd62ea1a 80 This parameter can be a value of @ref GPIO_Alternate_function_selection */
NYX 0:85b3fd62ea1a 81 }GPIO_InitTypeDef;
NYX 0:85b3fd62ea1a 82
NYX 0:85b3fd62ea1a 83 /**
NYX 0:85b3fd62ea1a 84 * @brief GPIO Bit SET and Bit RESET enumeration
NYX 0:85b3fd62ea1a 85 */
NYX 0:85b3fd62ea1a 86 typedef enum
NYX 0:85b3fd62ea1a 87 {
NYX 0:85b3fd62ea1a 88 GPIO_PIN_RESET = 0,
NYX 0:85b3fd62ea1a 89 GPIO_PIN_SET
NYX 0:85b3fd62ea1a 90 }GPIO_PinState;
NYX 0:85b3fd62ea1a 91 /**
NYX 0:85b3fd62ea1a 92 * @}
NYX 0:85b3fd62ea1a 93 */
NYX 0:85b3fd62ea1a 94
NYX 0:85b3fd62ea1a 95 /* Exported constants --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 96
NYX 0:85b3fd62ea1a 97 /** @defgroup GPIO_Exported_Constants GPIO Exported Constants
NYX 0:85b3fd62ea1a 98 * @{
NYX 0:85b3fd62ea1a 99 */
NYX 0:85b3fd62ea1a 100
NYX 0:85b3fd62ea1a 101 /** @defgroup GPIO_pins_define GPIO pins define
NYX 0:85b3fd62ea1a 102 * @{
NYX 0:85b3fd62ea1a 103 */
NYX 0:85b3fd62ea1a 104 #define GPIO_PIN_0 ((uint16_t)0x0001) /* Pin 0 selected */
NYX 0:85b3fd62ea1a 105 #define GPIO_PIN_1 ((uint16_t)0x0002) /* Pin 1 selected */
NYX 0:85b3fd62ea1a 106 #define GPIO_PIN_2 ((uint16_t)0x0004) /* Pin 2 selected */
NYX 0:85b3fd62ea1a 107 #define GPIO_PIN_3 ((uint16_t)0x0008) /* Pin 3 selected */
NYX 0:85b3fd62ea1a 108 #define GPIO_PIN_4 ((uint16_t)0x0010) /* Pin 4 selected */
NYX 0:85b3fd62ea1a 109 #define GPIO_PIN_5 ((uint16_t)0x0020) /* Pin 5 selected */
NYX 0:85b3fd62ea1a 110 #define GPIO_PIN_6 ((uint16_t)0x0040) /* Pin 6 selected */
NYX 0:85b3fd62ea1a 111 #define GPIO_PIN_7 ((uint16_t)0x0080) /* Pin 7 selected */
NYX 0:85b3fd62ea1a 112 #define GPIO_PIN_8 ((uint16_t)0x0100) /* Pin 8 selected */
NYX 0:85b3fd62ea1a 113 #define GPIO_PIN_9 ((uint16_t)0x0200) /* Pin 9 selected */
NYX 0:85b3fd62ea1a 114 #define GPIO_PIN_10 ((uint16_t)0x0400) /* Pin 10 selected */
NYX 0:85b3fd62ea1a 115 #define GPIO_PIN_11 ((uint16_t)0x0800) /* Pin 11 selected */
NYX 0:85b3fd62ea1a 116 #define GPIO_PIN_12 ((uint16_t)0x1000) /* Pin 12 selected */
NYX 0:85b3fd62ea1a 117 #define GPIO_PIN_13 ((uint16_t)0x2000) /* Pin 13 selected */
NYX 0:85b3fd62ea1a 118 #define GPIO_PIN_14 ((uint16_t)0x4000) /* Pin 14 selected */
NYX 0:85b3fd62ea1a 119 #define GPIO_PIN_15 ((uint16_t)0x8000) /* Pin 15 selected */
NYX 0:85b3fd62ea1a 120 #define GPIO_PIN_All ((uint16_t)0xFFFF) /* All pins selected */
NYX 0:85b3fd62ea1a 121
NYX 0:85b3fd62ea1a 122 #define GPIO_PIN_MASK 0x0000FFFFU /* PIN mask for assert test */
NYX 0:85b3fd62ea1a 123 /**
NYX 0:85b3fd62ea1a 124 * @}
NYX 0:85b3fd62ea1a 125 */
NYX 0:85b3fd62ea1a 126
NYX 0:85b3fd62ea1a 127 /** @defgroup GPIO_mode_define GPIO mode define
NYX 0:85b3fd62ea1a 128 * @brief GPIO Configuration Mode
NYX 0:85b3fd62ea1a 129 * Elements values convention: 0xX0yz00YZ
NYX 0:85b3fd62ea1a 130 * - X : GPIO mode or EXTI Mode
NYX 0:85b3fd62ea1a 131 * - y : External IT or Event trigger detection
NYX 0:85b3fd62ea1a 132 * - z : IO configuration on External IT or Event
NYX 0:85b3fd62ea1a 133 * - Y : Output type (Push Pull or Open Drain)
NYX 0:85b3fd62ea1a 134 * - Z : IO Direction mode (Input, Output, Alternate or Analog)
NYX 0:85b3fd62ea1a 135 * @{
NYX 0:85b3fd62ea1a 136 */
NYX 0:85b3fd62ea1a 137 #define GPIO_MODE_INPUT 0x00000000U /*!< Input Floating Mode */
NYX 0:85b3fd62ea1a 138 #define GPIO_MODE_OUTPUT_PP 0x00000001U /*!< Output Push Pull Mode */
NYX 0:85b3fd62ea1a 139 #define GPIO_MODE_OUTPUT_OD 0x00000011U /*!< Output Open Drain Mode */
NYX 0:85b3fd62ea1a 140 #define GPIO_MODE_AF_PP 0x00000002U /*!< Alternate Function Push Pull Mode */
NYX 0:85b3fd62ea1a 141 #define GPIO_MODE_AF_OD 0x00000012U /*!< Alternate Function Open Drain Mode */
NYX 0:85b3fd62ea1a 142
NYX 0:85b3fd62ea1a 143 #define GPIO_MODE_ANALOG 0x00000003U /*!< Analog Mode */
NYX 0:85b3fd62ea1a 144
NYX 0:85b3fd62ea1a 145 #define GPIO_MODE_IT_RISING 0x10110000U /*!< External Interrupt Mode with Rising edge trigger detection */
NYX 0:85b3fd62ea1a 146 #define GPIO_MODE_IT_FALLING 0x10210000U /*!< External Interrupt Mode with Falling edge trigger detection */
NYX 0:85b3fd62ea1a 147 #define GPIO_MODE_IT_RISING_FALLING 0x10310000U /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
NYX 0:85b3fd62ea1a 148
NYX 0:85b3fd62ea1a 149 #define GPIO_MODE_EVT_RISING 0x10120000U /*!< External Event Mode with Rising edge trigger detection */
NYX 0:85b3fd62ea1a 150 #define GPIO_MODE_EVT_FALLING 0x10220000U /*!< External Event Mode with Falling edge trigger detection */
NYX 0:85b3fd62ea1a 151 #define GPIO_MODE_EVT_RISING_FALLING 0x10320000U /*!< External Event Mode with Rising/Falling edge trigger detection */
NYX 0:85b3fd62ea1a 152 /**
NYX 0:85b3fd62ea1a 153 * @}
NYX 0:85b3fd62ea1a 154 */
NYX 0:85b3fd62ea1a 155
NYX 0:85b3fd62ea1a 156 /** @defgroup GPIO_speed_define GPIO speed define
NYX 0:85b3fd62ea1a 157 * @brief GPIO Output Maximum frequency
NYX 0:85b3fd62ea1a 158 * @{
NYX 0:85b3fd62ea1a 159 */
NYX 0:85b3fd62ea1a 160 #define GPIO_SPEED_FREQ_LOW 0x00000000U /*!< IO works at 2 MHz, please refer to the product datasheet */
NYX 0:85b3fd62ea1a 161 #define GPIO_SPEED_FREQ_MEDIUM 0x00000001U /*!< range 12,5 MHz to 50 MHz, please refer to the product datasheet */
NYX 0:85b3fd62ea1a 162 #define GPIO_SPEED_FREQ_HIGH 0x00000002U /*!< range 25 MHz to 100 MHz, please refer to the product datasheet */
NYX 0:85b3fd62ea1a 163 #define GPIO_SPEED_FREQ_VERY_HIGH 0x00000003U /*!< range 50 MHz to 200 MHz, please refer to the product datasheet */
NYX 0:85b3fd62ea1a 164 /**
NYX 0:85b3fd62ea1a 165 * @}
NYX 0:85b3fd62ea1a 166 */
NYX 0:85b3fd62ea1a 167
NYX 0:85b3fd62ea1a 168 /** @defgroup GPIO_pull_define GPIO pull define
NYX 0:85b3fd62ea1a 169 * @brief GPIO Pull-Up or Pull-Down Activation
NYX 0:85b3fd62ea1a 170 * @{
NYX 0:85b3fd62ea1a 171 */
NYX 0:85b3fd62ea1a 172 #define GPIO_NOPULL 0x00000000U /*!< No Pull-up or Pull-down activation */
NYX 0:85b3fd62ea1a 173 #define GPIO_PULLUP 0x00000001U /*!< Pull-up activation */
NYX 0:85b3fd62ea1a 174 #define GPIO_PULLDOWN 0x00000002U /*!< Pull-down activation */
NYX 0:85b3fd62ea1a 175 /**
NYX 0:85b3fd62ea1a 176 * @}
NYX 0:85b3fd62ea1a 177 */
NYX 0:85b3fd62ea1a 178
NYX 0:85b3fd62ea1a 179 /**
NYX 0:85b3fd62ea1a 180 * @}
NYX 0:85b3fd62ea1a 181 */
NYX 0:85b3fd62ea1a 182
NYX 0:85b3fd62ea1a 183 /* Exported macro ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 184 /** @defgroup GPIO_Exported_Macros GPIO Exported Macros
NYX 0:85b3fd62ea1a 185 * @{
NYX 0:85b3fd62ea1a 186 */
NYX 0:85b3fd62ea1a 187
NYX 0:85b3fd62ea1a 188 /**
NYX 0:85b3fd62ea1a 189 * @brief Checks whether the specified EXTI line flag is set or not.
NYX 0:85b3fd62ea1a 190 * @param __EXTI_LINE__: specifies the EXTI line flag to check.
NYX 0:85b3fd62ea1a 191 * This parameter can be GPIO_PIN_x where x can be(0..15)
NYX 0:85b3fd62ea1a 192 * @retval The new state of __EXTI_LINE__ (SET or RESET).
NYX 0:85b3fd62ea1a 193 */
NYX 0:85b3fd62ea1a 194 #define __HAL_GPIO_EXTI_GET_FLAG(__EXTI_LINE__) (EXTI->PR & (__EXTI_LINE__))
NYX 0:85b3fd62ea1a 195
NYX 0:85b3fd62ea1a 196 /**
NYX 0:85b3fd62ea1a 197 * @brief Clears the EXTI's line pending flags.
NYX 0:85b3fd62ea1a 198 * @param __EXTI_LINE__: specifies the EXTI lines flags to clear.
NYX 0:85b3fd62ea1a 199 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
NYX 0:85b3fd62ea1a 200 * @retval None
NYX 0:85b3fd62ea1a 201 */
NYX 0:85b3fd62ea1a 202 #define __HAL_GPIO_EXTI_CLEAR_FLAG(__EXTI_LINE__) (EXTI->PR = (__EXTI_LINE__))
NYX 0:85b3fd62ea1a 203
NYX 0:85b3fd62ea1a 204 /**
NYX 0:85b3fd62ea1a 205 * @brief Checks whether the specified EXTI line is asserted or not.
NYX 0:85b3fd62ea1a 206 * @param __EXTI_LINE__: specifies the EXTI line to check.
NYX 0:85b3fd62ea1a 207 * This parameter can be GPIO_PIN_x where x can be(0..15)
NYX 0:85b3fd62ea1a 208 * @retval The new state of __EXTI_LINE__ (SET or RESET).
NYX 0:85b3fd62ea1a 209 */
NYX 0:85b3fd62ea1a 210 #define __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__) (EXTI->PR & (__EXTI_LINE__))
NYX 0:85b3fd62ea1a 211
NYX 0:85b3fd62ea1a 212 /**
NYX 0:85b3fd62ea1a 213 * @brief Clears the EXTI's line pending bits.
NYX 0:85b3fd62ea1a 214 * @param __EXTI_LINE__: specifies the EXTI lines to clear.
NYX 0:85b3fd62ea1a 215 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
NYX 0:85b3fd62ea1a 216 * @retval None
NYX 0:85b3fd62ea1a 217 */
NYX 0:85b3fd62ea1a 218 #define __HAL_GPIO_EXTI_CLEAR_IT(__EXTI_LINE__) (EXTI->PR = (__EXTI_LINE__))
NYX 0:85b3fd62ea1a 219
NYX 0:85b3fd62ea1a 220 /**
NYX 0:85b3fd62ea1a 221 * @brief Generates a Software interrupt on selected EXTI line.
NYX 0:85b3fd62ea1a 222 * @param __EXTI_LINE__: specifies the EXTI line to check.
NYX 0:85b3fd62ea1a 223 * This parameter can be GPIO_PIN_x where x can be(0..15)
NYX 0:85b3fd62ea1a 224 * @retval None
NYX 0:85b3fd62ea1a 225 */
NYX 0:85b3fd62ea1a 226 #define __HAL_GPIO_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__))
NYX 0:85b3fd62ea1a 227 /**
NYX 0:85b3fd62ea1a 228 * @}
NYX 0:85b3fd62ea1a 229 */
NYX 0:85b3fd62ea1a 230
NYX 0:85b3fd62ea1a 231 /* Include GPIO HAL Extension module */
NYX 0:85b3fd62ea1a 232 #include "stm32f4xx_hal_gpio_ex.h"
NYX 0:85b3fd62ea1a 233
NYX 0:85b3fd62ea1a 234 /* Exported functions --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 235 /** @addtogroup GPIO_Exported_Functions
NYX 0:85b3fd62ea1a 236 * @{
NYX 0:85b3fd62ea1a 237 */
NYX 0:85b3fd62ea1a 238
NYX 0:85b3fd62ea1a 239 /** @addtogroup GPIO_Exported_Functions_Group1
NYX 0:85b3fd62ea1a 240 * @{
NYX 0:85b3fd62ea1a 241 */
NYX 0:85b3fd62ea1a 242 /* Initialization and de-initialization functions *****************************/
NYX 0:85b3fd62ea1a 243 void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
NYX 0:85b3fd62ea1a 244 void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
NYX 0:85b3fd62ea1a 245 /**
NYX 0:85b3fd62ea1a 246 * @}
NYX 0:85b3fd62ea1a 247 */
NYX 0:85b3fd62ea1a 248
NYX 0:85b3fd62ea1a 249 /** @addtogroup GPIO_Exported_Functions_Group2
NYX 0:85b3fd62ea1a 250 * @{
NYX 0:85b3fd62ea1a 251 */
NYX 0:85b3fd62ea1a 252 /* IO operation functions *****************************************************/
NYX 0:85b3fd62ea1a 253 GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
NYX 0:85b3fd62ea1a 254 void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
NYX 0:85b3fd62ea1a 255 void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
NYX 0:85b3fd62ea1a 256 HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
NYX 0:85b3fd62ea1a 257 void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin);
NYX 0:85b3fd62ea1a 258 void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
NYX 0:85b3fd62ea1a 259
NYX 0:85b3fd62ea1a 260 /**
NYX 0:85b3fd62ea1a 261 * @}
NYX 0:85b3fd62ea1a 262 */
NYX 0:85b3fd62ea1a 263
NYX 0:85b3fd62ea1a 264 /**
NYX 0:85b3fd62ea1a 265 * @}
NYX 0:85b3fd62ea1a 266 */
NYX 0:85b3fd62ea1a 267 /* Private types -------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 268 /* Private variables ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 269 /* Private constants ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 270 /** @defgroup GPIO_Private_Constants GPIO Private Constants
NYX 0:85b3fd62ea1a 271 * @{
NYX 0:85b3fd62ea1a 272 */
NYX 0:85b3fd62ea1a 273
NYX 0:85b3fd62ea1a 274 /**
NYX 0:85b3fd62ea1a 275 * @}
NYX 0:85b3fd62ea1a 276 */
NYX 0:85b3fd62ea1a 277
NYX 0:85b3fd62ea1a 278 /* Private macros ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 279 /** @defgroup GPIO_Private_Macros GPIO Private Macros
NYX 0:85b3fd62ea1a 280 * @{
NYX 0:85b3fd62ea1a 281 */
NYX 0:85b3fd62ea1a 282 #define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET))
NYX 0:85b3fd62ea1a 283 #define IS_GPIO_PIN(PIN) ((((PIN) & GPIO_PIN_MASK ) != 0x00U) && (((PIN) & ~GPIO_PIN_MASK) == 0x00U))
NYX 0:85b3fd62ea1a 284 #define IS_GPIO_MODE(MODE) (((MODE) == GPIO_MODE_INPUT) ||\
NYX 0:85b3fd62ea1a 285 ((MODE) == GPIO_MODE_OUTPUT_PP) ||\
NYX 0:85b3fd62ea1a 286 ((MODE) == GPIO_MODE_OUTPUT_OD) ||\
NYX 0:85b3fd62ea1a 287 ((MODE) == GPIO_MODE_AF_PP) ||\
NYX 0:85b3fd62ea1a 288 ((MODE) == GPIO_MODE_AF_OD) ||\
NYX 0:85b3fd62ea1a 289 ((MODE) == GPIO_MODE_IT_RISING) ||\
NYX 0:85b3fd62ea1a 290 ((MODE) == GPIO_MODE_IT_FALLING) ||\
NYX 0:85b3fd62ea1a 291 ((MODE) == GPIO_MODE_IT_RISING_FALLING) ||\
NYX 0:85b3fd62ea1a 292 ((MODE) == GPIO_MODE_EVT_RISING) ||\
NYX 0:85b3fd62ea1a 293 ((MODE) == GPIO_MODE_EVT_FALLING) ||\
NYX 0:85b3fd62ea1a 294 ((MODE) == GPIO_MODE_EVT_RISING_FALLING) ||\
NYX 0:85b3fd62ea1a 295 ((MODE) == GPIO_MODE_ANALOG))
NYX 0:85b3fd62ea1a 296 #define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_SPEED_FREQ_LOW) || ((SPEED) == GPIO_SPEED_FREQ_MEDIUM) || \
NYX 0:85b3fd62ea1a 297 ((SPEED) == GPIO_SPEED_FREQ_HIGH) || ((SPEED) == GPIO_SPEED_FREQ_VERY_HIGH))
NYX 0:85b3fd62ea1a 298 #define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \
NYX 0:85b3fd62ea1a 299 ((PULL) == GPIO_PULLDOWN))
NYX 0:85b3fd62ea1a 300 /**
NYX 0:85b3fd62ea1a 301 * @}
NYX 0:85b3fd62ea1a 302 */
NYX 0:85b3fd62ea1a 303
NYX 0:85b3fd62ea1a 304 /* Private functions ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 305 /** @defgroup GPIO_Private_Functions GPIO Private Functions
NYX 0:85b3fd62ea1a 306 * @{
NYX 0:85b3fd62ea1a 307 */
NYX 0:85b3fd62ea1a 308
NYX 0:85b3fd62ea1a 309 /**
NYX 0:85b3fd62ea1a 310 * @}
NYX 0:85b3fd62ea1a 311 */
NYX 0:85b3fd62ea1a 312
NYX 0:85b3fd62ea1a 313 /**
NYX 0:85b3fd62ea1a 314 * @}
NYX 0:85b3fd62ea1a 315 */
NYX 0:85b3fd62ea1a 316
NYX 0:85b3fd62ea1a 317 /**
NYX 0:85b3fd62ea1a 318 * @}
NYX 0:85b3fd62ea1a 319 */
NYX 0:85b3fd62ea1a 320
NYX 0:85b3fd62ea1a 321 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 322 }
NYX 0:85b3fd62ea1a 323 #endif
NYX 0:85b3fd62ea1a 324
NYX 0:85b3fd62ea1a 325 #endif /* __STM32F4xx_HAL_GPIO_H */
NYX 0:85b3fd62ea1a 326
NYX 0:85b3fd62ea1a 327 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/