STM32F479xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_ll_gpio.h 00004 * @author MCD Application Team 00005 * @brief Header file of GPIO LL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© Copyright (c) 2017 STMicroelectronics. 00010 * All rights reserved.</center></h2> 00011 * 00012 * This software component is licensed by ST under BSD 3-Clause license, 00013 * the "License"; You may not use this file except in compliance with the 00014 * License. You may obtain a copy of the License at: 00015 * opensource.org/licenses/BSD-3-Clause 00016 * 00017 ****************************************************************************** 00018 */ 00019 00020 /* Define to prevent recursive inclusion -------------------------------------*/ 00021 #ifndef __STM32F4xx_LL_GPIO_H 00022 #define __STM32F4xx_LL_GPIO_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /* Includes ------------------------------------------------------------------*/ 00029 #include "stm32f4xx.h" 00030 00031 /** @addtogroup STM32F4xx_LL_Driver 00032 * @{ 00033 */ 00034 00035 #if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) || defined (GPIOI) || defined (GPIOJ) || defined (GPIOK) 00036 00037 /** @defgroup GPIO_LL GPIO 00038 * @{ 00039 */ 00040 00041 /* Private types -------------------------------------------------------------*/ 00042 /* Private variables ---------------------------------------------------------*/ 00043 /* Private constants ---------------------------------------------------------*/ 00044 /* Private macros ------------------------------------------------------------*/ 00045 #if defined(USE_FULL_LL_DRIVER) 00046 /** @defgroup GPIO_LL_Private_Macros GPIO Private Macros 00047 * @{ 00048 */ 00049 00050 /** 00051 * @} 00052 */ 00053 #endif /*USE_FULL_LL_DRIVER*/ 00054 00055 /* Exported types ------------------------------------------------------------*/ 00056 #if defined(USE_FULL_LL_DRIVER) 00057 /** @defgroup GPIO_LL_ES_INIT GPIO Exported Init structures 00058 * @{ 00059 */ 00060 00061 /** 00062 * @brief LL GPIO Init Structure definition 00063 */ 00064 typedef struct 00065 { 00066 uint32_t Pin; /*!< Specifies the GPIO pins to be configured. 00067 This parameter can be any value of @ref GPIO_LL_EC_PIN */ 00068 00069 uint32_t Mode; /*!< Specifies the operating mode for the selected pins. 00070 This parameter can be a value of @ref GPIO_LL_EC_MODE. 00071 00072 GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinMode().*/ 00073 00074 uint32_t Speed; /*!< Specifies the speed for the selected pins. 00075 This parameter can be a value of @ref GPIO_LL_EC_SPEED. 00076 00077 GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinSpeed().*/ 00078 00079 uint32_t OutputType; /*!< Specifies the operating output type for the selected pins. 00080 This parameter can be a value of @ref GPIO_LL_EC_OUTPUT. 00081 00082 GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinOutputType().*/ 00083 00084 uint32_t Pull; /*!< Specifies the operating Pull-up/Pull down for the selected pins. 00085 This parameter can be a value of @ref GPIO_LL_EC_PULL. 00086 00087 GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/ 00088 00089 uint32_t Alternate; /*!< Specifies the Peripheral to be connected to the selected pins. 00090 This parameter can be a value of @ref GPIO_LL_EC_AF. 00091 00092 GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15().*/ 00093 } LL_GPIO_InitTypeDef; 00094 00095 /** 00096 * @} 00097 */ 00098 #endif /* USE_FULL_LL_DRIVER */ 00099 00100 /* Exported constants --------------------------------------------------------*/ 00101 /** @defgroup GPIO_LL_Exported_Constants GPIO Exported Constants 00102 * @{ 00103 */ 00104 00105 /** @defgroup GPIO_LL_EC_PIN PIN 00106 * @{ 00107 */ 00108 #define LL_GPIO_PIN_0 GPIO_BSRR_BS_0 /*!< Select pin 0 */ 00109 #define LL_GPIO_PIN_1 GPIO_BSRR_BS_1 /*!< Select pin 1 */ 00110 #define LL_GPIO_PIN_2 GPIO_BSRR_BS_2 /*!< Select pin 2 */ 00111 #define LL_GPIO_PIN_3 GPIO_BSRR_BS_3 /*!< Select pin 3 */ 00112 #define LL_GPIO_PIN_4 GPIO_BSRR_BS_4 /*!< Select pin 4 */ 00113 #define LL_GPIO_PIN_5 GPIO_BSRR_BS_5 /*!< Select pin 5 */ 00114 #define LL_GPIO_PIN_6 GPIO_BSRR_BS_6 /*!< Select pin 6 */ 00115 #define LL_GPIO_PIN_7 GPIO_BSRR_BS_7 /*!< Select pin 7 */ 00116 #define LL_GPIO_PIN_8 GPIO_BSRR_BS_8 /*!< Select pin 8 */ 00117 #define LL_GPIO_PIN_9 GPIO_BSRR_BS_9 /*!< Select pin 9 */ 00118 #define LL_GPIO_PIN_10 GPIO_BSRR_BS_10 /*!< Select pin 10 */ 00119 #define LL_GPIO_PIN_11 GPIO_BSRR_BS_11 /*!< Select pin 11 */ 00120 #define LL_GPIO_PIN_12 GPIO_BSRR_BS_12 /*!< Select pin 12 */ 00121 #define LL_GPIO_PIN_13 GPIO_BSRR_BS_13 /*!< Select pin 13 */ 00122 #define LL_GPIO_PIN_14 GPIO_BSRR_BS_14 /*!< Select pin 14 */ 00123 #define LL_GPIO_PIN_15 GPIO_BSRR_BS_15 /*!< Select pin 15 */ 00124 #define LL_GPIO_PIN_ALL (GPIO_BSRR_BS_0 | GPIO_BSRR_BS_1 | GPIO_BSRR_BS_2 | \ 00125 GPIO_BSRR_BS_3 | GPIO_BSRR_BS_4 | GPIO_BSRR_BS_5 | \ 00126 GPIO_BSRR_BS_6 | GPIO_BSRR_BS_7 | GPIO_BSRR_BS_8 | \ 00127 GPIO_BSRR_BS_9 | GPIO_BSRR_BS_10 | GPIO_BSRR_BS_11 | \ 00128 GPIO_BSRR_BS_12 | GPIO_BSRR_BS_13 | GPIO_BSRR_BS_14 | \ 00129 GPIO_BSRR_BS_15) /*!< Select all pins */ 00130 /** 00131 * @} 00132 */ 00133 00134 /** @defgroup GPIO_LL_EC_MODE Mode 00135 * @{ 00136 */ 00137 #define LL_GPIO_MODE_INPUT (0x00000000U) /*!< Select input mode */ 00138 #define LL_GPIO_MODE_OUTPUT GPIO_MODER_MODER0_0 /*!< Select output mode */ 00139 #define LL_GPIO_MODE_ALTERNATE GPIO_MODER_MODER0_1 /*!< Select alternate function mode */ 00140 #define LL_GPIO_MODE_ANALOG GPIO_MODER_MODER0 /*!< Select analog mode */ 00141 /** 00142 * @} 00143 */ 00144 00145 /** @defgroup GPIO_LL_EC_OUTPUT Output Type 00146 * @{ 00147 */ 00148 #define LL_GPIO_OUTPUT_PUSHPULL (0x00000000U) /*!< Select push-pull as output type */ 00149 #define LL_GPIO_OUTPUT_OPENDRAIN GPIO_OTYPER_OT_0 /*!< Select open-drain as output type */ 00150 /** 00151 * @} 00152 */ 00153 00154 /** @defgroup GPIO_LL_EC_SPEED Output Speed 00155 * @{ 00156 */ 00157 #define LL_GPIO_SPEED_FREQ_LOW (0x00000000U) /*!< Select I/O low output speed */ 00158 #define LL_GPIO_SPEED_FREQ_MEDIUM GPIO_OSPEEDER_OSPEEDR0_0 /*!< Select I/O medium output speed */ 00159 #define LL_GPIO_SPEED_FREQ_HIGH GPIO_OSPEEDER_OSPEEDR0_1 /*!< Select I/O fast output speed */ 00160 #define LL_GPIO_SPEED_FREQ_VERY_HIGH GPIO_OSPEEDER_OSPEEDR0 /*!< Select I/O high output speed */ 00161 /** 00162 * @} 00163 */ 00164 00165 /** @defgroup GPIO_LL_EC_PULL Pull Up Pull Down 00166 * @{ 00167 */ 00168 #define LL_GPIO_PULL_NO (0x00000000U) /*!< Select I/O no pull */ 00169 #define LL_GPIO_PULL_UP GPIO_PUPDR_PUPDR0_0 /*!< Select I/O pull up */ 00170 #define LL_GPIO_PULL_DOWN GPIO_PUPDR_PUPDR0_1 /*!< Select I/O pull down */ 00171 /** 00172 * @} 00173 */ 00174 00175 /** @defgroup GPIO_LL_EC_AF Alternate Function 00176 * @{ 00177 */ 00178 #define LL_GPIO_AF_0 (0x0000000U) /*!< Select alternate function 0 */ 00179 #define LL_GPIO_AF_1 (0x0000001U) /*!< Select alternate function 1 */ 00180 #define LL_GPIO_AF_2 (0x0000002U) /*!< Select alternate function 2 */ 00181 #define LL_GPIO_AF_3 (0x0000003U) /*!< Select alternate function 3 */ 00182 #define LL_GPIO_AF_4 (0x0000004U) /*!< Select alternate function 4 */ 00183 #define LL_GPIO_AF_5 (0x0000005U) /*!< Select alternate function 5 */ 00184 #define LL_GPIO_AF_6 (0x0000006U) /*!< Select alternate function 6 */ 00185 #define LL_GPIO_AF_7 (0x0000007U) /*!< Select alternate function 7 */ 00186 #define LL_GPIO_AF_8 (0x0000008U) /*!< Select alternate function 8 */ 00187 #define LL_GPIO_AF_9 (0x0000009U) /*!< Select alternate function 9 */ 00188 #define LL_GPIO_AF_10 (0x000000AU) /*!< Select alternate function 10 */ 00189 #define LL_GPIO_AF_11 (0x000000BU) /*!< Select alternate function 11 */ 00190 #define LL_GPIO_AF_12 (0x000000CU) /*!< Select alternate function 12 */ 00191 #define LL_GPIO_AF_13 (0x000000DU) /*!< Select alternate function 13 */ 00192 #define LL_GPIO_AF_14 (0x000000EU) /*!< Select alternate function 14 */ 00193 #define LL_GPIO_AF_15 (0x000000FU) /*!< Select alternate function 15 */ 00194 /** 00195 * @} 00196 */ 00197 00198 /** 00199 * @} 00200 */ 00201 00202 /* Exported macro ------------------------------------------------------------*/ 00203 /** @defgroup GPIO_LL_Exported_Macros GPIO Exported Macros 00204 * @{ 00205 */ 00206 00207 /** @defgroup GPIO_LL_EM_WRITE_READ Common Write and read registers Macros 00208 * @{ 00209 */ 00210 00211 /** 00212 * @brief Write a value in GPIO register 00213 * @param __INSTANCE__ GPIO Instance 00214 * @param __REG__ Register to be written 00215 * @param __VALUE__ Value to be written in the register 00216 * @retval None 00217 */ 00218 #define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) 00219 00220 /** 00221 * @brief Read a value in GPIO register 00222 * @param __INSTANCE__ GPIO Instance 00223 * @param __REG__ Register to be read 00224 * @retval Register value 00225 */ 00226 #define LL_GPIO_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) 00227 /** 00228 * @} 00229 */ 00230 00231 /** 00232 * @} 00233 */ 00234 00235 /* Exported functions --------------------------------------------------------*/ 00236 /** @defgroup GPIO_LL_Exported_Functions GPIO Exported Functions 00237 * @{ 00238 */ 00239 00240 /** @defgroup GPIO_LL_EF_Port_Configuration Port Configuration 00241 * @{ 00242 */ 00243 00244 /** 00245 * @brief Configure gpio mode for a dedicated pin on dedicated port. 00246 * @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog. 00247 * @note Warning: only one pin can be passed as parameter. 00248 * @rmtoll MODER MODEy LL_GPIO_SetPinMode 00249 * @param GPIOx GPIO Port 00250 * @param Pin This parameter can be one of the following values: 00251 * @arg @ref LL_GPIO_PIN_0 00252 * @arg @ref LL_GPIO_PIN_1 00253 * @arg @ref LL_GPIO_PIN_2 00254 * @arg @ref LL_GPIO_PIN_3 00255 * @arg @ref LL_GPIO_PIN_4 00256 * @arg @ref LL_GPIO_PIN_5 00257 * @arg @ref LL_GPIO_PIN_6 00258 * @arg @ref LL_GPIO_PIN_7 00259 * @arg @ref LL_GPIO_PIN_8 00260 * @arg @ref LL_GPIO_PIN_9 00261 * @arg @ref LL_GPIO_PIN_10 00262 * @arg @ref LL_GPIO_PIN_11 00263 * @arg @ref LL_GPIO_PIN_12 00264 * @arg @ref LL_GPIO_PIN_13 00265 * @arg @ref LL_GPIO_PIN_14 00266 * @arg @ref LL_GPIO_PIN_15 00267 * @param Mode This parameter can be one of the following values: 00268 * @arg @ref LL_GPIO_MODE_INPUT 00269 * @arg @ref LL_GPIO_MODE_OUTPUT 00270 * @arg @ref LL_GPIO_MODE_ALTERNATE 00271 * @arg @ref LL_GPIO_MODE_ANALOG 00272 * @retval None 00273 */ 00274 __STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode) 00275 { 00276 MODIFY_REG(GPIOx->MODER, (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U)), (Mode << (POSITION_VAL(Pin) * 2U))); 00277 } 00278 00279 /** 00280 * @brief Return gpio mode for a dedicated pin on dedicated port. 00281 * @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog. 00282 * @note Warning: only one pin can be passed as parameter. 00283 * @rmtoll MODER MODEy LL_GPIO_GetPinMode 00284 * @param GPIOx GPIO Port 00285 * @param Pin This parameter can be one of the following values: 00286 * @arg @ref LL_GPIO_PIN_0 00287 * @arg @ref LL_GPIO_PIN_1 00288 * @arg @ref LL_GPIO_PIN_2 00289 * @arg @ref LL_GPIO_PIN_3 00290 * @arg @ref LL_GPIO_PIN_4 00291 * @arg @ref LL_GPIO_PIN_5 00292 * @arg @ref LL_GPIO_PIN_6 00293 * @arg @ref LL_GPIO_PIN_7 00294 * @arg @ref LL_GPIO_PIN_8 00295 * @arg @ref LL_GPIO_PIN_9 00296 * @arg @ref LL_GPIO_PIN_10 00297 * @arg @ref LL_GPIO_PIN_11 00298 * @arg @ref LL_GPIO_PIN_12 00299 * @arg @ref LL_GPIO_PIN_13 00300 * @arg @ref LL_GPIO_PIN_14 00301 * @arg @ref LL_GPIO_PIN_15 00302 * @retval Returned value can be one of the following values: 00303 * @arg @ref LL_GPIO_MODE_INPUT 00304 * @arg @ref LL_GPIO_MODE_OUTPUT 00305 * @arg @ref LL_GPIO_MODE_ALTERNATE 00306 * @arg @ref LL_GPIO_MODE_ANALOG 00307 */ 00308 __STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin) 00309 { 00310 return (uint32_t)(READ_BIT(GPIOx->MODER, 00311 (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U)); 00312 } 00313 00314 /** 00315 * @brief Configure gpio output type for several pins on dedicated port. 00316 * @note Output type as to be set when gpio pin is in output or 00317 * alternate modes. Possible type are Push-pull or Open-drain. 00318 * @rmtoll OTYPER OTy LL_GPIO_SetPinOutputType 00319 * @param GPIOx GPIO Port 00320 * @param PinMask This parameter can be a combination of the following values: 00321 * @arg @ref LL_GPIO_PIN_0 00322 * @arg @ref LL_GPIO_PIN_1 00323 * @arg @ref LL_GPIO_PIN_2 00324 * @arg @ref LL_GPIO_PIN_3 00325 * @arg @ref LL_GPIO_PIN_4 00326 * @arg @ref LL_GPIO_PIN_5 00327 * @arg @ref LL_GPIO_PIN_6 00328 * @arg @ref LL_GPIO_PIN_7 00329 * @arg @ref LL_GPIO_PIN_8 00330 * @arg @ref LL_GPIO_PIN_9 00331 * @arg @ref LL_GPIO_PIN_10 00332 * @arg @ref LL_GPIO_PIN_11 00333 * @arg @ref LL_GPIO_PIN_12 00334 * @arg @ref LL_GPIO_PIN_13 00335 * @arg @ref LL_GPIO_PIN_14 00336 * @arg @ref LL_GPIO_PIN_15 00337 * @arg @ref LL_GPIO_PIN_ALL 00338 * @param OutputType This parameter can be one of the following values: 00339 * @arg @ref LL_GPIO_OUTPUT_PUSHPULL 00340 * @arg @ref LL_GPIO_OUTPUT_OPENDRAIN 00341 * @retval None 00342 */ 00343 __STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType) 00344 { 00345 MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType)); 00346 } 00347 00348 /** 00349 * @brief Return gpio output type for several pins on dedicated port. 00350 * @note Output type as to be set when gpio pin is in output or 00351 * alternate modes. Possible type are Push-pull or Open-drain. 00352 * @note Warning: only one pin can be passed as parameter. 00353 * @rmtoll OTYPER OTy LL_GPIO_GetPinOutputType 00354 * @param GPIOx GPIO Port 00355 * @param Pin This parameter can be one of the following values: 00356 * @arg @ref LL_GPIO_PIN_0 00357 * @arg @ref LL_GPIO_PIN_1 00358 * @arg @ref LL_GPIO_PIN_2 00359 * @arg @ref LL_GPIO_PIN_3 00360 * @arg @ref LL_GPIO_PIN_4 00361 * @arg @ref LL_GPIO_PIN_5 00362 * @arg @ref LL_GPIO_PIN_6 00363 * @arg @ref LL_GPIO_PIN_7 00364 * @arg @ref LL_GPIO_PIN_8 00365 * @arg @ref LL_GPIO_PIN_9 00366 * @arg @ref LL_GPIO_PIN_10 00367 * @arg @ref LL_GPIO_PIN_11 00368 * @arg @ref LL_GPIO_PIN_12 00369 * @arg @ref LL_GPIO_PIN_13 00370 * @arg @ref LL_GPIO_PIN_14 00371 * @arg @ref LL_GPIO_PIN_15 00372 * @arg @ref LL_GPIO_PIN_ALL 00373 * @retval Returned value can be one of the following values: 00374 * @arg @ref LL_GPIO_OUTPUT_PUSHPULL 00375 * @arg @ref LL_GPIO_OUTPUT_OPENDRAIN 00376 */ 00377 __STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin) 00378 { 00379 return (uint32_t)(READ_BIT(GPIOx->OTYPER, Pin) >> POSITION_VAL(Pin)); 00380 } 00381 00382 /** 00383 * @brief Configure gpio speed for a dedicated pin on dedicated port. 00384 * @note I/O speed can be Low, Medium, Fast or High speed. 00385 * @note Warning: only one pin can be passed as parameter. 00386 * @note Refer to datasheet for frequency specifications and the power 00387 * supply and load conditions for each speed. 00388 * @rmtoll OSPEEDR OSPEEDy LL_GPIO_SetPinSpeed 00389 * @param GPIOx GPIO Port 00390 * @param Pin This parameter can be one of the following values: 00391 * @arg @ref LL_GPIO_PIN_0 00392 * @arg @ref LL_GPIO_PIN_1 00393 * @arg @ref LL_GPIO_PIN_2 00394 * @arg @ref LL_GPIO_PIN_3 00395 * @arg @ref LL_GPIO_PIN_4 00396 * @arg @ref LL_GPIO_PIN_5 00397 * @arg @ref LL_GPIO_PIN_6 00398 * @arg @ref LL_GPIO_PIN_7 00399 * @arg @ref LL_GPIO_PIN_8 00400 * @arg @ref LL_GPIO_PIN_9 00401 * @arg @ref LL_GPIO_PIN_10 00402 * @arg @ref LL_GPIO_PIN_11 00403 * @arg @ref LL_GPIO_PIN_12 00404 * @arg @ref LL_GPIO_PIN_13 00405 * @arg @ref LL_GPIO_PIN_14 00406 * @arg @ref LL_GPIO_PIN_15 00407 * @param Speed This parameter can be one of the following values: 00408 * @arg @ref LL_GPIO_SPEED_FREQ_LOW 00409 * @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM 00410 * @arg @ref LL_GPIO_SPEED_FREQ_HIGH 00411 * @arg @ref LL_GPIO_SPEED_FREQ_VERY_HIGH 00412 * @retval None 00413 */ 00414 __STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed) 00415 { 00416 MODIFY_REG(GPIOx->OSPEEDR, (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U)), 00417 (Speed << (POSITION_VAL(Pin) * 2U))); 00418 } 00419 00420 /** 00421 * @brief Return gpio speed for a dedicated pin on dedicated port. 00422 * @note I/O speed can be Low, Medium, Fast or High speed. 00423 * @note Warning: only one pin can be passed as parameter. 00424 * @note Refer to datasheet for frequency specifications and the power 00425 * supply and load conditions for each speed. 00426 * @rmtoll OSPEEDR OSPEEDy LL_GPIO_GetPinSpeed 00427 * @param GPIOx GPIO Port 00428 * @param Pin This parameter can be one of the following values: 00429 * @arg @ref LL_GPIO_PIN_0 00430 * @arg @ref LL_GPIO_PIN_1 00431 * @arg @ref LL_GPIO_PIN_2 00432 * @arg @ref LL_GPIO_PIN_3 00433 * @arg @ref LL_GPIO_PIN_4 00434 * @arg @ref LL_GPIO_PIN_5 00435 * @arg @ref LL_GPIO_PIN_6 00436 * @arg @ref LL_GPIO_PIN_7 00437 * @arg @ref LL_GPIO_PIN_8 00438 * @arg @ref LL_GPIO_PIN_9 00439 * @arg @ref LL_GPIO_PIN_10 00440 * @arg @ref LL_GPIO_PIN_11 00441 * @arg @ref LL_GPIO_PIN_12 00442 * @arg @ref LL_GPIO_PIN_13 00443 * @arg @ref LL_GPIO_PIN_14 00444 * @arg @ref LL_GPIO_PIN_15 00445 * @retval Returned value can be one of the following values: 00446 * @arg @ref LL_GPIO_SPEED_FREQ_LOW 00447 * @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM 00448 * @arg @ref LL_GPIO_SPEED_FREQ_HIGH 00449 * @arg @ref LL_GPIO_SPEED_FREQ_VERY_HIGH 00450 */ 00451 __STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin) 00452 { 00453 return (uint32_t)(READ_BIT(GPIOx->OSPEEDR, 00454 (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U)); 00455 } 00456 00457 /** 00458 * @brief Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port. 00459 * @note Warning: only one pin can be passed as parameter. 00460 * @rmtoll PUPDR PUPDy LL_GPIO_SetPinPull 00461 * @param GPIOx GPIO Port 00462 * @param Pin This parameter can be one of the following values: 00463 * @arg @ref LL_GPIO_PIN_0 00464 * @arg @ref LL_GPIO_PIN_1 00465 * @arg @ref LL_GPIO_PIN_2 00466 * @arg @ref LL_GPIO_PIN_3 00467 * @arg @ref LL_GPIO_PIN_4 00468 * @arg @ref LL_GPIO_PIN_5 00469 * @arg @ref LL_GPIO_PIN_6 00470 * @arg @ref LL_GPIO_PIN_7 00471 * @arg @ref LL_GPIO_PIN_8 00472 * @arg @ref LL_GPIO_PIN_9 00473 * @arg @ref LL_GPIO_PIN_10 00474 * @arg @ref LL_GPIO_PIN_11 00475 * @arg @ref LL_GPIO_PIN_12 00476 * @arg @ref LL_GPIO_PIN_13 00477 * @arg @ref LL_GPIO_PIN_14 00478 * @arg @ref LL_GPIO_PIN_15 00479 * @param Pull This parameter can be one of the following values: 00480 * @arg @ref LL_GPIO_PULL_NO 00481 * @arg @ref LL_GPIO_PULL_UP 00482 * @arg @ref LL_GPIO_PULL_DOWN 00483 * @retval None 00484 */ 00485 __STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull) 00486 { 00487 MODIFY_REG(GPIOx->PUPDR, (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U)), (Pull << (POSITION_VAL(Pin) * 2U))); 00488 } 00489 00490 /** 00491 * @brief Return gpio pull-up or pull-down for a dedicated pin on a dedicated port 00492 * @note Warning: only one pin can be passed as parameter. 00493 * @rmtoll PUPDR PUPDy LL_GPIO_GetPinPull 00494 * @param GPIOx GPIO Port 00495 * @param Pin This parameter can be one of the following values: 00496 * @arg @ref LL_GPIO_PIN_0 00497 * @arg @ref LL_GPIO_PIN_1 00498 * @arg @ref LL_GPIO_PIN_2 00499 * @arg @ref LL_GPIO_PIN_3 00500 * @arg @ref LL_GPIO_PIN_4 00501 * @arg @ref LL_GPIO_PIN_5 00502 * @arg @ref LL_GPIO_PIN_6 00503 * @arg @ref LL_GPIO_PIN_7 00504 * @arg @ref LL_GPIO_PIN_8 00505 * @arg @ref LL_GPIO_PIN_9 00506 * @arg @ref LL_GPIO_PIN_10 00507 * @arg @ref LL_GPIO_PIN_11 00508 * @arg @ref LL_GPIO_PIN_12 00509 * @arg @ref LL_GPIO_PIN_13 00510 * @arg @ref LL_GPIO_PIN_14 00511 * @arg @ref LL_GPIO_PIN_15 00512 * @retval Returned value can be one of the following values: 00513 * @arg @ref LL_GPIO_PULL_NO 00514 * @arg @ref LL_GPIO_PULL_UP 00515 * @arg @ref LL_GPIO_PULL_DOWN 00516 */ 00517 __STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin) 00518 { 00519 return (uint32_t)(READ_BIT(GPIOx->PUPDR, 00520 (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U)); 00521 } 00522 00523 /** 00524 * @brief Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. 00525 * @note Possible values are from AF0 to AF15 depending on target. 00526 * @note Warning: only one pin can be passed as parameter. 00527 * @rmtoll AFRL AFSELy LL_GPIO_SetAFPin_0_7 00528 * @param GPIOx GPIO Port 00529 * @param Pin This parameter can be one of the following values: 00530 * @arg @ref LL_GPIO_PIN_0 00531 * @arg @ref LL_GPIO_PIN_1 00532 * @arg @ref LL_GPIO_PIN_2 00533 * @arg @ref LL_GPIO_PIN_3 00534 * @arg @ref LL_GPIO_PIN_4 00535 * @arg @ref LL_GPIO_PIN_5 00536 * @arg @ref LL_GPIO_PIN_6 00537 * @arg @ref LL_GPIO_PIN_7 00538 * @param Alternate This parameter can be one of the following values: 00539 * @arg @ref LL_GPIO_AF_0 00540 * @arg @ref LL_GPIO_AF_1 00541 * @arg @ref LL_GPIO_AF_2 00542 * @arg @ref LL_GPIO_AF_3 00543 * @arg @ref LL_GPIO_AF_4 00544 * @arg @ref LL_GPIO_AF_5 00545 * @arg @ref LL_GPIO_AF_6 00546 * @arg @ref LL_GPIO_AF_7 00547 * @arg @ref LL_GPIO_AF_8 00548 * @arg @ref LL_GPIO_AF_9 00549 * @arg @ref LL_GPIO_AF_10 00550 * @arg @ref LL_GPIO_AF_11 00551 * @arg @ref LL_GPIO_AF_12 00552 * @arg @ref LL_GPIO_AF_13 00553 * @arg @ref LL_GPIO_AF_14 00554 * @arg @ref LL_GPIO_AF_15 00555 * @retval None 00556 */ 00557 __STATIC_INLINE void LL_GPIO_SetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate) 00558 { 00559 MODIFY_REG(GPIOx->AFR[0], (GPIO_AFRL_AFSEL0 << (POSITION_VAL(Pin) * 4U)), 00560 (Alternate << (POSITION_VAL(Pin) * 4U))); 00561 } 00562 00563 /** 00564 * @brief Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. 00565 * @rmtoll AFRL AFSELy LL_GPIO_GetAFPin_0_7 00566 * @param GPIOx GPIO Port 00567 * @param Pin This parameter can be one of the following values: 00568 * @arg @ref LL_GPIO_PIN_0 00569 * @arg @ref LL_GPIO_PIN_1 00570 * @arg @ref LL_GPIO_PIN_2 00571 * @arg @ref LL_GPIO_PIN_3 00572 * @arg @ref LL_GPIO_PIN_4 00573 * @arg @ref LL_GPIO_PIN_5 00574 * @arg @ref LL_GPIO_PIN_6 00575 * @arg @ref LL_GPIO_PIN_7 00576 * @retval Returned value can be one of the following values: 00577 * @arg @ref LL_GPIO_AF_0 00578 * @arg @ref LL_GPIO_AF_1 00579 * @arg @ref LL_GPIO_AF_2 00580 * @arg @ref LL_GPIO_AF_3 00581 * @arg @ref LL_GPIO_AF_4 00582 * @arg @ref LL_GPIO_AF_5 00583 * @arg @ref LL_GPIO_AF_6 00584 * @arg @ref LL_GPIO_AF_7 00585 * @arg @ref LL_GPIO_AF_8 00586 * @arg @ref LL_GPIO_AF_9 00587 * @arg @ref LL_GPIO_AF_10 00588 * @arg @ref LL_GPIO_AF_11 00589 * @arg @ref LL_GPIO_AF_12 00590 * @arg @ref LL_GPIO_AF_13 00591 * @arg @ref LL_GPIO_AF_14 00592 * @arg @ref LL_GPIO_AF_15 00593 */ 00594 __STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin) 00595 { 00596 return (uint32_t)(READ_BIT(GPIOx->AFR[0], 00597 (GPIO_AFRL_AFSEL0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U)); 00598 } 00599 00600 /** 00601 * @brief Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. 00602 * @note Possible values are from AF0 to AF15 depending on target. 00603 * @note Warning: only one pin can be passed as parameter. 00604 * @rmtoll AFRH AFSELy LL_GPIO_SetAFPin_8_15 00605 * @param GPIOx GPIO Port 00606 * @param Pin This parameter can be one of the following values: 00607 * @arg @ref LL_GPIO_PIN_8 00608 * @arg @ref LL_GPIO_PIN_9 00609 * @arg @ref LL_GPIO_PIN_10 00610 * @arg @ref LL_GPIO_PIN_11 00611 * @arg @ref LL_GPIO_PIN_12 00612 * @arg @ref LL_GPIO_PIN_13 00613 * @arg @ref LL_GPIO_PIN_14 00614 * @arg @ref LL_GPIO_PIN_15 00615 * @param Alternate This parameter can be one of the following values: 00616 * @arg @ref LL_GPIO_AF_0 00617 * @arg @ref LL_GPIO_AF_1 00618 * @arg @ref LL_GPIO_AF_2 00619 * @arg @ref LL_GPIO_AF_3 00620 * @arg @ref LL_GPIO_AF_4 00621 * @arg @ref LL_GPIO_AF_5 00622 * @arg @ref LL_GPIO_AF_6 00623 * @arg @ref LL_GPIO_AF_7 00624 * @arg @ref LL_GPIO_AF_8 00625 * @arg @ref LL_GPIO_AF_9 00626 * @arg @ref LL_GPIO_AF_10 00627 * @arg @ref LL_GPIO_AF_11 00628 * @arg @ref LL_GPIO_AF_12 00629 * @arg @ref LL_GPIO_AF_13 00630 * @arg @ref LL_GPIO_AF_14 00631 * @arg @ref LL_GPIO_AF_15 00632 * @retval None 00633 */ 00634 __STATIC_INLINE void LL_GPIO_SetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate) 00635 { 00636 MODIFY_REG(GPIOx->AFR[1], (GPIO_AFRH_AFSEL8 << (POSITION_VAL(Pin >> 8U) * 4U)), 00637 (Alternate << (POSITION_VAL(Pin >> 8U) * 4U))); 00638 } 00639 00640 /** 00641 * @brief Return gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. 00642 * @note Possible values are from AF0 to AF15 depending on target. 00643 * @rmtoll AFRH AFSELy LL_GPIO_GetAFPin_8_15 00644 * @param GPIOx GPIO Port 00645 * @param Pin This parameter can be one of the following values: 00646 * @arg @ref LL_GPIO_PIN_8 00647 * @arg @ref LL_GPIO_PIN_9 00648 * @arg @ref LL_GPIO_PIN_10 00649 * @arg @ref LL_GPIO_PIN_11 00650 * @arg @ref LL_GPIO_PIN_12 00651 * @arg @ref LL_GPIO_PIN_13 00652 * @arg @ref LL_GPIO_PIN_14 00653 * @arg @ref LL_GPIO_PIN_15 00654 * @retval Returned value can be one of the following values: 00655 * @arg @ref LL_GPIO_AF_0 00656 * @arg @ref LL_GPIO_AF_1 00657 * @arg @ref LL_GPIO_AF_2 00658 * @arg @ref LL_GPIO_AF_3 00659 * @arg @ref LL_GPIO_AF_4 00660 * @arg @ref LL_GPIO_AF_5 00661 * @arg @ref LL_GPIO_AF_6 00662 * @arg @ref LL_GPIO_AF_7 00663 * @arg @ref LL_GPIO_AF_8 00664 * @arg @ref LL_GPIO_AF_9 00665 * @arg @ref LL_GPIO_AF_10 00666 * @arg @ref LL_GPIO_AF_11 00667 * @arg @ref LL_GPIO_AF_12 00668 * @arg @ref LL_GPIO_AF_13 00669 * @arg @ref LL_GPIO_AF_14 00670 * @arg @ref LL_GPIO_AF_15 00671 */ 00672 __STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin) 00673 { 00674 return (uint32_t)(READ_BIT(GPIOx->AFR[1], 00675 (GPIO_AFRH_AFSEL8 << (POSITION_VAL(Pin >> 8U) * 4U))) >> (POSITION_VAL(Pin >> 8U) * 4U)); 00676 } 00677 00678 00679 /** 00680 * @brief Lock configuration of several pins for a dedicated port. 00681 * @note When the lock sequence has been applied on a port bit, the 00682 * value of this port bit can no longer be modified until the 00683 * next reset. 00684 * @note Each lock bit freezes a specific configuration register 00685 * (control and alternate function registers). 00686 * @rmtoll LCKR LCKK LL_GPIO_LockPin 00687 * @param GPIOx GPIO Port 00688 * @param PinMask This parameter can be a combination of the following values: 00689 * @arg @ref LL_GPIO_PIN_0 00690 * @arg @ref LL_GPIO_PIN_1 00691 * @arg @ref LL_GPIO_PIN_2 00692 * @arg @ref LL_GPIO_PIN_3 00693 * @arg @ref LL_GPIO_PIN_4 00694 * @arg @ref LL_GPIO_PIN_5 00695 * @arg @ref LL_GPIO_PIN_6 00696 * @arg @ref LL_GPIO_PIN_7 00697 * @arg @ref LL_GPIO_PIN_8 00698 * @arg @ref LL_GPIO_PIN_9 00699 * @arg @ref LL_GPIO_PIN_10 00700 * @arg @ref LL_GPIO_PIN_11 00701 * @arg @ref LL_GPIO_PIN_12 00702 * @arg @ref LL_GPIO_PIN_13 00703 * @arg @ref LL_GPIO_PIN_14 00704 * @arg @ref LL_GPIO_PIN_15 00705 * @arg @ref LL_GPIO_PIN_ALL 00706 * @retval None 00707 */ 00708 __STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00709 { 00710 __IO uint32_t temp; 00711 WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask); 00712 WRITE_REG(GPIOx->LCKR, PinMask); 00713 WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask); 00714 temp = READ_REG(GPIOx->LCKR); 00715 (void) temp; 00716 } 00717 00718 /** 00719 * @brief Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0. 00720 * @rmtoll LCKR LCKy LL_GPIO_IsPinLocked 00721 * @param GPIOx GPIO Port 00722 * @param PinMask This parameter can be a combination of the following values: 00723 * @arg @ref LL_GPIO_PIN_0 00724 * @arg @ref LL_GPIO_PIN_1 00725 * @arg @ref LL_GPIO_PIN_2 00726 * @arg @ref LL_GPIO_PIN_3 00727 * @arg @ref LL_GPIO_PIN_4 00728 * @arg @ref LL_GPIO_PIN_5 00729 * @arg @ref LL_GPIO_PIN_6 00730 * @arg @ref LL_GPIO_PIN_7 00731 * @arg @ref LL_GPIO_PIN_8 00732 * @arg @ref LL_GPIO_PIN_9 00733 * @arg @ref LL_GPIO_PIN_10 00734 * @arg @ref LL_GPIO_PIN_11 00735 * @arg @ref LL_GPIO_PIN_12 00736 * @arg @ref LL_GPIO_PIN_13 00737 * @arg @ref LL_GPIO_PIN_14 00738 * @arg @ref LL_GPIO_PIN_15 00739 * @arg @ref LL_GPIO_PIN_ALL 00740 * @retval State of bit (1 or 0). 00741 */ 00742 __STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00743 { 00744 return (READ_BIT(GPIOx->LCKR, PinMask) == (PinMask)); 00745 } 00746 00747 /** 00748 * @brief Return 1 if one of the pin of a dedicated port is locked. else return 0. 00749 * @rmtoll LCKR LCKK LL_GPIO_IsAnyPinLocked 00750 * @param GPIOx GPIO Port 00751 * @retval State of bit (1 or 0). 00752 */ 00753 __STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx) 00754 { 00755 return (READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK)); 00756 } 00757 00758 /** 00759 * @} 00760 */ 00761 00762 /** @defgroup GPIO_LL_EF_Data_Access Data Access 00763 * @{ 00764 */ 00765 00766 /** 00767 * @brief Return full input data register value for a dedicated port. 00768 * @rmtoll IDR IDy LL_GPIO_ReadInputPort 00769 * @param GPIOx GPIO Port 00770 * @retval Input data register value of port 00771 */ 00772 __STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx) 00773 { 00774 return (uint32_t)(READ_REG(GPIOx->IDR)); 00775 } 00776 00777 /** 00778 * @brief Return if input data level for several pins of dedicated port is high or low. 00779 * @rmtoll IDR IDy LL_GPIO_IsInputPinSet 00780 * @param GPIOx GPIO Port 00781 * @param PinMask This parameter can be a combination of the following values: 00782 * @arg @ref LL_GPIO_PIN_0 00783 * @arg @ref LL_GPIO_PIN_1 00784 * @arg @ref LL_GPIO_PIN_2 00785 * @arg @ref LL_GPIO_PIN_3 00786 * @arg @ref LL_GPIO_PIN_4 00787 * @arg @ref LL_GPIO_PIN_5 00788 * @arg @ref LL_GPIO_PIN_6 00789 * @arg @ref LL_GPIO_PIN_7 00790 * @arg @ref LL_GPIO_PIN_8 00791 * @arg @ref LL_GPIO_PIN_9 00792 * @arg @ref LL_GPIO_PIN_10 00793 * @arg @ref LL_GPIO_PIN_11 00794 * @arg @ref LL_GPIO_PIN_12 00795 * @arg @ref LL_GPIO_PIN_13 00796 * @arg @ref LL_GPIO_PIN_14 00797 * @arg @ref LL_GPIO_PIN_15 00798 * @arg @ref LL_GPIO_PIN_ALL 00799 * @retval State of bit (1 or 0). 00800 */ 00801 __STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00802 { 00803 return (READ_BIT(GPIOx->IDR, PinMask) == (PinMask)); 00804 } 00805 00806 /** 00807 * @brief Write output data register for the port. 00808 * @rmtoll ODR ODy LL_GPIO_WriteOutputPort 00809 * @param GPIOx GPIO Port 00810 * @param PortValue Level value for each pin of the port 00811 * @retval None 00812 */ 00813 __STATIC_INLINE void LL_GPIO_WriteOutputPort(GPIO_TypeDef *GPIOx, uint32_t PortValue) 00814 { 00815 WRITE_REG(GPIOx->ODR, PortValue); 00816 } 00817 00818 /** 00819 * @brief Return full output data register value for a dedicated port. 00820 * @rmtoll ODR ODy LL_GPIO_ReadOutputPort 00821 * @param GPIOx GPIO Port 00822 * @retval Output data register value of port 00823 */ 00824 __STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx) 00825 { 00826 return (uint32_t)(READ_REG(GPIOx->ODR)); 00827 } 00828 00829 /** 00830 * @brief Return if input data level for several pins of dedicated port is high or low. 00831 * @rmtoll ODR ODy LL_GPIO_IsOutputPinSet 00832 * @param GPIOx GPIO Port 00833 * @param PinMask This parameter can be a combination of the following values: 00834 * @arg @ref LL_GPIO_PIN_0 00835 * @arg @ref LL_GPIO_PIN_1 00836 * @arg @ref LL_GPIO_PIN_2 00837 * @arg @ref LL_GPIO_PIN_3 00838 * @arg @ref LL_GPIO_PIN_4 00839 * @arg @ref LL_GPIO_PIN_5 00840 * @arg @ref LL_GPIO_PIN_6 00841 * @arg @ref LL_GPIO_PIN_7 00842 * @arg @ref LL_GPIO_PIN_8 00843 * @arg @ref LL_GPIO_PIN_9 00844 * @arg @ref LL_GPIO_PIN_10 00845 * @arg @ref LL_GPIO_PIN_11 00846 * @arg @ref LL_GPIO_PIN_12 00847 * @arg @ref LL_GPIO_PIN_13 00848 * @arg @ref LL_GPIO_PIN_14 00849 * @arg @ref LL_GPIO_PIN_15 00850 * @arg @ref LL_GPIO_PIN_ALL 00851 * @retval State of bit (1 or 0). 00852 */ 00853 __STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00854 { 00855 return (READ_BIT(GPIOx->ODR, PinMask) == (PinMask)); 00856 } 00857 00858 /** 00859 * @brief Set several pins to high level on dedicated gpio port. 00860 * @rmtoll BSRR BSy LL_GPIO_SetOutputPin 00861 * @param GPIOx GPIO Port 00862 * @param PinMask This parameter can be a combination of the following values: 00863 * @arg @ref LL_GPIO_PIN_0 00864 * @arg @ref LL_GPIO_PIN_1 00865 * @arg @ref LL_GPIO_PIN_2 00866 * @arg @ref LL_GPIO_PIN_3 00867 * @arg @ref LL_GPIO_PIN_4 00868 * @arg @ref LL_GPIO_PIN_5 00869 * @arg @ref LL_GPIO_PIN_6 00870 * @arg @ref LL_GPIO_PIN_7 00871 * @arg @ref LL_GPIO_PIN_8 00872 * @arg @ref LL_GPIO_PIN_9 00873 * @arg @ref LL_GPIO_PIN_10 00874 * @arg @ref LL_GPIO_PIN_11 00875 * @arg @ref LL_GPIO_PIN_12 00876 * @arg @ref LL_GPIO_PIN_13 00877 * @arg @ref LL_GPIO_PIN_14 00878 * @arg @ref LL_GPIO_PIN_15 00879 * @arg @ref LL_GPIO_PIN_ALL 00880 * @retval None 00881 */ 00882 __STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00883 { 00884 WRITE_REG(GPIOx->BSRR, PinMask); 00885 } 00886 00887 /** 00888 * @brief Set several pins to low level on dedicated gpio port. 00889 * @rmtoll BSRR BRy LL_GPIO_ResetOutputPin 00890 * @param GPIOx GPIO Port 00891 * @param PinMask This parameter can be a combination of the following values: 00892 * @arg @ref LL_GPIO_PIN_0 00893 * @arg @ref LL_GPIO_PIN_1 00894 * @arg @ref LL_GPIO_PIN_2 00895 * @arg @ref LL_GPIO_PIN_3 00896 * @arg @ref LL_GPIO_PIN_4 00897 * @arg @ref LL_GPIO_PIN_5 00898 * @arg @ref LL_GPIO_PIN_6 00899 * @arg @ref LL_GPIO_PIN_7 00900 * @arg @ref LL_GPIO_PIN_8 00901 * @arg @ref LL_GPIO_PIN_9 00902 * @arg @ref LL_GPIO_PIN_10 00903 * @arg @ref LL_GPIO_PIN_11 00904 * @arg @ref LL_GPIO_PIN_12 00905 * @arg @ref LL_GPIO_PIN_13 00906 * @arg @ref LL_GPIO_PIN_14 00907 * @arg @ref LL_GPIO_PIN_15 00908 * @arg @ref LL_GPIO_PIN_ALL 00909 * @retval None 00910 */ 00911 __STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00912 { 00913 WRITE_REG(GPIOx->BSRR, (PinMask << 16)); 00914 } 00915 00916 /** 00917 * @brief Toggle data value for several pin of dedicated port. 00918 * @rmtoll ODR ODy LL_GPIO_TogglePin 00919 * @param GPIOx GPIO Port 00920 * @param PinMask This parameter can be a combination of the following values: 00921 * @arg @ref LL_GPIO_PIN_0 00922 * @arg @ref LL_GPIO_PIN_1 00923 * @arg @ref LL_GPIO_PIN_2 00924 * @arg @ref LL_GPIO_PIN_3 00925 * @arg @ref LL_GPIO_PIN_4 00926 * @arg @ref LL_GPIO_PIN_5 00927 * @arg @ref LL_GPIO_PIN_6 00928 * @arg @ref LL_GPIO_PIN_7 00929 * @arg @ref LL_GPIO_PIN_8 00930 * @arg @ref LL_GPIO_PIN_9 00931 * @arg @ref LL_GPIO_PIN_10 00932 * @arg @ref LL_GPIO_PIN_11 00933 * @arg @ref LL_GPIO_PIN_12 00934 * @arg @ref LL_GPIO_PIN_13 00935 * @arg @ref LL_GPIO_PIN_14 00936 * @arg @ref LL_GPIO_PIN_15 00937 * @arg @ref LL_GPIO_PIN_ALL 00938 * @retval None 00939 */ 00940 __STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask) 00941 { 00942 uint32_t odr = READ_REG(GPIOx->ODR); 00943 WRITE_REG(GPIOx->BSRR, ((odr & PinMask) << 16u) | (~odr & PinMask)); 00944 } 00945 00946 /** 00947 * @} 00948 */ 00949 00950 #if defined(USE_FULL_LL_DRIVER) 00951 /** @defgroup GPIO_LL_EF_Init Initialization and de-initialization functions 00952 * @{ 00953 */ 00954 00955 ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx); 00956 ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct); 00957 void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct); 00958 00959 /** 00960 * @} 00961 */ 00962 #endif /* USE_FULL_LL_DRIVER */ 00963 00964 /** 00965 * @} 00966 */ 00967 00968 /** 00969 * @} 00970 */ 00971 00972 #endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) || defined (GPIOI) || defined (GPIOJ) || defined (GPIOK) */ 00973 /** 00974 * @} 00975 */ 00976 00977 #ifdef __cplusplus 00978 } 00979 #endif 00980 00981 #endif /* __STM32F4xx_LL_GPIO_H */ 00982 00983 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/