Skip to content

Commit cb2e346

Browse files
committed
Add forward declarations of Arduino SPI and Wire
A possible solution to #3
1 parent eb3be21 commit cb2e346

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ICM_20948.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ class ICM_20948 {
9595

9696

9797
// I2C
98+
99+
// Forward declarations of TwoWire and Wire for board/variant combinations that don't have a default 'SPI'
100+
class TwoWire;
101+
extern TwoWire Wire;
102+
98103
class ICM_20948_I2C : public ICM_20948 {
99104
private:
100105
protected:
@@ -124,6 +129,10 @@ class ICM_20948_I2C : public ICM_20948 {
124129
#define ICM_20948_SPI_DEFAULT_ORDER MSBFIRST
125130
#define ICM_20948_SPI_DEFAULT_MODE SPI_MODE3
126131

132+
// Forward declarations of SPIClass and SPI for board/variant combinations that don't have a default 'SPI'
133+
class SPIClass;
134+
extern SPIClass SPI;
135+
127136
class ICM_20948_SPI : public ICM_20948 {
128137
private:
129138
protected:

0 commit comments

Comments
 (0)