Skip to content

Commit be1cb00

Browse files
committed
[NUCLEO_L073RZ] Avoid duplicated analog pins
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent e45fe44 commit be1cb00

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

variants/NUCLEO_L073RZ/variant.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,23 @@ const PinName digitalPin[] = {
9292
PA_4, //D48/A2
9393
PB_0, //D49/A3
9494
PC_1, //D50/A4 - SB56 ON SB51 ON on the board
95-
PC_0, //D51/A5
96-
// Duplicated pins in order to be aligned with PinMap_ADC
97-
PA_7, //D52/A6 = D11
98-
PA_6, //D53/A7 = D12
99-
PC_2, //D54/A8 = D28
100-
PC_3, //D55/A9 = D29
101-
PC_5, //D56/A10 = D35
102-
PC_4 //D57/A11 = D45
95+
PC_0 //D51/A5
96+
};
97+
98+
// Analog (Ax) pin number array
99+
const uint32_t analogInPin[] = {
100+
46, //A0
101+
47, //A1
102+
48, //A2
103+
49, //A3
104+
50, //A4
105+
51, //A5
106+
11, //A6
107+
12, //A7
108+
28, //A8
109+
29, //A9
110+
35, //A10
111+
45 //A11
103112
};
104113

105114
#ifdef __cplusplus

variants/NUCLEO_L073RZ/variant.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ extern "C" {
5050
#define PA9 8
5151
#define PC7 9
5252
#define PB6 10 // PWM is not supported by D10 as no timer on PB6
53-
#define PA7 11 // A6
54-
#define PA6 12 // A7
53+
#define PA7 A6
54+
#define PA6 A7
5555
#define PA5 13
5656
#define PB9 14
5757
#define PB8 15
@@ -69,8 +69,8 @@ extern "C" {
6969
#define PC15 25
7070
#define PH0 26
7171
#define PH1 27
72-
#define PC2 28 // A8
73-
#define PC3 29 // A9
72+
#define PC2 A8
73+
#define PC3 A9
7474
// CN7 Right Side
7575
#define PC11 30
7676
#define PD2 31
@@ -79,7 +79,7 @@ extern "C" {
7979
// CN10 Right side
8080
#define PC8 33
8181
#define PC6 34
82-
#define PC5 35 // A10
82+
#define PC5 A10
8383
#define PA12 36
8484
#define PA11 37
8585
#define PB12 38
@@ -89,20 +89,19 @@ extern "C" {
8989
#define PB15 42
9090
#define PB14 43
9191
#define PB13 44
92-
#define PC4 45 // A11
93-
#define PA0 46 // A0
94-
#define PA1 47 // A1
95-
#define PA4 48 // A2
96-
#define PB0 49 // A3
97-
#define PC1 50 // A4 - SB56 ON SB51 ON on the board!
98-
#define PC0 51 // A5
92+
#define PC4 A11
93+
#define PA0 A0
94+
#define PA1 A1
95+
#define PA4 A2
96+
#define PB0 A3
97+
#define PC1 A4 // SB56 ON SB51 ON on the board!
98+
#define PC0 A5
9999

100100
// This must be a literal
101-
#define NUM_DIGITAL_PINS 58
101+
#define NUM_DIGITAL_PINS 52
102102

103103
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
104104
#define NUM_ANALOG_INPUTS 12
105-
#define NUM_ANALOG_FIRST 46
106105

107106
// On-board LED pin number
108107
#define LED_BUILTIN 13

0 commit comments

Comments
 (0)