Functions

GPIO Alternate functions configuration function. More...

Collaboration diagram for GPIO Alternate functions configuration function:

Functions

void GPIO_PinAFConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
 Changes the mapping of the specified pin. More...
 

Detailed Description

GPIO Alternate functions configuration function.

GPIO Alternate functions configuration functions.

 ===============================================================================
           ##### GPIO Alternate functions configuration function #####
 ===============================================================================  
 ===============================================================================
          ##### GPIO Alternate functions configuration functions #####
 ===============================================================================

Function Documentation

void GPIO_PinAFConfig ( GPIO_TypeDef GPIOx,
uint16_t  GPIO_PinSource,
uint8_t  GPIO_AF 
)

Changes the mapping of the specified pin.

Writes data to the specified GPIO data port.

Parameters
GPIOxwhere x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices.
GPIO_PinSourcespecifies the pin for the Alternate function. This parameter can be GPIO_PinSourcex where x can be (0..15).
GPIO_AFSelectionselects the pin to used as Alternate function. This parameter can be one of the following values:
  • GPIO_AF_RTC_50Hz: Connect RTC_50Hz pin to AF0 (default after reset)
  • GPIO_AF_MCO: Connect MCO pin (MCO1 and MCO2) to AF0 (default after reset)
  • GPIO_AF_TAMPER: Connect TAMPER pins (TAMPER_1 and TAMPER_2) to AF0 (default after reset)
  • GPIO_AF_SWJ: Connect SWJ pins (SWD and JTAG)to AF0 (default after reset)
  • GPIO_AF_TRACE: Connect TRACE pins to AF0 (default after reset)
  • GPIO_AF_TIM1: Connect TIM1 pins to AF1
  • GPIO_AF_TIM2: Connect TIM2 pins to AF1
  • GPIO_AF_TIM3: Connect TIM3 pins to AF2
  • GPIO_AF_TIM4: Connect TIM4 pins to AF2
  • GPIO_AF_TIM5: Connect TIM5 pins to AF2
  • GPIO_AF_TIM8: Connect TIM8 pins to AF3
  • GPIO_AF_TIM9: Connect TIM9 pins to AF3
  • GPIO_AF_TIM10: Connect TIM10 pins to AF3
  • GPIO_AF_TIM11: Connect TIM11 pins to AF3
  • GPIO_AF_I2C1: Connect I2C1 pins to AF4
  • GPIO_AF_I2C2: Connect I2C2 pins to AF4
  • GPIO_AF_I2C3: Connect I2C3 pins to AF4
  • GPIO_AF_SPI1: Connect SPI1 pins to AF5
  • GPIO_AF_SPI2: Connect SPI2/I2S2 pins to AF5
  • GPIO_AF_SPI4: Connect SPI4 pins to AF5
  • GPIO_AF_SPI5: Connect SPI5 pins to AF5
  • GPIO_AF_SPI6: Connect SPI6 pins to AF5
  • GPIO_AF_SAI1: Connect SAI1 pins to AF6 for STM32F42xxx/43xxx devices.
  • GPIO_AF_SPI3: Connect SPI3/I2S3 pins to AF6
  • GPIO_AF_I2S3ext: Connect I2S3ext pins to AF7
  • GPIO_AF_USART1: Connect USART1 pins to AF7
  • GPIO_AF_USART2: Connect USART2 pins to AF7
  • GPIO_AF_USART3: Connect USART3 pins to AF7
  • GPIO_AF_UART4: Connect UART4 pins to AF8
  • GPIO_AF_UART5: Connect UART5 pins to AF8
  • GPIO_AF_USART6: Connect USART6 pins to AF8
  • GPIO_AF_UART7: Connect UART7 pins to AF8
  • GPIO_AF_UART8: Connect UART8 pins to AF8
  • GPIO_AF_CAN1: Connect CAN1 pins to AF9
  • GPIO_AF_CAN2: Connect CAN2 pins to AF9
  • GPIO_AF_TIM12: Connect TIM12 pins to AF9
  • GPIO_AF_TIM13: Connect TIM13 pins to AF9
  • GPIO_AF_TIM14: Connect TIM14 pins to AF9
  • GPIO_AF_OTG_FS: Connect OTG_FS pins to AF10
  • GPIO_AF_OTG_HS: Connect OTG_HS pins to AF10
  • GPIO_AF_ETH: Connect ETHERNET pins to AF11
  • GPIO_AF_FSMC: Connect FSMC pins to AF12
  • GPIO_AF_FMC: Connect FMC pins to AF12 for STM32F42xxx/43xxx devices.
  • GPIO_AF_OTG_HS_FS: Connect OTG HS (configured in FS) pins to AF12
  • GPIO_AF_SDIO: Connect SDIO pins to AF12
  • GPIO_AF_DCMI: Connect DCMI pins to AF13
  • GPIO_AF_LTDC: Connect LTDC pins to AF14 for STM32F429xx/439xx devices.
  • GPIO_AF_EVENTOUT: Connect EVENTOUT pins to AF15
Return values
None
Parameters
GPIOxwhere x can be (A..I) to select the GPIO peripheral for STM32F40xx/41xx and STM32F427x/437x devices.
GPIO_PinSourcespecifies the pin for the Alternate function. This parameter can be GPIO_PinSourcex where x can be (0..15).
GPIO_AFSelectionselects the pin to used as Alternate function. This parameter can be one of the following values:
  • GPIO_AF_RTC_50Hz: Connect RTC_50Hz pin to AF0 (default after reset)
  • GPIO_AF_MCO: Connect MCO pin (MCO1 and MCO2) to AF0 (default after reset)
  • GPIO_AF_TAMPER: Connect TAMPER pins (TAMPER_1 and TAMPER_2) to AF0 (default after reset)
  • GPIO_AF_SWJ: Connect SWJ pins (SWD and JTAG)to AF0 (default after reset)
  • GPIO_AF_TRACE: Connect TRACE pins to AF0 (default after reset)
  • GPIO_AF_TIM1: Connect TIM1 pins to AF1
  • GPIO_AF_TIM2: Connect TIM2 pins to AF1
  • GPIO_AF_TIM3: Connect TIM3 pins to AF2
  • GPIO_AF_TIM4: Connect TIM4 pins to AF2
  • GPIO_AF_TIM5: Connect TIM5 pins to AF2
  • GPIO_AF_TIM8: Connect TIM8 pins to AF3
  • GPIO_AF_TIM9: Connect TIM9 pins to AF3
  • GPIO_AF_TIM10: Connect TIM10 pins to AF3
  • GPIO_AF_TIM11: Connect TIM11 pins to AF3
  • GPIO_AF_I2C1: Connect I2C1 pins to AF4
  • GPIO_AF_I2C2: Connect I2C2 pins to AF4
  • GPIO_AF_I2C3: Connect I2C3 pins to AF4
  • GPIO_AF_SPI1: Connect SPI1 pins to AF5
  • GPIO_AF_SPI2: Connect SPI2/I2S2 pins to AF5
  • GPIO_AF_SPI4: Connect SPI4 pins to AF5
  • GPIO_AF_SPI5: Connect SPI5 pins to AF5
  • GPIO_AF_SPI6: Connect SPI6 pins to AF5
  • GPIO_AF_SPI3: Connect SPI3/I2S3 pins to AF6
  • GPIO_AF_I2S3ext: Connect I2S3ext pins to AF7
  • GPIO_AF_USART1: Connect USART1 pins to AF7
  • GPIO_AF_USART2: Connect USART2 pins to AF7
  • GPIO_AF_USART3: Connect USART3 pins to AF7
  • GPIO_AF_UART4: Connect UART4 pins to AF8
  • GPIO_AF_UART5: Connect UART5 pins to AF8
  • GPIO_AF_USART6: Connect USART6 pins to AF8
  • GPIO_AF_UART7: Connect UART7 pins to AF8
  • GPIO_AF_UART8: Connect UART8 pins to AF8
  • GPIO_AF_CAN1: Connect CAN1 pins to AF9
  • GPIO_AF_CAN2: Connect CAN2 pins to AF9
  • GPIO_AF_TIM12: Connect TIM12 pins to AF9
  • GPIO_AF_TIM13: Connect TIM13 pins to AF9
  • GPIO_AF_TIM14: Connect TIM14 pins to AF9
  • GPIO_AF_OTG_FS: Connect OTG_FS pins to AF10
  • GPIO_AF_OTG_HS: Connect OTG_HS pins to AF10
  • GPIO_AF_ETH: Connect ETHERNET pins to AF11
  • GPIO_AF_FSMC: Connect FSMC pins to AF12
  • GPIO_AF_OTG_HS_FS: Connect OTG HS (configured in FS) pins to AF12
  • GPIO_AF_SDIO: Connect SDIO pins to AF12
  • GPIO_AF_DCMI: Connect DCMI pins to AF13
  • GPIO_AF_EVENTOUT: Connect EVENTOUT pins to AF15
Return values
None
Parameters
GPIOxwhere x can be (A, B, C, D, E or F) to select the GPIO peripheral.
GPIO_PinSourcespecifies the pin for the Alternate function. This parameter can be GPIO_PinSourcex where x can be (0..15).
GPIO_AFselects the pin to be used as Alternate function. This parameter can be one of the following value:
  • GPIO_AF_0: JTCK-SWCLK, JTDI, JTDO/TRACESW0, JTMS-SWDAT, MCO, NJTRST, TRACED, TRACECK.
  • GPIO_AF_1: OUT, TIM2, TIM15, TIM16, TIM17.
  • GPIO_AF_2: COMP1_OUT, TIM1, TIM2, TIM3, TIM4, TIM8, TIM15, TIM16.
  • GPIO_AF_3: COMP7_OUT, TIM8, TIM15, Touch, HRTIM.
  • GPIO_AF_4: I2C1, I2C2, TIM1, TIM8, TIM16, TIM17.
  • GPIO_AF_5: IR_OUT, I2S2, I2S3, SPI1, SPI2, TIM8, USART4, USART5
  • GPIO_AF_6: IR_OUT, I2S2, I2S3, SPI2, SPI3, TIM1, TIM8
  • GPIO_AF_7: AOP2_OUT, CAN, COMP3_OUT, COMP5_OUT, COMP6_OUT, USART1, USART2, USART3.
  • GPIO_AF_8: COMP1_OUT, COMP2_OUT, COMP3_OUT, COMP4_OUT, COMP5_OUT, COMP6_OUT.
  • GPIO_AF_9: AOP4_OUT, CAN, TIM1, TIM8, TIM15.
  • GPIO_AF_10: AOP1_OUT, AOP3_OUT, TIM2, TIM3, TIM4, TIM8, TIM17.
  • GPIO_AF_11: TIM1, TIM8.
  • GPIO_AF_12: TIM1, HRTIM.
  • GPIO_AF_13: HRTIM, AOP2_OUT.
  • GPIO_AF_14: USBDM, USBDP.
  • GPIO_AF_15: OUT.
Note
The pin should already been configured in Alternate Function mode(AF) using GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AF
Refer to the Alternate function mapping table in the device datasheet for the detailed mapping of the system and peripherals alternate function I/O pins.
Return values
None

Definition at line 579 of file CMSIS/CM4/DeviceSupport/ST/STM32F4xx/stm32f4xx_gpio.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:54