GPIO_Private_Functions
[GPIO]

Functions

void GPIO_AFIODeInit (void)
 Deinitializes the Alternate Functions (remap, event control and EXTI configuration) registers to their default reset values.
void GPIO_DeInit (GPIO_TypeDef *GPIOx)
 Deinitializes the GPIOx peripheral registers to their default reset values.
void GPIO_ETH_MediaInterfaceConfig (uint32_t GPIO_ETH_MediaInterface)
 Selects the Ethernet media interface.
void GPIO_EventOutputCmd (FunctionalState NewState)
 Enables or disables the Event Output.
void GPIO_EventOutputConfig (uint8_t GPIO_PortSource, uint8_t GPIO_PinSource)
 Selects the GPIO pin used as Event output.
void GPIO_EXTILineConfig (uint8_t GPIO_PortSource, uint8_t GPIO_PinSource)
 Selects the GPIO pin used as EXTI Line.
void GPIO_Init (GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_InitStruct)
 Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct.
void GPIO_PinLockConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Locks GPIO Pins configuration registers.
void GPIO_PinRemapConfig (uint32_t GPIO_Remap, FunctionalState NewState)
 Changes the mapping of the specified pin.
uint16_t GPIO_ReadInputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO input data port.
uint8_t GPIO_ReadInputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Reads the specified input port pin.
uint16_t GPIO_ReadOutputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO output data port.
uint8_t GPIO_ReadOutputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Reads the specified output data port bit.
void GPIO_ResetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Clears the selected data port bits.
void GPIO_SetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Sets the selected data port bits.
void GPIO_StructInit (GPIO_InitTypeDef *GPIO_InitStruct)
 Fills each GPIO_InitStruct member with its default value.
void GPIO_Write (GPIO_TypeDef *GPIOx, uint16_t PortVal)
 Writes data to the specified GPIO data port.
void GPIO_WriteBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
 Sets or clears the selected data port bit.

Function Documentation

void GPIO_AFIODeInit ( void   ) 

Deinitializes the Alternate Functions (remap, event control and EXTI configuration) registers to their default reset values.

Parameters:
None 
Return values:
None 

Definition at line 158 of file stm32f10x_gpio.c.

References DISABLE, ENABLE, RCC_APB2Periph_AFIO, and RCC_APB2PeriphResetCmd().

void GPIO_DeInit ( GPIO_TypeDef GPIOx  ) 

Deinitializes the GPIOx peripheral registers to their default reset values.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
Return values:
None 

Definition at line 107 of file stm32f10x_gpio.c.

References assert_param, DISABLE, ENABLE, GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, IS_GPIO_ALL_PERIPH, RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB, RCC_APB2Periph_GPIOC, RCC_APB2Periph_GPIOD, RCC_APB2Periph_GPIOE, RCC_APB2Periph_GPIOF, RCC_APB2Periph_GPIOG, and RCC_APB2PeriphResetCmd().

void GPIO_ETH_MediaInterfaceConfig ( uint32_t  GPIO_ETH_MediaInterface  ) 

Selects the Ethernet media interface.

Note:
This function applies only to STM32 Connectivity line devices.
Parameters:
GPIO_ETH_MediaInterface,: specifies the Media Interface mode. This parameter can be one of the following values:

  • GPIO_ETH_MediaInterface_MII: MII mode
  • GPIO_ETH_MediaInterface_RMII: RMII mode
Return values:
None 

Definition at line 627 of file stm32f10x_gpio.c.

References assert_param, IS_GPIO_ETH_MEDIA_INTERFACE, and MAPR_MII_RMII_SEL_BB.

void GPIO_EventOutputCmd ( FunctionalState  NewState  ) 

Enables or disables the Event Output.

Parameters:
NewState,: new state of the Event output. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 482 of file stm32f10x_gpio.c.

References assert_param, EVCR_EVOE_BB, and IS_FUNCTIONAL_STATE.

void GPIO_EventOutputConfig ( uint8_t  GPIO_PortSource,
uint8_t  GPIO_PinSource 
)

Selects the GPIO pin used as Event output.

Parameters:
GPIO_PortSource,: selects the GPIO port to be used as source for Event output. This parameter can be GPIO_PortSourceGPIOx where x can be (A..E).
GPIO_PinSource,: specifies the pin for the Event output. This parameter can be GPIO_PinSourcex where x can be (0..15).
Return values:
None 

Definition at line 461 of file stm32f10x_gpio.c.

References AFIO, assert_param, EVCR_PORTPINCONFIG_MASK, IS_GPIO_EVENTOUT_PORT_SOURCE, and IS_GPIO_PIN_SOURCE.

void GPIO_EXTILineConfig ( uint8_t  GPIO_PortSource,
uint8_t  GPIO_PinSource 
)

Selects the GPIO pin used as EXTI Line.

Parameters:
GPIO_PortSource,: selects the GPIO port to be used as source for EXTI lines. This parameter can be GPIO_PortSourceGPIOx where x can be (A..G).
GPIO_PinSource,: specifies the EXTI line to be configured. This parameter can be GPIO_PinSourcex where x can be (0..15).
Return values:
None 

Definition at line 606 of file stm32f10x_gpio.c.

References AFIO, assert_param, IS_GPIO_EXTI_PORT_SOURCE, and IS_GPIO_PIN_SOURCE.

Referenced by EXTI_Configuration(), HDMI_CEC_CommandCallBack(), IOE_EXTI_Config(), IOE_GPIO_Config(), and STM_EVAL_PBInit().

void GPIO_Init ( GPIO_TypeDef GPIOx,
GPIO_InitTypeDef GPIO_InitStruct 
)

Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_InitStruct,: pointer to a GPIO_InitTypeDef structure that contains the configuration information for the specified GPIO peripheral.
Return values:
None 

Definition at line 172 of file stm32f10x_gpio.c.

References assert_param, GPIO_TypeDef::BRR, GPIO_TypeDef::BSRR, GPIO_TypeDef::CRH, GPIO_TypeDef::CRL, GPIO_InitTypeDef::GPIO_Mode, GPIO_Mode_IPD, GPIO_Mode_IPU, GPIO_InitTypeDef::GPIO_Pin, GPIO_InitTypeDef::GPIO_Speed, IS_GPIO_ALL_PERIPH, IS_GPIO_MODE, IS_GPIO_PIN, and IS_GPIO_SPEED.

Referenced by CAN_Config(), GPIO_Configuration(), HDMI_CEC_Init(), IOE_EXTI_Config(), IOE_GPIO_Config(), LCD_CtrlLinesConfig(), LCD_DeInit(), LCD_SPIConfig(), LM75_LowLevel_DeInit(), LM75_LowLevel_Init(), main(), NAND_Init(), NOR_Init(), OneNAND_Init(), SD_LowLevel_DeInit(), SD_LowLevel_Init(), sEE_LowLevel_DeInit(), sEE_LowLevel_Init(), sFLASH_LowLevel_DeInit(), sFLASH_LowLevel_Init(), SRAM_Init(), STM_EVAL_COMInit(), STM_EVAL_LEDInit(), and STM_EVAL_PBInit().

void GPIO_PinLockConfig ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_Pin 
)

Locks GPIO Pins configuration registers.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_Pin,: specifies the port bit to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
Return values:
None 

Definition at line 431 of file stm32f10x_gpio.c.

References assert_param, IS_GPIO_ALL_PERIPH, IS_GPIO_PIN, and GPIO_TypeDef::LCKR.

void GPIO_PinRemapConfig ( uint32_t  GPIO_Remap,
FunctionalState  NewState 
)

Changes the mapping of the specified pin.

Parameters:
GPIO_Remap,: selects the pin to remap. This parameter can be one of the following values:

  • GPIO_Remap_SPI1 : SPI1 Alternate Function mapping
  • GPIO_Remap_I2C1 : I2C1 Alternate Function mapping
  • GPIO_Remap_USART1 : USART1 Alternate Function mapping
  • GPIO_Remap_USART2 : USART2 Alternate Function mapping
  • GPIO_PartialRemap_USART3 : USART3 Partial Alternate Function mapping
  • GPIO_FullRemap_USART3 : USART3 Full Alternate Function mapping
  • GPIO_PartialRemap_TIM1 : TIM1 Partial Alternate Function mapping
  • GPIO_FullRemap_TIM1 : TIM1 Full Alternate Function mapping
  • GPIO_PartialRemap1_TIM2 : TIM2 Partial1 Alternate Function mapping
  • GPIO_PartialRemap2_TIM2 : TIM2 Partial2 Alternate Function mapping
  • GPIO_FullRemap_TIM2 : TIM2 Full Alternate Function mapping
  • GPIO_PartialRemap_TIM3 : TIM3 Partial Alternate Function mapping
  • GPIO_FullRemap_TIM3 : TIM3 Full Alternate Function mapping
  • GPIO_Remap_TIM4 : TIM4 Alternate Function mapping
  • GPIO_Remap1_CAN1 : CAN1 Alternate Function mapping
  • GPIO_Remap2_CAN1 : CAN1 Alternate Function mapping
  • GPIO_Remap_PD01 : PD01 Alternate Function mapping
  • GPIO_Remap_TIM5CH4_LSI : LSI connected to TIM5 Channel4 input capture for calibration
  • GPIO_Remap_ADC1_ETRGINJ : ADC1 External Trigger Injected Conversion remapping
  • GPIO_Remap_ADC1_ETRGREG : ADC1 External Trigger Regular Conversion remapping
  • GPIO_Remap_ADC2_ETRGINJ : ADC2 External Trigger Injected Conversion remapping
  • GPIO_Remap_ADC2_ETRGREG : ADC2 External Trigger Regular Conversion remapping
  • GPIO_Remap_ETH : Ethernet remapping (only for Connectivity line devices)
  • GPIO_Remap_CAN2 : CAN2 remapping (only for Connectivity line devices)
  • GPIO_Remap_SWJ_NoJTRST : Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST
  • GPIO_Remap_SWJ_JTAGDisable : JTAG-DP Disabled and SW-DP Enabled
  • GPIO_Remap_SWJ_Disable : Full SWJ Disabled (JTAG-DP + SW-DP)
  • GPIO_Remap_SPI3 : SPI3/I2S3 Alternate Function mapping (only for Connectivity line devices)
  • GPIO_Remap_TIM2ITR1_PTP_SOF : Ethernet PTP output or USB OTG SOF (Start of Frame) connected to TIM2 Internal Trigger 1 for calibration (only for Connectivity line devices) If the GPIO_Remap_TIM2ITR1_PTP_SOF is enabled the TIM2 ITR1 is connected to Ethernet PTP output. When Reset TIM2 ITR1 is connected to USB OTG SOF output.
  • GPIO_Remap_PTP_PPS : Ethernet MAC PPS_PTS output on PB05 (only for Connectivity line devices)
  • GPIO_Remap_TIM15 : TIM15 Alternate Function mapping (only for Value line devices)
  • GPIO_Remap_TIM16 : TIM16 Alternate Function mapping (only for Value line devices)
  • GPIO_Remap_TIM17 : TIM17 Alternate Function mapping (only for Value line devices)
  • GPIO_Remap_CEC : CEC Alternate Function mapping (only for Value line devices)
  • GPIO_Remap_TIM1_DMA : TIM1 DMA requests mapping (only for Value line devices)
  • GPIO_Remap_TIM9 : TIM9 Alternate Function mapping (only for XL-density devices)
  • GPIO_Remap_TIM10 : TIM10 Alternate Function mapping (only for XL-density devices)
  • GPIO_Remap_TIM11 : TIM11 Alternate Function mapping (only for XL-density devices)
  • GPIO_Remap_TIM13 : TIM13 Alternate Function mapping (only for High density Value line and XL-density devices)
  • GPIO_Remap_TIM14 : TIM14 Alternate Function mapping (only for High density Value line and XL-density devices)
  • GPIO_Remap_FSMC_NADV : FSMC_NADV Alternate Function mapping (only for High density Value line and XL-density devices)
  • GPIO_Remap_TIM67_DAC_DMA : TIM6/TIM7 and DAC DMA requests remapping (only for High density Value line devices)
  • GPIO_Remap_TIM12 : TIM12 Alternate Function mapping (only for High density Value line devices)
  • GPIO_Remap_MISC : Miscellaneous Remap (DMA2 Channel5 Position and DAC Trigger remapping, only for High density Value line devices)
NewState,: new state of the port pin remapping. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 546 of file stm32f10x_gpio.c.

References AFIO, assert_param, DBGAFR_LOCATION_MASK, DBGAFR_NUMBITS_MASK, DBGAFR_POSITION_MASK, DBGAFR_SWJCFG_MASK, DISABLE, IS_FUNCTIONAL_STATE, IS_GPIO_REMAP, and LSB_MASK.

Referenced by CAN_Config(), GPIO_Configuration(), LCD_DeInit(), LCD_SPIConfig(), main(), SD_LowLevel_DeInit(), SD_LowLevel_Init(), and STM_EVAL_COMInit().

uint16_t GPIO_ReadInputData ( GPIO_TypeDef GPIOx  ) 

Reads the specified GPIO input data port.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
Return values:
GPIO input data port value.

Definition at line 304 of file stm32f10x_gpio.c.

References assert_param, GPIO_TypeDef::IDR, and IS_GPIO_ALL_PERIPH.

Referenced by SD_Detect().

uint8_t GPIO_ReadInputDataBit ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_Pin 
)

Reads the specified input port pin.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_Pin,: specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..15).
Return values:
The input port pin value.

Definition at line 280 of file stm32f10x_gpio.c.

References assert_param, Bit_RESET, Bit_SET, GPIO_TypeDef::IDR, IS_GET_GPIO_PIN, and IS_GPIO_ALL_PERIPH.

Referenced by NOR_GetStatus(), PhysicalAddressDiscovery(), SD_Detect(), and STM_EVAL_PBGetState().

uint16_t GPIO_ReadOutputData ( GPIO_TypeDef GPIOx  ) 

Reads the specified GPIO output data port.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
Return values:
GPIO output data port value.

Definition at line 342 of file stm32f10x_gpio.c.

References assert_param, IS_GPIO_ALL_PERIPH, and GPIO_TypeDef::ODR.

uint8_t GPIO_ReadOutputDataBit ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_Pin 
)

Reads the specified output data port bit.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_Pin,: specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..15).
Return values:
The output port pin value.

Definition at line 319 of file stm32f10x_gpio.c.

References assert_param, Bit_RESET, Bit_SET, IS_GET_GPIO_PIN, IS_GPIO_ALL_PERIPH, and GPIO_TypeDef::ODR.

Referenced by main(), and TIM2_IRQHandler().

void GPIO_ResetBits ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_Pin 
)

Clears the selected data port bits.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_Pin,: specifies the port bits to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
Return values:
None 

Definition at line 373 of file stm32f10x_gpio.c.

References assert_param, GPIO_TypeDef::BRR, IS_GPIO_ALL_PERIPH, and IS_GPIO_PIN.

Referenced by EXTI15_10_IRQHandler(), EXTI9_5_IRQHandler(), and TIM2_IRQHandler().

void GPIO_SetBits ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_Pin 
)

Sets the selected data port bits.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_Pin,: specifies the port bits to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
Return values:
None 

Definition at line 357 of file stm32f10x_gpio.c.

References assert_param, GPIO_TypeDef::BSRR, IS_GPIO_ALL_PERIPH, and IS_GPIO_PIN.

Referenced by EXTI15_10_IRQHandler(), EXTI9_5_IRQHandler(), GPIO_Configuration(), and main().

void GPIO_StructInit ( GPIO_InitTypeDef GPIO_InitStruct  ) 

Fills each GPIO_InitStruct member with its default value.

Parameters:
GPIO_InitStruct : pointer to a GPIO_InitTypeDef structure which will be initialized.
Return values:
None 

Definition at line 265 of file stm32f10x_gpio.c.

References GPIO_InitTypeDef::GPIO_Mode, GPIO_Mode_IN_FLOATING, GPIO_InitTypeDef::GPIO_Pin, GPIO_Pin_All, GPIO_InitTypeDef::GPIO_Speed, and GPIO_Speed_2MHz.

void GPIO_Write ( GPIO_TypeDef GPIOx,
uint16_t  PortVal 
)

Writes data to the specified GPIO data port.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
PortVal,: specifies the value to be written to the port output data register.
Return values:
None 

Definition at line 416 of file stm32f10x_gpio.c.

References assert_param, IS_GPIO_ALL_PERIPH, and GPIO_TypeDef::ODR.

void GPIO_WriteBit ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_Pin,
BitAction  BitVal 
)

Sets or clears the selected data port bit.

Parameters:
GPIOx,: where x can be (A..G) to select the GPIO peripheral.
GPIO_Pin,: specifies the port bit to be written. This parameter can be one of GPIO_Pin_x where x can be (0..15).
BitVal,: specifies the value to be written to the selected bit. This parameter can be one of the BitAction enum values:

  • Bit_RESET: to clear the port pin
  • Bit_SET: to set the port pin
Return values:
None 

Definition at line 393 of file stm32f10x_gpio.c.

References assert_param, Bit_RESET, GPIO_TypeDef::BRR, GPIO_TypeDef::BSRR, IS_GET_GPIO_PIN, IS_GPIO_ALL_PERIPH, and IS_GPIO_BIT_ACTION.

Referenced by ADC1_2_IRQHandler(), LCD_CtrlLinesWrite(), main(), and TIM2_IRQHandler().

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32