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