mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_ll_gpio.c@158:b23ee177fd68, 2017-02-14 (annotated)
- Committer:
- Kojto
- Date:
- Tue Feb 14 14:44:10 2017 +0000
- Revision:
- 158:b23ee177fd68
- Child:
- 186:707f6e361f3e
This updates the lib to the mbed lib v136
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 158:b23ee177fd68 | 1 | /** |
Kojto | 158:b23ee177fd68 | 2 | ****************************************************************************** |
Kojto | 158:b23ee177fd68 | 3 | * @file stm32l0xx_ll_gpio.c |
Kojto | 158:b23ee177fd68 | 4 | * @author MCD Application Team |
Kojto | 158:b23ee177fd68 | 5 | * @version V1.7.0 |
Kojto | 158:b23ee177fd68 | 6 | * @date 31-May-2016 |
Kojto | 158:b23ee177fd68 | 7 | * @brief GPIO LL module driver. |
Kojto | 158:b23ee177fd68 | 8 | ****************************************************************************** |
Kojto | 158:b23ee177fd68 | 9 | * @attention |
Kojto | 158:b23ee177fd68 | 10 | * |
Kojto | 158:b23ee177fd68 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
Kojto | 158:b23ee177fd68 | 12 | * |
Kojto | 158:b23ee177fd68 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 158:b23ee177fd68 | 14 | * are permitted provided that the following conditions are met: |
Kojto | 158:b23ee177fd68 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 158:b23ee177fd68 | 16 | * this list of conditions and the following disclaimer. |
Kojto | 158:b23ee177fd68 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 158:b23ee177fd68 | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 158:b23ee177fd68 | 19 | * and/or other materials provided with the distribution. |
Kojto | 158:b23ee177fd68 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 158:b23ee177fd68 | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 158:b23ee177fd68 | 22 | * without specific prior written permission. |
Kojto | 158:b23ee177fd68 | 23 | * |
Kojto | 158:b23ee177fd68 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 158:b23ee177fd68 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 158:b23ee177fd68 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 158:b23ee177fd68 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 158:b23ee177fd68 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 158:b23ee177fd68 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 158:b23ee177fd68 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 158:b23ee177fd68 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 158:b23ee177fd68 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 158:b23ee177fd68 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 158:b23ee177fd68 | 34 | * |
Kojto | 158:b23ee177fd68 | 35 | ****************************************************************************** |
Kojto | 158:b23ee177fd68 | 36 | */ |
Kojto | 158:b23ee177fd68 | 37 | #if defined(USE_FULL_LL_DRIVER) |
Kojto | 158:b23ee177fd68 | 38 | |
Kojto | 158:b23ee177fd68 | 39 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 40 | #include "stm32l0xx_ll_gpio.h" |
Kojto | 158:b23ee177fd68 | 41 | #include "stm32l0xx_ll_bus.h" |
Kojto | 158:b23ee177fd68 | 42 | #ifdef USE_FULL_ASSERT |
Kojto | 158:b23ee177fd68 | 43 | #include "stm32_assert.h" |
Kojto | 158:b23ee177fd68 | 44 | #else |
Kojto | 158:b23ee177fd68 | 45 | #define assert_param(expr) ((void)0U) |
Kojto | 158:b23ee177fd68 | 46 | #endif |
Kojto | 158:b23ee177fd68 | 47 | |
Kojto | 158:b23ee177fd68 | 48 | /** @addtogroup STM32L0xx_LL_Driver |
Kojto | 158:b23ee177fd68 | 49 | * @{ |
Kojto | 158:b23ee177fd68 | 50 | */ |
Kojto | 158:b23ee177fd68 | 51 | |
Kojto | 158:b23ee177fd68 | 52 | #if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOH) |
Kojto | 158:b23ee177fd68 | 53 | |
Kojto | 158:b23ee177fd68 | 54 | /** @addtogroup GPIO_LL |
Kojto | 158:b23ee177fd68 | 55 | * @{ |
Kojto | 158:b23ee177fd68 | 56 | */ |
Kojto | 158:b23ee177fd68 | 57 | |
Kojto | 158:b23ee177fd68 | 58 | /* Private types -------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 59 | /* Private variables ---------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 60 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 61 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 62 | /** @addtogroup GPIO_LL_Private_Macros |
Kojto | 158:b23ee177fd68 | 63 | * @{ |
Kojto | 158:b23ee177fd68 | 64 | */ |
Kojto | 158:b23ee177fd68 | 65 | #define IS_LL_GPIO_PIN(__VALUE__) ((((uint32_t)0x00000000U) < (__VALUE__)) && ((__VALUE__) <= (LL_GPIO_PIN_ALL))) |
Kojto | 158:b23ee177fd68 | 66 | |
Kojto | 158:b23ee177fd68 | 67 | #define IS_LL_GPIO_MODE(__VALUE__) (((__VALUE__) == LL_GPIO_MODE_INPUT) ||\ |
Kojto | 158:b23ee177fd68 | 68 | ((__VALUE__) == LL_GPIO_MODE_OUTPUT) ||\ |
Kojto | 158:b23ee177fd68 | 69 | ((__VALUE__) == LL_GPIO_MODE_ALTERNATE) ||\ |
Kojto | 158:b23ee177fd68 | 70 | ((__VALUE__) == LL_GPIO_MODE_ANALOG)) |
Kojto | 158:b23ee177fd68 | 71 | |
Kojto | 158:b23ee177fd68 | 72 | #define IS_LL_GPIO_OUTPUT_TYPE(__VALUE__) (((__VALUE__) == LL_GPIO_OUTPUT_PUSHPULL) ||\ |
Kojto | 158:b23ee177fd68 | 73 | ((__VALUE__) == LL_GPIO_OUTPUT_OPENDRAIN)) |
Kojto | 158:b23ee177fd68 | 74 | |
Kojto | 158:b23ee177fd68 | 75 | #define IS_LL_GPIO_SPEED(__VALUE__) (((__VALUE__) == LL_GPIO_SPEED_FREQ_LOW) ||\ |
Kojto | 158:b23ee177fd68 | 76 | ((__VALUE__) == LL_GPIO_SPEED_FREQ_MEDIUM) ||\ |
Kojto | 158:b23ee177fd68 | 77 | ((__VALUE__) == LL_GPIO_SPEED_FREQ_HIGH) ||\ |
Kojto | 158:b23ee177fd68 | 78 | ((__VALUE__) == LL_GPIO_SPEED_FREQ_VERY_HIGH)) |
Kojto | 158:b23ee177fd68 | 79 | |
Kojto | 158:b23ee177fd68 | 80 | #define IS_LL_GPIO_PULL(__VALUE__) (((__VALUE__) == LL_GPIO_PULL_NO) ||\ |
Kojto | 158:b23ee177fd68 | 81 | ((__VALUE__) == LL_GPIO_PULL_UP) ||\ |
Kojto | 158:b23ee177fd68 | 82 | ((__VALUE__) == LL_GPIO_PULL_DOWN)) |
Kojto | 158:b23ee177fd68 | 83 | |
Kojto | 158:b23ee177fd68 | 84 | #define IS_LL_GPIO_ALTERNATE(__VALUE__) (((__VALUE__) == LL_GPIO_AF_0 ) ||\ |
Kojto | 158:b23ee177fd68 | 85 | ((__VALUE__) == LL_GPIO_AF_1 ) ||\ |
Kojto | 158:b23ee177fd68 | 86 | ((__VALUE__) == LL_GPIO_AF_2 ) ||\ |
Kojto | 158:b23ee177fd68 | 87 | ((__VALUE__) == LL_GPIO_AF_3 ) ||\ |
Kojto | 158:b23ee177fd68 | 88 | ((__VALUE__) == LL_GPIO_AF_4 ) ||\ |
Kojto | 158:b23ee177fd68 | 89 | ((__VALUE__) == LL_GPIO_AF_5 ) ||\ |
Kojto | 158:b23ee177fd68 | 90 | ((__VALUE__) == LL_GPIO_AF_6 ) ||\ |
Kojto | 158:b23ee177fd68 | 91 | ((__VALUE__) == LL_GPIO_AF_7 )) |
Kojto | 158:b23ee177fd68 | 92 | /** |
Kojto | 158:b23ee177fd68 | 93 | * @} |
Kojto | 158:b23ee177fd68 | 94 | */ |
Kojto | 158:b23ee177fd68 | 95 | |
Kojto | 158:b23ee177fd68 | 96 | /* Private function prototypes -----------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 97 | |
Kojto | 158:b23ee177fd68 | 98 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 99 | /** @addtogroup GPIO_LL_Exported_Functions |
Kojto | 158:b23ee177fd68 | 100 | * @{ |
Kojto | 158:b23ee177fd68 | 101 | */ |
Kojto | 158:b23ee177fd68 | 102 | |
Kojto | 158:b23ee177fd68 | 103 | /** @addtogroup GPIO_LL_EF_Init |
Kojto | 158:b23ee177fd68 | 104 | * @{ |
Kojto | 158:b23ee177fd68 | 105 | */ |
Kojto | 158:b23ee177fd68 | 106 | |
Kojto | 158:b23ee177fd68 | 107 | /** |
Kojto | 158:b23ee177fd68 | 108 | * @brief De-initialize GPIO registers (Registers restored to their default values). |
Kojto | 158:b23ee177fd68 | 109 | * @param GPIOx GPIO Port |
Kojto | 158:b23ee177fd68 | 110 | * @retval An ErrorStatus enumeration value: |
Kojto | 158:b23ee177fd68 | 111 | * - SUCCESS: GPIO registers are de-initialized |
Kojto | 158:b23ee177fd68 | 112 | * - ERROR: Wrong GPIO Port |
Kojto | 158:b23ee177fd68 | 113 | */ |
Kojto | 158:b23ee177fd68 | 114 | ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx) |
Kojto | 158:b23ee177fd68 | 115 | { |
Kojto | 158:b23ee177fd68 | 116 | ErrorStatus status = SUCCESS; |
Kojto | 158:b23ee177fd68 | 117 | |
Kojto | 158:b23ee177fd68 | 118 | /* Check the parameters */ |
Kojto | 158:b23ee177fd68 | 119 | assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); |
Kojto | 158:b23ee177fd68 | 120 | |
Kojto | 158:b23ee177fd68 | 121 | /* Force and Release reset on clock of GPIOx Port */ |
Kojto | 158:b23ee177fd68 | 122 | if (GPIOx == GPIOA) |
Kojto | 158:b23ee177fd68 | 123 | { |
Kojto | 158:b23ee177fd68 | 124 | LL_IOP_GRP1_ForceReset(LL_IOP_GRP1_PERIPH_GPIOA); |
Kojto | 158:b23ee177fd68 | 125 | LL_IOP_GRP1_ReleaseReset(LL_IOP_GRP1_PERIPH_GPIOA); |
Kojto | 158:b23ee177fd68 | 126 | } |
Kojto | 158:b23ee177fd68 | 127 | else if (GPIOx == GPIOB) |
Kojto | 158:b23ee177fd68 | 128 | { |
Kojto | 158:b23ee177fd68 | 129 | LL_IOP_GRP1_ForceReset(LL_IOP_GRP1_PERIPH_GPIOB); |
Kojto | 158:b23ee177fd68 | 130 | LL_IOP_GRP1_ReleaseReset(LL_IOP_GRP1_PERIPH_GPIOB); |
Kojto | 158:b23ee177fd68 | 131 | } |
Kojto | 158:b23ee177fd68 | 132 | else if (GPIOx == GPIOC) |
Kojto | 158:b23ee177fd68 | 133 | { |
Kojto | 158:b23ee177fd68 | 134 | LL_IOP_GRP1_ForceReset(LL_IOP_GRP1_PERIPH_GPIOC); |
Kojto | 158:b23ee177fd68 | 135 | LL_IOP_GRP1_ReleaseReset(LL_IOP_GRP1_PERIPH_GPIOC); |
Kojto | 158:b23ee177fd68 | 136 | } |
Kojto | 158:b23ee177fd68 | 137 | #if defined(GPIOD) |
Kojto | 158:b23ee177fd68 | 138 | else if (GPIOx == GPIOD) |
Kojto | 158:b23ee177fd68 | 139 | { |
Kojto | 158:b23ee177fd68 | 140 | LL_IOP_GRP1_ForceReset(LL_IOP_GRP1_PERIPH_GPIOD); |
Kojto | 158:b23ee177fd68 | 141 | LL_IOP_GRP1_ReleaseReset(LL_IOP_GRP1_PERIPH_GPIOD); |
Kojto | 158:b23ee177fd68 | 142 | } |
Kojto | 158:b23ee177fd68 | 143 | #endif /* GPIOD */ |
Kojto | 158:b23ee177fd68 | 144 | #if defined(GPIOE) |
Kojto | 158:b23ee177fd68 | 145 | else if (GPIOx == GPIOE) |
Kojto | 158:b23ee177fd68 | 146 | { |
Kojto | 158:b23ee177fd68 | 147 | LL_IOP_GRP1_ForceReset(LL_IOP_GRP1_PERIPH_GPIOE); |
Kojto | 158:b23ee177fd68 | 148 | LL_IOP_GRP1_ReleaseReset(LL_IOP_GRP1_PERIPH_GPIOE); |
Kojto | 158:b23ee177fd68 | 149 | } |
Kojto | 158:b23ee177fd68 | 150 | #endif /* GPIOE */ |
Kojto | 158:b23ee177fd68 | 151 | #if defined(GPIOH) |
Kojto | 158:b23ee177fd68 | 152 | else if (GPIOx == GPIOH) |
Kojto | 158:b23ee177fd68 | 153 | { |
Kojto | 158:b23ee177fd68 | 154 | LL_IOP_GRP1_ForceReset(LL_IOP_GRP1_PERIPH_GPIOH); |
Kojto | 158:b23ee177fd68 | 155 | LL_IOP_GRP1_ReleaseReset(LL_IOP_GRP1_PERIPH_GPIOH); |
Kojto | 158:b23ee177fd68 | 156 | } |
Kojto | 158:b23ee177fd68 | 157 | #endif /* GPIOH */ |
Kojto | 158:b23ee177fd68 | 158 | else |
Kojto | 158:b23ee177fd68 | 159 | { |
Kojto | 158:b23ee177fd68 | 160 | status = ERROR; |
Kojto | 158:b23ee177fd68 | 161 | } |
Kojto | 158:b23ee177fd68 | 162 | |
Kojto | 158:b23ee177fd68 | 163 | return (status); |
Kojto | 158:b23ee177fd68 | 164 | } |
Kojto | 158:b23ee177fd68 | 165 | |
Kojto | 158:b23ee177fd68 | 166 | /** |
Kojto | 158:b23ee177fd68 | 167 | * @brief Initialize GPIO registers according to the specified parameters in GPIO_InitStruct. |
Kojto | 158:b23ee177fd68 | 168 | * @param GPIOx GPIO Port |
Kojto | 158:b23ee177fd68 | 169 | * @param GPIO_InitStruct: pointer to a @ref LL_GPIO_InitTypeDef structure |
Kojto | 158:b23ee177fd68 | 170 | * that contains the configuration information for the specified GPIO peripheral. |
Kojto | 158:b23ee177fd68 | 171 | * @retval An ErrorStatus enumeration value: |
Kojto | 158:b23ee177fd68 | 172 | * - SUCCESS: GPIO registers are initialized according to GPIO_InitStruct content |
Kojto | 158:b23ee177fd68 | 173 | * - ERROR: Not applicable |
Kojto | 158:b23ee177fd68 | 174 | */ |
Kojto | 158:b23ee177fd68 | 175 | ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct) |
Kojto | 158:b23ee177fd68 | 176 | { |
Kojto | 158:b23ee177fd68 | 177 | uint32_t pinpos = 0x00000000U; |
Kojto | 158:b23ee177fd68 | 178 | uint32_t currentpin = 0x00000000U; |
Kojto | 158:b23ee177fd68 | 179 | |
Kojto | 158:b23ee177fd68 | 180 | /* Check the parameters */ |
Kojto | 158:b23ee177fd68 | 181 | assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); |
Kojto | 158:b23ee177fd68 | 182 | assert_param(IS_LL_GPIO_PIN(GPIO_InitStruct->Pin)); |
Kojto | 158:b23ee177fd68 | 183 | assert_param(IS_LL_GPIO_MODE(GPIO_InitStruct->Mode)); |
Kojto | 158:b23ee177fd68 | 184 | assert_param(IS_LL_GPIO_PULL(GPIO_InitStruct->Pull)); |
Kojto | 158:b23ee177fd68 | 185 | |
Kojto | 158:b23ee177fd68 | 186 | /* ------------------------- Configure the port pins ---------------- */ |
Kojto | 158:b23ee177fd68 | 187 | /* Initialize pinpos on first pin set */ |
Kojto | 158:b23ee177fd68 | 188 | /* pinpos = 0; useless as already done in default initialization */ |
Kojto | 158:b23ee177fd68 | 189 | |
Kojto | 158:b23ee177fd68 | 190 | /* Configure the port pins */ |
Kojto | 158:b23ee177fd68 | 191 | while (((GPIO_InitStruct->Pin) >> pinpos) != 0x00000000U) |
Kojto | 158:b23ee177fd68 | 192 | { |
Kojto | 158:b23ee177fd68 | 193 | /* Get current io position */ |
Kojto | 158:b23ee177fd68 | 194 | currentpin = (GPIO_InitStruct->Pin) & (0x00000001U << pinpos); |
Kojto | 158:b23ee177fd68 | 195 | |
Kojto | 158:b23ee177fd68 | 196 | if (currentpin) |
Kojto | 158:b23ee177fd68 | 197 | { |
Kojto | 158:b23ee177fd68 | 198 | /* Pin Mode configuration */ |
Kojto | 158:b23ee177fd68 | 199 | LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode); |
Kojto | 158:b23ee177fd68 | 200 | |
Kojto | 158:b23ee177fd68 | 201 | if ((GPIO_InitStruct->Mode == LL_GPIO_MODE_OUTPUT) || (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE)) |
Kojto | 158:b23ee177fd68 | 202 | { |
Kojto | 158:b23ee177fd68 | 203 | /* Check Speed mode parameters */ |
Kojto | 158:b23ee177fd68 | 204 | assert_param(IS_LL_GPIO_SPEED(GPIO_InitStruct->Speed)); |
Kojto | 158:b23ee177fd68 | 205 | |
Kojto | 158:b23ee177fd68 | 206 | /* Speed mode configuration */ |
Kojto | 158:b23ee177fd68 | 207 | LL_GPIO_SetPinSpeed(GPIOx, currentpin, GPIO_InitStruct->Speed); |
Kojto | 158:b23ee177fd68 | 208 | } |
Kojto | 158:b23ee177fd68 | 209 | |
Kojto | 158:b23ee177fd68 | 210 | /* Pull-up Pull down resistor configuration*/ |
Kojto | 158:b23ee177fd68 | 211 | LL_GPIO_SetPinPull(GPIOx, currentpin, GPIO_InitStruct->Pull); |
Kojto | 158:b23ee177fd68 | 212 | |
Kojto | 158:b23ee177fd68 | 213 | if (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE) |
Kojto | 158:b23ee177fd68 | 214 | { |
Kojto | 158:b23ee177fd68 | 215 | /* Check Alternate parameter */ |
Kojto | 158:b23ee177fd68 | 216 | assert_param(IS_LL_GPIO_ALTERNATE(GPIO_InitStruct->Alternate)); |
Kojto | 158:b23ee177fd68 | 217 | |
Kojto | 158:b23ee177fd68 | 218 | /* Speed mode configuration */ |
Kojto | 158:b23ee177fd68 | 219 | if (currentpin < LL_GPIO_PIN_8) |
Kojto | 158:b23ee177fd68 | 220 | { |
Kojto | 158:b23ee177fd68 | 221 | LL_GPIO_SetAFPin_0_7(GPIOx, currentpin, GPIO_InitStruct->Alternate); |
Kojto | 158:b23ee177fd68 | 222 | } |
Kojto | 158:b23ee177fd68 | 223 | else |
Kojto | 158:b23ee177fd68 | 224 | { |
Kojto | 158:b23ee177fd68 | 225 | LL_GPIO_SetAFPin_8_15(GPIOx, currentpin, GPIO_InitStruct->Alternate); |
Kojto | 158:b23ee177fd68 | 226 | } |
Kojto | 158:b23ee177fd68 | 227 | } |
Kojto | 158:b23ee177fd68 | 228 | } |
Kojto | 158:b23ee177fd68 | 229 | pinpos++; |
Kojto | 158:b23ee177fd68 | 230 | } |
Kojto | 158:b23ee177fd68 | 231 | |
Kojto | 158:b23ee177fd68 | 232 | if ((GPIO_InitStruct->Mode == LL_GPIO_MODE_OUTPUT) || (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE)) |
Kojto | 158:b23ee177fd68 | 233 | { |
Kojto | 158:b23ee177fd68 | 234 | /* Check Output mode parameters */ |
Kojto | 158:b23ee177fd68 | 235 | assert_param(IS_LL_GPIO_OUTPUT_TYPE(GPIO_InitStruct->OutputType)); |
Kojto | 158:b23ee177fd68 | 236 | |
Kojto | 158:b23ee177fd68 | 237 | /* Output mode configuration*/ |
Kojto | 158:b23ee177fd68 | 238 | LL_GPIO_SetPinOutputType(GPIOx, GPIO_InitStruct->Pin, GPIO_InitStruct->OutputType); |
Kojto | 158:b23ee177fd68 | 239 | |
Kojto | 158:b23ee177fd68 | 240 | } |
Kojto | 158:b23ee177fd68 | 241 | return (SUCCESS); |
Kojto | 158:b23ee177fd68 | 242 | } |
Kojto | 158:b23ee177fd68 | 243 | |
Kojto | 158:b23ee177fd68 | 244 | /** |
Kojto | 158:b23ee177fd68 | 245 | * @brief Set each @ref LL_GPIO_InitTypeDef field to default value. |
Kojto | 158:b23ee177fd68 | 246 | * @param GPIO_InitStruct: pointer to a @ref LL_GPIO_InitTypeDef structure |
Kojto | 158:b23ee177fd68 | 247 | * whose fields will be set to default values. |
Kojto | 158:b23ee177fd68 | 248 | * @retval None |
Kojto | 158:b23ee177fd68 | 249 | */ |
Kojto | 158:b23ee177fd68 | 250 | |
Kojto | 158:b23ee177fd68 | 251 | void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct) |
Kojto | 158:b23ee177fd68 | 252 | { |
Kojto | 158:b23ee177fd68 | 253 | /* Reset GPIO init structure parameters values */ |
Kojto | 158:b23ee177fd68 | 254 | GPIO_InitStruct->Pin = LL_GPIO_PIN_ALL; |
Kojto | 158:b23ee177fd68 | 255 | GPIO_InitStruct->Mode = LL_GPIO_MODE_ANALOG; |
Kojto | 158:b23ee177fd68 | 256 | GPIO_InitStruct->Speed = LL_GPIO_SPEED_FREQ_LOW; |
Kojto | 158:b23ee177fd68 | 257 | GPIO_InitStruct->OutputType = LL_GPIO_OUTPUT_PUSHPULL; |
Kojto | 158:b23ee177fd68 | 258 | GPIO_InitStruct->Pull = LL_GPIO_PULL_NO; |
Kojto | 158:b23ee177fd68 | 259 | GPIO_InitStruct->Alternate = LL_GPIO_AF_0; |
Kojto | 158:b23ee177fd68 | 260 | } |
Kojto | 158:b23ee177fd68 | 261 | |
Kojto | 158:b23ee177fd68 | 262 | /** |
Kojto | 158:b23ee177fd68 | 263 | * @} |
Kojto | 158:b23ee177fd68 | 264 | */ |
Kojto | 158:b23ee177fd68 | 265 | |
Kojto | 158:b23ee177fd68 | 266 | /** |
Kojto | 158:b23ee177fd68 | 267 | * @} |
Kojto | 158:b23ee177fd68 | 268 | */ |
Kojto | 158:b23ee177fd68 | 269 | |
Kojto | 158:b23ee177fd68 | 270 | /** |
Kojto | 158:b23ee177fd68 | 271 | * @} |
Kojto | 158:b23ee177fd68 | 272 | */ |
Kojto | 158:b23ee177fd68 | 273 | |
Kojto | 158:b23ee177fd68 | 274 | #endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOH) */ |
Kojto | 158:b23ee177fd68 | 275 | |
Kojto | 158:b23ee177fd68 | 276 | /** |
Kojto | 158:b23ee177fd68 | 277 | * @} |
Kojto | 158:b23ee177fd68 | 278 | */ |
Kojto | 158:b23ee177fd68 | 279 | |
Kojto | 158:b23ee177fd68 | 280 | #endif /* USE_FULL_LL_DRIVER */ |
Kojto | 158:b23ee177fd68 | 281 | |
Kojto | 158:b23ee177fd68 | 282 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
Kojto | 158:b23ee177fd68 | 283 |