I'm reading the ref manual, datasheet and programming manual of STM32F401CE and run across this:
GPIO port mode register (GPIOx_MODER) (x = A..E and H) ------------------------------------------> A..E and H correspond to ports not pins, right?
and
Bits 2y:2y+1 MODERy[1:0]: Port x configuration bits (y = 0..15)
These bits are written by software to configure the I/O direction mode. ------------------------------------------> this also suggests a per port function, where each port has this range of registers.
So, when I am planning which pins to use as alt functions, Ineed to consider that all of the ppins for a port range change to one alt function, not individually, right?
Thanks for confirming my reading of the manuals.
[STM32F401CE/G30TH] alt functions
[STM32F401CE/G30TH] alt functions
John Griessen blog.kitmatic.com
Re: [STM32F401CE/G30TH] alt functions
Each port has a separate GPIO_MODER register. A single MODER register can change the mode for each of the pins associated with that port. So each pin is independent.
The GPIOx_AFRL/GPIOx_AFRH registers (also available for each port) control the alternate function for each pin, when the GPIOx_MODER for a pin is set to alternate function mode.
So each pin on a port can have individual alternate functions.
The GPIOx_AFRL/GPIOx_AFRH registers (also available for each port) control the alternate function for each pin, when the GPIOx_MODER for a pin is set to alternate function mode.
So each pin on a port can have individual alternate functions.