Perhaps I’m missing something obvious. Attempting to toggle or read GPIO pins with HAL commands on the nucleo 32f303K8.
I found some examples, but often the pin names either refer to the board names, like LED or simply have numbers like “pin_8” but don’t seem to have a correlation to the actual pin number on the board, the IC, the port or the channel.
I got a blink program working adapted from platformio and it worked, but the pin name did not make sense.
The pin is PB3 on the MCU and pin 26 on the IC. It is pin 13 on the board.
But in the code it’s referred to as pin 8 (and it worked)
You can use either the MCU pin name (see the source under mbed-os/targets/…/pinmap.c/.h) or the name of the pin broken out on the board’s headers (see the picture of the board on the platform page (Development boards | Mbed). Either one will work as the input to the cuntions. For the LED’s most boards have LED1, LED2,…etc defined as well.
In the end they’re all just #defines that are increasingly user friendly. Feel free to use whatever you want (though I do reccomend using the ones on the board page for portability)
Okay thanks. I’ll have another look when I have a chance.
I wasn’t sure if HAL used the #defines.
When I tried pb3 it didn’t seem to work. I’ll have another go at it and see if it works.