Skip to content

Commit cbeb20d

Browse files
authored
Merge pull request #480 from leonardocavagnis/wire_interface_count_def
Add `WIRE_INTERFACES_COUNT` define and fix SCL pins for opta analog and digital
2 parents f781844 + 8e57285 commit cbeb20d

File tree

7 files changed

+39
-32
lines changed

7 files changed

+39
-32
lines changed

variants/MINIMA/pins_arduino.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ static const uint8_t D15 = PIN_D15;
110110

111111
/****** WIRE CORE DEFINES ******/
112112

113-
#define WIRE_HOWMANY 1
114-
#define WIRE_SDA_PIN 18 /* A4 */
115-
#define WIRE_SCL_PIN 19 /* A5 */
113+
#define WIRE_HOWMANY 1
114+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
115+
#define WIRE_SDA_PIN 18 /* A4 */
116+
#define WIRE_SCL_PIN 19 /* A5 */
116117

117118
static const uint8_t SDA = WIRE_SDA_PIN;
118119
static const uint8_t SCL = WIRE_SCL_PIN;

variants/MUXTO/pins_arduino.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ static const uint8_t A6 = PIN_A6;
145145

146146
/****** WIRE CORE DEFINES ******/
147147

148-
#define WIRE_HOWMANY 1
149-
#define WIRE_SDA_PIN 20
150-
#define WIRE_SCL_PIN 21
148+
#define WIRE_HOWMANY 1
149+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
150+
#define WIRE_SDA_PIN 20
151+
#define WIRE_SCL_PIN 21
151152

152153
// TODO: removeme
153154
#ifdef __cplusplus

variants/NANOR4/pins_arduino.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ static const uint8_t D15 = PIN_D15;
117117

118118
/****** WIRE CORE DEFINES ******/
119119

120-
#define WIRE_HOWMANY 2
121-
#define WIRE_SDA_PIN 18 /* A4 */
122-
#define WIRE_SCL_PIN 19 /* A5 */
123-
#define WIRE1_SDA_PIN 27
124-
#define WIRE1_SCL_PIN 26
120+
#define WIRE_HOWMANY 2
121+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
122+
#define WIRE_SDA_PIN 18 /* A4 */
123+
#define WIRE_SCL_PIN 19 /* A5 */
124+
#define WIRE1_SDA_PIN 27
125+
#define WIRE1_SCL_PIN 26
125126

126127
static const uint8_t SDA = WIRE_SDA_PIN;
127128
static const uint8_t SCL = WIRE_SCL_PIN;

variants/OPTA_ANALOG/pins_arduino.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ extern "C" unsigned int PINCOUNT_fn();
7474
#define UART1_RX_PIN UART_RX
7575
/* ************************** WIRE CORE DEFINES **************************** */
7676
#define WIRE_HOWMANY 1
77-
#define WIRE_SDA_PIN I2C_SDA
78-
#define WIRE_SCL_PIN I2C_SCL
77+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
78+
#define WIRE_SDA_PIN I2C_SDA
79+
#define WIRE_SCL_PIN I2C_SCL
7980
static const uint8_t SDA = WIRE_SDA_PIN;
80-
static const uint8_t SCL = WIRE_SDA_PIN;
81+
static const uint8_t SCL = WIRE_SCL_PIN;
8182
/* *************************** SPI CORE DEFINES **************************** */
8283
#define SPI_HOWMANY 1
8384
#define PIN_SPI_MOSI SPI_MOSI

variants/OPTA_DIGITAL/pins_arduino.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,13 @@ static const uint8_t A15 = AN15;
138138
#define UART1_RX_PIN UART_TX
139139

140140
/****** WIRE CORE DEFINES ******/
141-
#define WIRE_HOWMANY 1
142-
#define WIRE_SDA_PIN I2C_SDA
143-
#define WIRE_SCL_PIN I2C_SCL
141+
#define WIRE_HOWMANY 1
142+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
143+
#define WIRE_SDA_PIN I2C_SDA
144+
#define WIRE_SCL_PIN I2C_SCL
144145

145146
static const uint8_t SDA = WIRE_SDA_PIN;
146-
static const uint8_t SCL = WIRE_SDA_PIN;
147+
static const uint8_t SCL = WIRE_SCL_PIN;
147148

148149
/****** SPI CORE DEFINES ******/
149150

variants/PORTENTA_C33/pins_arduino.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,16 @@ static const uint8_t D7 = PIN_D7;
9999

100100
/****** WIRE CORE DEFINES ******/
101101

102-
#define WIRE_HOWMANY 4
103-
#define WIRE_SDA_PIN 11
104-
#define WIRE_SCL_PIN 12
105-
#define WIRE1_SDA_PIN 37
106-
#define WIRE1_SCL_PIN 38
107-
#define WIRE2_SDA_PIN 39
108-
#define WIRE2_SCL_PIN 40
109-
#define WIRE3_SDA_PIN 96
110-
#define WIRE3_SCL_PIN 97
102+
#define WIRE_HOWMANY 4
103+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
104+
#define WIRE_SDA_PIN 11
105+
#define WIRE_SCL_PIN 12
106+
#define WIRE1_SDA_PIN 37
107+
#define WIRE1_SCL_PIN 38
108+
#define WIRE2_SDA_PIN 39
109+
#define WIRE2_SCL_PIN 40
110+
#define WIRE3_SDA_PIN 96
111+
#define WIRE3_SCL_PIN 97
111112

112113
/****** SPI CORE DEFINES ******/
113114

variants/UNOWIFIR4/pins_arduino.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ static const uint8_t D15 = PIN_D15;
113113

114114
/****** WIRE CORE DEFINES ******/
115115

116-
#define WIRE_HOWMANY 2
117-
#define WIRE_SDA_PIN 18 /* A4 */
118-
#define WIRE_SCL_PIN 19 /* A5 */
119-
#define WIRE1_SDA_PIN 27
120-
#define WIRE1_SCL_PIN 26
116+
#define WIRE_HOWMANY 2
117+
#define WIRE_INTERFACES_COUNT WIRE_HOWMANY
118+
#define WIRE_SDA_PIN 18 /* A4 */
119+
#define WIRE_SCL_PIN 19 /* A5 */
120+
#define WIRE1_SDA_PIN 27
121+
#define WIRE1_SCL_PIN 26
121122

122123
static const uint8_t SDA = WIRE_SDA_PIN;
123124
static const uint8_t SCL = WIRE_SCL_PIN;

0 commit comments

Comments
 (0)