Skip to content

Commit 4ba69b8

Browse files
committed
chore: nucleo G431RB add missing analog pins
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 75b051e commit 4ba69b8

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

variants/STM32G4xx/G431R(6-8-B)(I-T)_G441RB(I-T)/variant_NUCLEO_G431RB.cpp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
// Pin number
1919
const PinName digitalPin[] = {
2020
// CN9
21-
PC_5, //D0
22-
PC_4, //D1
21+
PC_5, //D0/A12
22+
PC_4, //D1/A13
2323
PA_10, //D2
2424
PB_3, //D3
2525
PB_5, //D4
@@ -30,9 +30,9 @@ const PinName digitalPin[] = {
3030
PA_9, //D8
3131
PC_7, //D9
3232
PB_6, //D10
33-
PA_7, //D11
34-
PA_6, //D12
35-
PA_5, //D13/LED
33+
PA_7, //D11/A18
34+
PA_6, //D12/A19
35+
PA_5, //D13/A20/LED
3636
PB_9, //D14
3737
PB_8, //D15
3838
// CN7 Left Side
@@ -45,10 +45,10 @@ const PinName digitalPin[] = {
4545
PC_13, //D22
4646
PC_14, //D23
4747
PC_15, //D24
48-
PF_0, //D25
49-
PF_1, //D26
50-
PC_2, //D27
51-
PC_3, //D28
48+
PF_0, //D25/A14
49+
PF_1, //D26/A15
50+
PC_2, //D27/A16
51+
PC_3, //D28/A17
5252
// CN7 Right Side
5353
PD_2, //D29
5454
PC_11, //D30
@@ -73,8 +73,8 @@ const PinName digitalPin[] = {
7373
PA_12, //D46
7474
PC_6, //D47
7575
PC_8, //D48
76-
PA_2, //D49
77-
PA_3 //D50
76+
PA_2, //D49/A21
77+
PA_3 //D50/A22
7878
};
7979

8080
// Analog (Ax) pin number array
@@ -90,7 +90,18 @@ const uint32_t analogInputPin[] = {
9090
40, // A8
9191
41, // A9
9292
42, // A10
93-
43 // A11
93+
43, // A11
94+
0, // A12
95+
1, // A13
96+
25, // A14
97+
26, // A15
98+
27, // A16
99+
28, // A17
100+
11, // A18
101+
12, // A19
102+
13, // A20
103+
49, // A21
104+
50 // A22
94105
};
95106

96107
// ----------------------------------------------------------------------------

variants/STM32G4xx/G431R(6-8-B)(I-T)_G441RB(I-T)/variant_NUCLEO_G431RB.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* Pins
1717
*----------------------------------------------------------------------------*/
1818
// CN9
19-
#define PC5 0
20-
#define PC4 1
19+
#define PC5 PIN_A12
20+
#define PC4 PIN_A13
2121
#define PA10 2
2222
#define PB3 3
2323
#define PB5 4
@@ -28,9 +28,9 @@
2828
#define PA9 8
2929
#define PC7 9
3030
#define PB6 10
31-
#define PA7 11
32-
#define PA6 12
33-
#define PA5 13 // LED
31+
#define PA7 PIN_A18
32+
#define PA6 PIN_A19
33+
#define PA5 PIN_A20 // LED
3434
#define PB9 14
3535
#define PB8 15
3636
// CN7 Left Side
@@ -43,10 +43,10 @@
4343
#define PC13 22
4444
#define PC14 23
4545
#define PC15 24
46-
#define PF0 25
47-
#define PF1 26
48-
#define PC2 27
49-
#define PC3 28
46+
#define PF0 PIN_A14
47+
#define PF1 PIN_A15
48+
#define PC2 PIN_A16
49+
#define PC3 PIN_A17
5050
// CN7 Right Side
5151
#define PD2 29
5252
#define PC11 30
@@ -71,8 +71,8 @@
7171
#define PA12 46
7272
#define PC6 47
7373
#define PC8 48
74-
#define PA2 49
75-
#define PA3 50
74+
#define PA2 PIN_A21 // VCP_TX
75+
#define PA3 PIN_A22 // VCP_RX
7676
//PG10
7777

7878
// Alternate pins number
@@ -131,7 +131,7 @@
131131
// This must be a literal
132132
#define NUM_DIGITAL_PINS 51
133133
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
134-
#define NUM_ANALOG_INPUTS 12
134+
#define NUM_ANALOG_INPUTS 23
135135

136136
// On-board LED pin number
137137
#ifndef LED_BUILTIN

0 commit comments

Comments
 (0)