[Solved] What is the difference between GPIO_AF5_SPI2, GPIO_AF6_SPI2 and GPIO_AF7_SPI2 on the stm32h743zi?
There are multiple alternating functions for one peripherals. Why and what is the difference?
There are multiple alternating functions for one peripherals. Why and what is the difference?
Angus,
You have to look at the specific entries of the "Port x alternate functions" tables in the datasheet (that Clive mentioned) in order to know the relation among SPI functions, the GPIO ports and pins that implement them, and the corresponding AF codes.
AF codes don't have a special meaning by themselves. They are just codes you use to configure the GPIO pins.
The STM32H743xx can use, for example, five GPIO pins as SPI2 slave selection (NSS) : PA11, PB4, PB9, PB12 and PI0. All alternate function codes are AF5, except for one: AF7 is used for PB4.
Any given GPIO pin can be used for many different functions under different AF codes. That is the kind of information one gets from the tables mentioned above.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.