Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

GPIO Alternate functions configuration functions

GPIO Alternate functions configuration functions
[GPIO_Private_Functions]

GPIO Alternate functions configuration functions. More...

Functions

void GPIO_PinAFConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
 Writes data to the specified GPIO data port.

Detailed Description

GPIO Alternate functions configuration functions.

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


Function Documentation

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

Writes data to the specified GPIO data port.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
GPIO_PinSource,:specifies the pin for the Alternate function. This parameter can be GPIO_PinSourcex where x can be (0..15).
GPIO_AF,:selects 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 513 of file stm32f30x_gpio.c.