General-purpose I/Os (GPIO)
Function Description
Parameters
Return values
Notes
12.3
GPIO Firmware driver defines
12.3.1
GPIO
GPIO
GPIO_Alternate_function_selection_define
#define: GPIO_AF_0 ((uint8_t)0x00)
242/584
Writes data to the specified GPIO data port.
GPIOx : where x can be (A, B, C, D, E or F) 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 :
JTMS-SWDAT, MCO, NJTRST, TRACED, TRACECK.
GPIO_AF_1 :
GPIO_AF_2 :
TIM8, TIM15.
GPIO_AF_3 :
GPIO_AF_4 :
GPIO_AF_5 :
USART4, USART5
GPIO_AF_6 :
TIM8
GPIO_AF_7 :
COMP5_OUT, COMP6_OUT, USART1, USART2,
USART3.
GPIO_AF_8 :
COMP3_OUT, COMP4_OUT, COMP5_OUT,
COMP6_OUT.
GPIO_AF_9 :
GPIO_AF_10 :
TIM4, TIM8, TIM17.
GPIO_AF_11 :
GPIO_AF_12 :
GPIO_AF_14 :
GPIO_AF_15 :
None.
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.
DocID023800 Rev 1
JTCK-SWCLK, JTDI, JTDO/TRACESW0,
OUT, TIM2, TIM15, TIM16, TIM17.
COMP1_OUT, TIM1, TIM2, TIM3, TIM4,
COMP7_OUT, TIM8, TIM15, Touch.
I2C1, I2C2, TIM1, TIM8, TIM16, TIM17.
IR_OUT, I2S2, I2S3, SPI1, SPI2, TIM8,
IR_OUT, I2S2, I2S3, SPI2, SPI3, TIM1,
AOP2_OUT, CAN, COMP3_OUT,
COMP1_OUT, COMP2_OUT,
AOP4_OUT, CAN, TIM1, TIM8, TIM15.
AOP1_OUT, AOP3_OUT, TIM2, TIM3,
TIM1, TIM8.
TIM1.
USBDM, USBDP.
OUT.
UM1581
Need help?
Do you have a question about the STM32F31xx and is the answer not in the manual?