Skip to content

Commit 52b0784

Browse files
committed
[DISCO_L475VG] Avoid duplicated analog pins
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent a4a7bd5 commit 52b0784

File tree

2 files changed

+38
-30
lines changed

2 files changed

+38
-30
lines changed

variants/DISCO_L475VG_IOT/variant.cpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,27 @@ const PinName digitalPin[] = {
106106
PC_3, //D71/A2
107107
PC_2, //D72/A3
108108
PC_1, //D73/A4
109-
PC_0, //D74/A5
110-
// Duplicated pins in order to be aligned with PinMap_ADC
111-
PA_1, //D75/A6
112-
PA_0, //D76/A7
113-
PB_0, //D77/A8
114-
PA_3, //D78/A9
115-
PB_1, //D79/A10
116-
PA_4, //D80/A11
117-
PA_2, //D81/A12
118-
PA_7, //D82/A13
119-
PA_6, //D83/A14
120-
PA_5 //D84/A15
109+
PC_0 //D74/A5
110+
};
111+
112+
// Analog (Ax) pin number array
113+
const uint32_t analogInPin[] = {
114+
69, //A0
115+
70, //A1
116+
71, //A2
117+
72, //A3
118+
73, //A4
119+
74, //A5
120+
0, //A6
121+
1, //A7
122+
3, //A8
123+
4, //A9
124+
6, //A10
125+
7, //A11
126+
10, //A12
127+
11, //A13
128+
12, //A14
129+
13, //A15
121130
};
122131

123132
#ifdef __cplusplus

variants/DISCO_L475VG_IOT/variant.h

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ extern "C" {
2828
*----------------------------------------------------------------------------*/
2929

3030
// CN3 connector
31-
#define PA1 0 // A6/UART4_RX
32-
#define PA0 1 // A7/UART4_TX
31+
#define PA1 A6 //UART4_RX
32+
#define PA0 A7 //UART4_TX
3333
#define PD14 2
34-
#define PB0 3 // A8/PWM
35-
#define PA3 4 // A9
34+
#define PB0 A8 //PWM
35+
#define PA3 A9
3636
#define PB4 5 // PWM
37-
#define PB1 6 // A10/PWM
38-
#define PA4 7 // A11
37+
#define PB1 A10//PWM
38+
#define PA4 A11
3939
// CN1 connector
4040
#define PB2 8
4141
#define PA15 9 // PWM
42-
#define PA2 10 // A12/SPI_SSN/PWM
43-
#define PA7 11 // A13/SPI1_MOSI/PWM
44-
#define PA6 12 // A14/SPI1_MISO
45-
#define PA5 13 // A15/SPI1_SCK/LED1
42+
#define PA2 A12//SPI_SSN/PWM
43+
#define PA7 A13//SPI1_MOSI/PWM
44+
#define PA6 A14//SPI1_MISO
45+
#define PA5 A15//SPI1_SCK/LED1
4646
#define PB9 14 // I2C1_SDA
4747
#define PB8 15 // I2C1_SCL
4848
// Not on connector
@@ -104,18 +104,17 @@ extern "C" {
104104
#define PE14 67 // QUADSPI_BK1_IO2
105105
#define PE15 68 // QUADSPI_BK1_IO3
106106
// CN4 connector
107-
#define PC5 69 // A0
108-
#define PC4 70 // A1
109-
#define PC3 71 // A2
110-
#define PC2 72 // A3
111-
#define PC1 73 // A4
112-
#define PC0 74 // A5
107+
#define PC5 A0
108+
#define PC4 A1
109+
#define PC3 A2
110+
#define PC2 A3
111+
#define PC1 A4
112+
#define PC0 A5
113113

114114
// This must be a literal
115-
#define NUM_DIGITAL_PINS 85
115+
#define NUM_DIGITAL_PINS 75
116116
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
117117
#define NUM_ANALOG_INPUTS 16
118-
#define NUM_ANALOG_FIRST 69
119118

120119
// On-board LED pin number
121120
#define LED_BUILTIN 13

0 commit comments

Comments
 (0)