STM32F103xB HAL User Manual
Data Structures | Defines | Functions
stm32f1xx_ll_gpio.h File Reference

Header file of GPIO LL module. More...

#include "stm32f1xx.h"

Go to the source code of this file.

Data Structures

struct  LL_GPIO_InitTypeDef
 LL GPIO Init Structure definition. More...

Defines

#define GPIO_PIN_MASK_POS   8U
#define GPIO_PIN_NB   16U
#define LL_GPIO_PIN_0   ((GPIO_BSRR_BS0 << GPIO_PIN_MASK_POS) | 0x00000001U)
#define LL_GPIO_PIN_1   ((GPIO_BSRR_BS1 << GPIO_PIN_MASK_POS) | 0x00000002U)
#define LL_GPIO_PIN_2   ((GPIO_BSRR_BS2 << GPIO_PIN_MASK_POS) | 0x00000004U)
#define LL_GPIO_PIN_3   ((GPIO_BSRR_BS3 << GPIO_PIN_MASK_POS) | 0x00000008U)
#define LL_GPIO_PIN_4   ((GPIO_BSRR_BS4 << GPIO_PIN_MASK_POS) | 0x00000010U)
#define LL_GPIO_PIN_5   ((GPIO_BSRR_BS5 << GPIO_PIN_MASK_POS) | 0x00000020U)
#define LL_GPIO_PIN_6   ((GPIO_BSRR_BS6 << GPIO_PIN_MASK_POS) | 0x00000040U)
#define LL_GPIO_PIN_7   ((GPIO_BSRR_BS7 << GPIO_PIN_MASK_POS) | 0x00000080U)
#define LL_GPIO_PIN_8   ((GPIO_BSRR_BS8 << GPIO_PIN_MASK_POS) | 0x04000001U)
#define LL_GPIO_PIN_9   ((GPIO_BSRR_BS9 << GPIO_PIN_MASK_POS) | 0x04000002U)
#define LL_GPIO_PIN_10   ((GPIO_BSRR_BS10 << GPIO_PIN_MASK_POS) | 0x04000004U)
#define LL_GPIO_PIN_11   ((GPIO_BSRR_BS11 << GPIO_PIN_MASK_POS) | 0x04000008U)
#define LL_GPIO_PIN_12   ((GPIO_BSRR_BS12 << GPIO_PIN_MASK_POS) | 0x04000010U)
#define LL_GPIO_PIN_13   ((GPIO_BSRR_BS13 << GPIO_PIN_MASK_POS) | 0x04000020U)
#define LL_GPIO_PIN_14   ((GPIO_BSRR_BS14 << GPIO_PIN_MASK_POS) | 0x04000040U)
#define LL_GPIO_PIN_15   ((GPIO_BSRR_BS15 << GPIO_PIN_MASK_POS) | 0x04000080U)
#define LL_GPIO_PIN_ALL
#define LL_GPIO_MODE_ANALOG   0x00000000U
#define LL_GPIO_MODE_FLOATING   GPIO_CRL_CNF0_0
#define LL_GPIO_MODE_INPUT   GPIO_CRL_CNF0_1
#define LL_GPIO_MODE_OUTPUT   GPIO_CRL_MODE0_0
#define LL_GPIO_MODE_ALTERNATE   (GPIO_CRL_CNF0_1 | GPIO_CRL_MODE0_0)
#define LL_GPIO_OUTPUT_PUSHPULL   0x00000000U
#define LL_GPIO_OUTPUT_OPENDRAIN   GPIO_CRL_CNF0_0
#define LL_GPIO_MODE_OUTPUT_10MHz   GPIO_CRL_MODE0_0
#define LL_GPIO_MODE_OUTPUT_2MHz   GPIO_CRL_MODE0_1
#define LL_GPIO_MODE_OUTPUT_50MHz   GPIO_CRL_MODE0
#define LL_GPIO_SPEED_FREQ_LOW   LL_GPIO_MODE_OUTPUT_2MHz
#define LL_GPIO_SPEED_FREQ_MEDIUM   LL_GPIO_MODE_OUTPUT_10MHz
#define LL_GPIO_SPEED_FREQ_HIGH   LL_GPIO_MODE_OUTPUT_50MHz
#define LL_GPIO_PULL_DOWN   0x00000000U
#define LL_GPIO_PULL_UP   GPIO_ODR_ODR0
#define LL_GPIO_AF_EVENTOUT_PIN_0   AFIO_EVCR_PIN_PX0
#define LL_GPIO_AF_EVENTOUT_PIN_1   AFIO_EVCR_PIN_PX1
#define LL_GPIO_AF_EVENTOUT_PIN_2   AFIO_EVCR_PIN_PX2
#define LL_GPIO_AF_EVENTOUT_PIN_3   AFIO_EVCR_PIN_PX3
#define LL_GPIO_AF_EVENTOUT_PIN_4   AFIO_EVCR_PIN_PX4
#define LL_GPIO_AF_EVENTOUT_PIN_5   AFIO_EVCR_PIN_PX5
#define LL_GPIO_AF_EVENTOUT_PIN_6   AFIO_EVCR_PIN_PX6
#define LL_GPIO_AF_EVENTOUT_PIN_7   AFIO_EVCR_PIN_PX7
#define LL_GPIO_AF_EVENTOUT_PIN_8   AFIO_EVCR_PIN_PX8
#define LL_GPIO_AF_EVENTOUT_PIN_9   AFIO_EVCR_PIN_PX9
#define LL_GPIO_AF_EVENTOUT_PIN_10   AFIO_EVCR_PIN_PX10
#define LL_GPIO_AF_EVENTOUT_PIN_11   AFIO_EVCR_PIN_PX11
#define LL_GPIO_AF_EVENTOUT_PIN_12   AFIO_EVCR_PIN_PX12
#define LL_GPIO_AF_EVENTOUT_PIN_13   AFIO_EVCR_PIN_PX13
#define LL_GPIO_AF_EVENTOUT_PIN_14   AFIO_EVCR_PIN_PX14
#define LL_GPIO_AF_EVENTOUT_PIN_15   AFIO_EVCR_PIN_PX15
#define LL_GPIO_AF_EVENTOUT_PORT_A   AFIO_EVCR_PORT_PA
#define LL_GPIO_AF_EVENTOUT_PORT_B   AFIO_EVCR_PORT_PB
#define LL_GPIO_AF_EVENTOUT_PORT_C   AFIO_EVCR_PORT_PC
#define LL_GPIO_AF_EVENTOUT_PORT_D   AFIO_EVCR_PORT_PD
#define LL_GPIO_AF_EVENTOUT_PORT_E   AFIO_EVCR_PORT_PE
#define LL_GPIO_AF_EXTI_PORTA   0U
#define LL_GPIO_AF_EXTI_PORTB   1U
#define LL_GPIO_AF_EXTI_PORTC   2U
#define LL_GPIO_AF_EXTI_PORTD   3U
#define LL_GPIO_AF_EXTI_PORTE   4U
#define LL_GPIO_AF_EXTI_PORTF   5U
#define LL_GPIO_AF_EXTI_PORTG   6U
#define LL_GPIO_AF_EXTI_LINE0   (0x000FU << 16U | 0U)
#define LL_GPIO_AF_EXTI_LINE1   (0x00F0U << 16U | 0U)
#define LL_GPIO_AF_EXTI_LINE2   (0x0F00U << 16U | 0U)
#define LL_GPIO_AF_EXTI_LINE3   (0xF000U << 16U | 0U)
#define LL_GPIO_AF_EXTI_LINE4   (0x000FU << 16U | 1U)
#define LL_GPIO_AF_EXTI_LINE5   (0x00F0U << 16U | 1U)
#define LL_GPIO_AF_EXTI_LINE6   (0x0F00U << 16U | 1U)
#define LL_GPIO_AF_EXTI_LINE7   (0xF000U << 16U | 1U)
#define LL_GPIO_AF_EXTI_LINE8   (0x000FU << 16U | 2U)
#define LL_GPIO_AF_EXTI_LINE9   (0x00F0U << 16U | 2U)
#define LL_GPIO_AF_EXTI_LINE10   (0x0F00U << 16U | 2U)
#define LL_GPIO_AF_EXTI_LINE11   (0xF000U << 16U | 2U)
#define LL_GPIO_AF_EXTI_LINE12   (0x000FU << 16U | 3U)
#define LL_GPIO_AF_EXTI_LINE13   (0x00F0U << 16U | 3U)
#define LL_GPIO_AF_EXTI_LINE14   (0x0F00U << 16U | 3U)
#define LL_GPIO_AF_EXTI_LINE15   (0xF000U << 16U | 3U)
#define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__)   WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
 Write a value in GPIO register.
#define LL_GPIO_ReadReg(__INSTANCE__, __REG__)   READ_REG(__INSTANCE__->__REG__)
 Read a value in GPIO register.

Functions

__STATIC_INLINE void LL_GPIO_SetPinMode (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
 Configure gpio mode for a dedicated pin on dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio mode for a dedicated pin on dedicated port.
__STATIC_INLINE void LL_GPIO_SetPinSpeed (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
 Configure gpio speed for a dedicated pin on dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio speed for a dedicated pin on dedicated port.
__STATIC_INLINE void LL_GPIO_SetPinOutputType (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t OutputType)
 Configure gpio output type for several pins on dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio output type for several pins on dedicated port.
__STATIC_INLINE void LL_GPIO_SetPinPull (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
 Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_GetPinPull (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio pull-up or pull-down for a dedicated pin on a dedicated port.
__STATIC_INLINE void LL_GPIO_LockPin (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Lock configuration of several pins for a dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Return 1 if all pins passed as parameter, of a dedicated port, are locked.
__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked (GPIO_TypeDef *GPIOx)
 Return 1 if one of the pin of a dedicated port is locked.
__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort (GPIO_TypeDef *GPIOx)
 Return full input data register value for a dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Return if input data level for several pins of dedicated port is high or low.
__STATIC_INLINE void LL_GPIO_WriteOutputPort (GPIO_TypeDef *GPIOx, uint32_t PortValue)
 Write output data register for the port.
__STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort (GPIO_TypeDef *GPIOx)
 Return full output data register value for a dedicated port.
__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Return if input data level for several pins of dedicated port is high or low.
__STATIC_INLINE void LL_GPIO_SetOutputPin (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Set several pins to high level on dedicated gpio port.
__STATIC_INLINE void LL_GPIO_ResetOutputPin (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Set several pins to low level on dedicated gpio port.
__STATIC_INLINE void LL_GPIO_TogglePin (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Toggle data value for several pin of dedicated port.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_SPI1 (void)
 Enable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_SPI1 (void)
 Disable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI.
__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_SPI1 (void)
 Check if SPI1 has been remaped or not.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_I2C1 (void)
 Enable the remapping of I2C1 alternate function SCL and SDA.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_I2C1 (void)
 Disable the remapping of I2C1 alternate function SCL and SDA.
__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_I2C1 (void)
 Check if I2C1 has been remaped or not.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_USART1 (void)
 Enable the remapping of USART1 alternate function TX and RX.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART1 (void)
 Disable the remapping of USART1 alternate function TX and RX.
__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_USART1 (void)
 Check if USART1 has been remaped or not.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_USART2 (void)
 Enable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART2 (void)
 Disable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.
__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_USART2 (void)
 Check if USART2 has been remaped or not.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_USART3 (void)
 Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
__STATIC_INLINE void LL_GPIO_AF_RemapPartial_USART3 (void)
 Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART3 (void)
 Disable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM1 (void)
 Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
__STATIC_INLINE void LL_GPIO_AF_RemapPartial_TIM1 (void)
 Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM1 (void)
 Disable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM2 (void)
 Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
__STATIC_INLINE void LL_GPIO_AF_RemapPartial2_TIM2 (void)
 Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
__STATIC_INLINE void LL_GPIO_AF_RemapPartial1_TIM2 (void)
 Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM2 (void)
 Disable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM3 (void)
 Enable the remapping of TIM3 alternate function channels 1 to 4.
__STATIC_INLINE void LL_GPIO_AF_RemapPartial_TIM3 (void)
 Enable the remapping of TIM3 alternate function channels 1 to 4.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM3 (void)
 Disable the remapping of TIM3 alternate function channels 1 to 4.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_TIM4 (void)
 Enable the remapping of TIM4 alternate function channels 1 to 4.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM4 (void)
 Disable the remapping of TIM4 alternate function channels 1 to 4.
__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_TIM4 (void)
 Check if TIM4 has been remaped or not.
__STATIC_INLINE void LL_GPIO_AF_RemapPartial1_CAN1 (void)
 Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
__STATIC_INLINE void LL_GPIO_AF_RemapPartial2_CAN1 (void)
 Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
__STATIC_INLINE void LL_GPIO_AF_RemapPartial3_CAN1 (void)
 Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_PD01 (void)
 Enable the remapping of PD0 and PD1.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_PD01 (void)
 Disable the remapping of PD0 and PD1.
__STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_PD01 (void)
 Check if PD01 has been remaped or not.
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_SWJ (void)
 Enable the Serial wire JTAG configuration.
__STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NONJTRST (void)
 Enable the Serial wire JTAG configuration.
__STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NOJTAG (void)
 Enable the Serial wire JTAG configuration.
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_SWJ (void)
 Disable the Serial wire JTAG configuration.
__STATIC_INLINE void LL_GPIO_AF_ConfigEventout (uint32_t LL_GPIO_PortSource, uint32_t LL_GPIO_PinSource)
 Configures the port and pin on which the EVENTOUT Cortex signal will be connected.
__STATIC_INLINE void LL_GPIO_AF_EnableEventout (void)
 Enables the Event Output.
__STATIC_INLINE void LL_GPIO_AF_DisableEventout (void)
 Disables the Event Output.
__STATIC_INLINE void LL_GPIO_AF_SetEXTISource (uint32_t Port, uint32_t Line)
 Configure source input for the EXTI external interrupt.
__STATIC_INLINE uint32_t LL_GPIO_AF_GetEXTISource (uint32_t Line)
 Get the configured defined for specific EXTI Line.
ErrorStatus LL_GPIO_DeInit (GPIO_TypeDef *GPIOx)
 De-initialize GPIO registers (Registers restored to their default values).
ErrorStatus LL_GPIO_Init (GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct)
 Initialize GPIO registers according to the specified parameters in GPIO_InitStruct.
void LL_GPIO_StructInit (LL_GPIO_InitTypeDef *GPIO_InitStruct)
 Set each LL_GPIO_InitTypeDef field to default value.

Detailed Description

Header file of GPIO LL module.

Author:
MCD Application Team
Attention:

© Copyright (c) 2016 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32f1xx_ll_gpio.h.