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

Post here first, or if you can't find a relevant section!
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

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

Post by fredbox »

I posted a more complete example here.
bockesj
Posts: 3
Joined: Sat Feb 06, 2021 10:03 pm

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

Post 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);
Post Reply

Return to “General discussion”