The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NUCLEO_F334R8/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_gpio.h@143:86740a56073b, 2017-05-26 (annotated)
- Committer:
- AnnaBridge
- Date:
- Fri May 26 12:30:20 2017 +0100
- Revision:
- 143:86740a56073b
- Parent:
- 135:176b8275d35d
Release 143 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New 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 |
<> | 135:176b8275d35d | 5 | * @version V1.4.0 |
<> | 135:176b8275d35d | 6 | * @date 16-December-2016 |
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>© 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 | { |
<> | 135:176b8275d35d | 88 | GPIO_PIN_RESET = 0U, |
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 | */ |
<> | 135:176b8275d35d | 102 | #define GPIO_PIN_0 ((uint16_t)0x0001U) /* Pin 0 selected */ |
<> | 135:176b8275d35d | 103 | #define GPIO_PIN_1 ((uint16_t)0x0002U) /* Pin 1 selected */ |
<> | 135:176b8275d35d | 104 | #define GPIO_PIN_2 ((uint16_t)0x0004U) /* Pin 2 selected */ |
<> | 135:176b8275d35d | 105 | #define GPIO_PIN_3 ((uint16_t)0x0008U) /* Pin 3 selected */ |
<> | 135:176b8275d35d | 106 | #define GPIO_PIN_4 ((uint16_t)0x0010U) /* Pin 4 selected */ |
<> | 135:176b8275d35d | 107 | #define GPIO_PIN_5 ((uint16_t)0x0020U) /* Pin 5 selected */ |
<> | 135:176b8275d35d | 108 | #define GPIO_PIN_6 ((uint16_t)0x0040U) /* Pin 6 selected */ |
<> | 135:176b8275d35d | 109 | #define GPIO_PIN_7 ((uint16_t)0x0080U) /* Pin 7 selected */ |
<> | 135:176b8275d35d | 110 | #define GPIO_PIN_8 ((uint16_t)0x0100U) /* Pin 8 selected */ |
<> | 135:176b8275d35d | 111 | #define GPIO_PIN_9 ((uint16_t)0x0200U) /* Pin 9 selected */ |
<> | 135:176b8275d35d | 112 | #define GPIO_PIN_10 ((uint16_t)0x0400U) /* Pin 10 selected */ |
<> | 135:176b8275d35d | 113 | #define GPIO_PIN_11 ((uint16_t)0x0800U) /* Pin 11 selected */ |
<> | 135:176b8275d35d | 114 | #define GPIO_PIN_12 ((uint16_t)0x1000U) /* Pin 12 selected */ |
<> | 135:176b8275d35d | 115 | #define GPIO_PIN_13 ((uint16_t)0x2000U) /* Pin 13 selected */ |
<> | 135:176b8275d35d | 116 | #define GPIO_PIN_14 ((uint16_t)0x4000U) /* Pin 14 selected */ |
<> | 135:176b8275d35d | 117 | #define GPIO_PIN_15 ((uint16_t)0x8000U) /* Pin 15 selected */ |
<> | 135:176b8275d35d | 118 | #define GPIO_PIN_All ((uint16_t)0xFFFFU) /* All pins selected */ |
bogdanm | 86:04dd9b1680ae | 119 | |
<> | 135:176b8275d35d | 120 | #define GPIO_PIN_MASK (0x0000FFFFU) /* 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 | */ |
<> | 135:176b8275d35d | 135 | #define GPIO_MODE_INPUT (0x00000000U) /*!< Input Floating Mode */ |
<> | 135:176b8275d35d | 136 | #define GPIO_MODE_OUTPUT_PP (0x00000001U) /*!< Output Push Pull Mode */ |
<> | 135:176b8275d35d | 137 | #define GPIO_MODE_OUTPUT_OD (0x00000011U) /*!< Output Open Drain Mode */ |
<> | 135:176b8275d35d | 138 | #define GPIO_MODE_AF_PP (0x00000002U) /*!< Alternate Function Push Pull Mode */ |
<> | 135:176b8275d35d | 139 | #define GPIO_MODE_AF_OD (0x00000012U) /*!< Alternate Function Open Drain Mode */ |
<> | 135:176b8275d35d | 140 | #define GPIO_MODE_ANALOG (0x00000003U) /*!< Analog Mode */ |
<> | 135:176b8275d35d | 141 | #define GPIO_MODE_IT_RISING (0x10110000U) /*!< External Interrupt Mode with Rising edge trigger detection */ |
<> | 135:176b8275d35d | 142 | #define GPIO_MODE_IT_FALLING (0x10210000U) /*!< External Interrupt Mode with Falling edge trigger detection */ |
<> | 135:176b8275d35d | 143 | #define GPIO_MODE_IT_RISING_FALLING (0x10310000U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */ |
<> | 135:176b8275d35d | 144 | #define GPIO_MODE_EVT_RISING (0x10120000U) /*!< External Event Mode with Rising edge trigger detection */ |
<> | 135:176b8275d35d | 145 | #define GPIO_MODE_EVT_FALLING (0x10220000U) /*!< External Event Mode with Falling edge trigger detection */ |
<> | 135:176b8275d35d | 146 | #define GPIO_MODE_EVT_RISING_FALLING (0x10320000U) /*!< 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 | */ |
<> | 135:176b8275d35d | 155 | #define GPIO_SPEED_FREQ_LOW (0x00000000U) /*!< range up to 2 MHz, please refer to the product datasheet */ |
<> | 135:176b8275d35d | 156 | #define GPIO_SPEED_FREQ_MEDIUM (0x00000001U) /*!< range 4 MHz to 10 MHz, please refer to the product datasheet */ |
<> | 135:176b8275d35d | 157 | #define GPIO_SPEED_FREQ_HIGH (0x00000003U) /*!< 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 | */ |
<> | 135:176b8275d35d | 166 | #define GPIO_NOPULL (0x00000000U) /*!< No Pull-up or Pull-down activation */ |
<> | 135:176b8275d35d | 167 | #define GPIO_PULLUP (0x00000001U) /*!< Pull-up activation */ |
<> | 135:176b8275d35d | 168 | #define GPIO_PULLDOWN (0x00000002U) /*!< 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 | |
<> | 135:176b8275d35d | 232 | #define IS_GPIO_PIN(__PIN__) ((((__PIN__) & GPIO_PIN_MASK) != 0x00U) &&\ |
<> | 135:176b8275d35d | 233 | (((__PIN__) & ~GPIO_PIN_MASK) == 0x00U)) |
bogdanm | 86:04dd9b1680ae | 234 | |
Kojto | 122:f9eeca106725 | 235 | #define IS_GPIO_MODE(__MODE__) (((__MODE__) == GPIO_MODE_INPUT) ||\ |
Kojto | 122:f9eeca106725 | 236 | ((__MODE__) == GPIO_MODE_OUTPUT_PP) ||\ |
Kojto | 122:f9eeca106725 | 237 | ((__MODE__) == GPIO_MODE_OUTPUT_OD) ||\ |
Kojto | 122:f9eeca106725 | 238 | ((__MODE__) == GPIO_MODE_AF_PP) ||\ |
Kojto | 122:f9eeca106725 | 239 | ((__MODE__) == GPIO_MODE_AF_OD) ||\ |
Kojto | 122:f9eeca106725 | 240 | ((__MODE__) == GPIO_MODE_IT_RISING) ||\ |
Kojto | 122:f9eeca106725 | 241 | ((__MODE__) == GPIO_MODE_IT_FALLING) ||\ |
Kojto | 122:f9eeca106725 | 242 | ((__MODE__) == GPIO_MODE_IT_RISING_FALLING) ||\ |
Kojto | 122:f9eeca106725 | 243 | ((__MODE__) == GPIO_MODE_EVT_RISING) ||\ |
Kojto | 122:f9eeca106725 | 244 | ((__MODE__) == GPIO_MODE_EVT_FALLING) ||\ |
Kojto | 122:f9eeca106725 | 245 | ((__MODE__) == GPIO_MODE_EVT_RISING_FALLING) ||\ |
Kojto | 122:f9eeca106725 | 246 | ((__MODE__) == GPIO_MODE_ANALOG)) |
Kojto | 122:f9eeca106725 | 247 | |
Kojto | 122:f9eeca106725 | 248 | #define IS_GPIO_SPEED(__SPEED__) (((__SPEED__) == GPIO_SPEED_FREQ_LOW) ||\ |
Kojto | 122:f9eeca106725 | 249 | ((__SPEED__) == GPIO_SPEED_FREQ_MEDIUM) ||\ |
Kojto | 122:f9eeca106725 | 250 | ((__SPEED__) == GPIO_SPEED_FREQ_HIGH)) |
Kojto | 122:f9eeca106725 | 251 | |
Kojto | 122:f9eeca106725 | 252 | #define IS_GPIO_PULL(__PULL__) (((__PULL__) == GPIO_NOPULL) ||\ |
Kojto | 122:f9eeca106725 | 253 | ((__PULL__) == GPIO_PULLUP) || \ |
Kojto | 122:f9eeca106725 | 254 | ((__PULL__) == GPIO_PULLDOWN)) |
bogdanm | 92:4fc01daae5a5 | 255 | /** |
bogdanm | 92:4fc01daae5a5 | 256 | * @} |
bogdanm | 92:4fc01daae5a5 | 257 | */ |
bogdanm | 92:4fc01daae5a5 | 258 | |
bogdanm | 92:4fc01daae5a5 | 259 | /* Include GPIO HAL Extended module */ |
bogdanm | 86:04dd9b1680ae | 260 | #include "stm32f3xx_hal_gpio_ex.h" |
bogdanm | 86:04dd9b1680ae | 261 | |
bogdanm | 86:04dd9b1680ae | 262 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 92:4fc01daae5a5 | 263 | /** @addtogroup GPIO_Exported_Functions GPIO Exported Functions |
Kojto | 122:f9eeca106725 | 264 | * @{ |
Kojto | 122:f9eeca106725 | 265 | */ |
bogdanm | 92:4fc01daae5a5 | 266 | |
Kojto | 122:f9eeca106725 | 267 | /** @addtogroup GPIO_Exported_Functions_Group1 Initialization/de-initialization functions |
Kojto | 122:f9eeca106725 | 268 | * @brief Initialization and Configuration functions |
Kojto | 122:f9eeca106725 | 269 | * @{ |
Kojto | 122:f9eeca106725 | 270 | */ |
Kojto | 122:f9eeca106725 | 271 | |
bogdanm | 86:04dd9b1680ae | 272 | /* Initialization and de-initialization functions *****************************/ |
bogdanm | 86:04dd9b1680ae | 273 | void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init); |
bogdanm | 86:04dd9b1680ae | 274 | void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin); |
bogdanm | 86:04dd9b1680ae | 275 | |
bogdanm | 92:4fc01daae5a5 | 276 | /** |
bogdanm | 92:4fc01daae5a5 | 277 | * @} |
bogdanm | 92:4fc01daae5a5 | 278 | */ |
bogdanm | 92:4fc01daae5a5 | 279 | |
Kojto | 122:f9eeca106725 | 280 | /** @addtogroup GPIO_Exported_Functions_Group2 IO operation functions |
Kojto | 122:f9eeca106725 | 281 | * @{ |
Kojto | 122:f9eeca106725 | 282 | */ |
Kojto | 122:f9eeca106725 | 283 | |
bogdanm | 86:04dd9b1680ae | 284 | /* IO operation functions *****************************************************/ |
bogdanm | 86:04dd9b1680ae | 285 | GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
bogdanm | 86:04dd9b1680ae | 286 | void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState); |
bogdanm | 86:04dd9b1680ae | 287 | void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
bogdanm | 86:04dd9b1680ae | 288 | HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
bogdanm | 86:04dd9b1680ae | 289 | void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin); |
bogdanm | 86:04dd9b1680ae | 290 | void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin); |
bogdanm | 86:04dd9b1680ae | 291 | |
bogdanm | 86:04dd9b1680ae | 292 | /** |
bogdanm | 86:04dd9b1680ae | 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 | 92:4fc01daae5a5 | 301 | * @} |
bogdanm | 86:04dd9b1680ae | 302 | */ |
bogdanm | 86:04dd9b1680ae | 303 | |
bogdanm | 86:04dd9b1680ae | 304 | /** |
bogdanm | 86:04dd9b1680ae | 305 | * @} |
Kojto | 122:f9eeca106725 | 306 | */ |
Kojto | 122:f9eeca106725 | 307 | |
bogdanm | 86:04dd9b1680ae | 308 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 309 | } |
bogdanm | 86:04dd9b1680ae | 310 | #endif |
bogdanm | 86:04dd9b1680ae | 311 | |
bogdanm | 86:04dd9b1680ae | 312 | #endif /* __STM32F3xx_HAL_GPIO_H */ |
bogdanm | 86:04dd9b1680ae | 313 | |
bogdanm | 86:04dd9b1680ae | 314 | |
bogdanm | 86:04dd9b1680ae | 315 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |