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