Page 2 of 2

Re: Some confusion around the ordering/mapping of the pins in the variant.cpp PinName array

Posted: Sat May 02, 2020 4:36 pm
by fredbox
I posted a more complete example here.

Re: Some confusion around the ordering/mapping of the pins in the variant.cpp PinName array

Posted: Sun Aug 25, 2024 9:05 pm
by bockesj
Description of digitl i/o problems on nucleo F767zi (with the STM32duino core)

The pins are referenced into two different ways - one has an underscore and the other does not
For example pin C-9 in referred to as PC9 (the "Pin Number") and PC_9 (the "Pin Name")

all of the digital I/O functions (PinMode, digitalRead/Write) use the "Pin Number" ie. - the
value without the underscore.

But here's the twist - with the Nucleo F767zi - not all of the pin numbers are defined, however,
pinNames are defined @!#$%

So in order to use all of the pins, I use the PinName and convert it to the Pin Number as follows
int pinE0 = pinNametoDigitalPin(PE_0)
pinMode( pinE0, INPUT_PULLUP);
digitalWrite( pinE0, true);