Skip to content

Commit a6a8b1f

Browse files
committed
Update variant.h so override pins_arduino files
1 parent e79c2a0 commit a6a8b1f

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

variants/Generic_F401Rx/variant.h

+34-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ extern "C" {
8686
#define NUM_DIGITAL_PINS 50
8787
#define NUM_ANALOG_INPUTS 16
8888
#define NUM_ANALOG_FIRST 0
89-
#define MAX_ANALOG_INPUTS 15
9089
#define AEND 36
9190

9291
// On-board LED pin number
@@ -96,6 +95,40 @@ extern "C" {
9695
// On-board user button
9796
#define USER_BTN PC13
9897

98+
// Analog pin definitions
99+
#define PIN_A0 PA0
100+
#define PIN_A1 PA1
101+
#define PIN_A2 PA2
102+
#define PIN_A3 PA3
103+
#define PIN_A4 PA4
104+
#define PIN_A5 PA5
105+
#define PIN_A6 PA6
106+
#define PIN_A7 PA7
107+
#define PIN_A8 PB0
108+
#define PIN_A9 PB1
109+
#define PIN_A10 PC0
110+
#define PIN_A11 PC1
111+
#define PIN_A12 PC2
112+
#define PIN_A13 PC3
113+
#define PIN_A14 PC4
114+
#define PIN_A15 PC5
115+
116+
// Convert analog channel, analog pin or digital pin to digital pin
117+
#define analogInputToDigitalPin(p) ((p <= 7) ? (p) : (p <= 9) ? (p + 8) : (p <= 15) ? (p + 21) : (p))
118+
119+
// SPI definitions
120+
#define PIN_SPI_SS PA4
121+
#define PIN_SPI_SS1 PA4
122+
#define PIN_SPI_SS2 PB12
123+
#define PIN_SPI_SS3 PA15
124+
#define PIN_SPI_MOSI PA7
125+
#define PIN_SPI_MISO PA6
126+
#define PIN_SPI_SCK PA5
127+
128+
// I2C definitions
129+
#define PIN_WIRE_SDA PB9
130+
#define PIN_WIRE_SCL PB8
131+
99132
// Timer Definitions
100133
#define TIMER_TONE TIM10
101134
#define TIMER_SERVO TIM11

0 commit comments

Comments
 (0)