There are also some GD32F103 boards featuring code and pin compatible chips from GigaDevice.
Other STM32 Chips
The source files that relate pin numbers to internal microcontroller ports can, for example with the Blue Pill board, be found in:
The pin number is the element number of the PIN_MAP array in the board.cpp file corresponding to the desired processor port pin (not necessarily the number of the pin on the physical circuit board). In the board.cpp file for the blue pill board for example, pin PA0 is the first line of the PIN_MAP array and is thus element zero of the PIN_MAP array (i.e. PIN_MAP), so pin number 0 corresponds to PA0. Pin PB0 is the 17th line of the PIN_MAP array, or element PIN_MAP and so pin 16 corresponds to PB0. For the blue pill board.cpp file, PC13 is the 33rd line in the PIN_MAP array so pin 32 corresponds to PC13.
An analogRead() line of Arduino code to read pin PB1 on a blue pill board could be written like this:
int analogValueB1 = analogRead(17);
Although it would probably be better to define a name for pin 17 something like this before the setup block:
#define ADCPINPB1 = 17;
To set pin PC15 (element PIN_MAP ) HIGH on a blue pill board after putting it in write mode, you could use:
If an example sketch code refers to say, pin 17 on a maple mini, and you've got a blue pill, then you have to look at the board.cpp file for the maple mini to find out what processor port is referred to on the PIN_MAP line, which happens to be PB6 for the Maple Mini, and find the corresponding line of the PIN_MAP array in the blue pill board.cpp file, which for PB6 is PIN_MAP. So in the example code you would change the 17 to 22.
For the original Arduinos, the pin maps can be found in:
But they use a different format.