Hal Drivers for L4

Dependents:   BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo

Fork of STM32L4xx_HAL_Driver by Senior Design: Sound Monitor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l4xx_ll_gpio.h Source File

stm32l4xx_ll_gpio.h

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