Modified version of the mbed library for use with the Nucleo boards.

Dependents:   EEPROMWrite Full-Project

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Sep 28 10:45:10 2015 +0100
Revision:
630:825f75ca301e
Parent:
441:d2c15dda23c1
Synchronized with git revision 54fbe4144faf309c37205a5d39fa665daa919f10

Full URL: https://github.com/mbedmicro/mbed/commit/54fbe4144faf309c37205a5d39fa665daa919f10/

NUCLEO_F031K6 : Add new target

Who changed what in which revision?

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