2017-06-03 07:37 PM
There doesn't seem to be any bit definition for the GPIO AFR registers. I can set the PA5 pin alternate function to AF1 using the below code but other registers seems to have bit definitions to use. Am I missing them?
GPIOA->AFR[0] |= 0x00100000;
2017-06-04 02:56 PM
Each pin has a 4-bit mux value, so 4x16 = 64-bits, spread over two 32-bit AFR words
The mux table is in the Data Sheet, see pin table with pins down the side, and AF value across the top.