Skip to content

Commit ba3c03c

Browse files
committed
Wire:add support for two I2C interface
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 102ee0e commit ba3c03c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libraries/Wire/Wire.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,6 @@ void TwoWire::onService(void)
223223
}
224224

225225
TwoWire Wire = TwoWire(I2C_DEFAULT_PORT);
226+
#if I2C_INTERFACES_COUNT > 1
227+
TwoWire Wire1 = TwoWire(I2C_PORT_1);
228+
#endif

libraries/Wire/Wire.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ class TwoWire : public Stream {
9696
};
9797

9898
extern TwoWire Wire;
99+
#if I2C_INTERFACES_COUNT > 1
100+
extern TwoWire Wire1;
101+
#endif
99102

100103
#endif
101104

0 commit comments

Comments
 (0)