STM32F1 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F1 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Groups
GPIO_Exported_Functions

Functions

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

Detailed Description

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
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
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
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
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
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
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
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
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
  • GPIO_Remap_I2C1
  • GPIO_Remap_USART1
  • GPIO_Remap_USART2
  • GPIO_PartialRemap_USART3
  • GPIO_FullRemap_USART3
  • GPIO_PartialRemap_TIM1
  • GPIO_FullRemap_TIM1
  • GPIO_PartialRemap1_TIM2
  • GPIO_PartialRemap2_TIM2
  • GPIO_FullRemap_TIM2
  • GPIO_PartialRemap_TIM3
  • GPIO_FullRemap_TIM3
  • GPIO_Remap_TIM4
  • GPIO_Remap1_CAN1
  • GPIO_Remap2_CAN1
  • GPIO_Remap_PD01
  • GPIO_Remap_TIM5CH4_LSI
  • GPIO_Remap_ADC1_ETRGINJ
  • GPIO_Remap_ADC1_ETRGREG
  • GPIO_Remap_ADC2_ETRGINJ
  • GPIO_Remap_ADC2_ETRGREG
  • GPIO_Remap_ETH
  • GPIO_Remap_CAN2
  • GPIO_Remap_SWJ_NoJTRST
  • GPIO_Remap_SWJ_JTAGDisable
  • GPIO_Remap_SWJ_Disable
  • GPIO_Remap_SPI3
  • GPIO_Remap_TIM2ITR1_PTP_SOF
  • GPIO_Remap_PTP_PPS
  • GPIO_Remap_TIM15
  • GPIO_Remap_TIM16
  • GPIO_Remap_TIM17
  • GPIO_Remap_CEC
  • GPIO_Remap_TIM1_DMA
  • GPIO_Remap_TIM9
  • GPIO_Remap_TIM10
  • GPIO_Remap_TIM11
  • GPIO_Remap_TIM13
  • GPIO_Remap_TIM14
  • GPIO_Remap_FSMC_NADV
Note
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.
Parameters
NewState,:new state of the port pin remapping. This parameter can be: ENABLE or DISABLE.
Return values
None
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
GPIOinput data port value.
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
Theinput port pin value.
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
GPIOoutput data port value.
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
Theoutput port pin value.
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
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
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
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
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