cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
92:4fc01daae5a5
Child:
123:b0220dba8be7
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

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