|
14 | 14 | #include <SPI.h> |
15 | 15 | #include <SoftwareSerial.h> |
16 | 16 | #include <Wire.h> |
17 | | -#if defined(I3C1_BASE) |
| 17 | +#if defined(I3C1_BASE) || defined(I3C2_BASE) |
18 | 18 | #include <I3C.h> |
19 | 19 | #endif |
20 | 20 |
|
@@ -135,18 +135,18 @@ void setup() { |
135 | 135 | Wire.requestFrom(2, 1); |
136 | 136 | Wire.end(); |
137 | 137 |
|
138 | | -#if defined(I3C1_BASE) |
| 138 | +#if defined(I3C1_BASE) || defined(I3C2_BASE) |
139 | 139 | // I3C |
140 | | - I3C1Bus.setBusType(I3CBusType::Pure); |
141 | | - I3C1Bus.setMixedBusOpenDrainFrequency(1000000U); |
142 | | - I3C1Bus.begin(I3C_SDA, I3C_SCL, 1000000U, I3CBusType::Pure, 1000000U); |
143 | | - I3C1Bus.setClock(1000000U); |
| 140 | + I3C.setBusType(I3CBusType::Pure); |
| 141 | + I3C.setMixedBusOpenDrainFrequency(1000000U); |
| 142 | + I3C.begin(I3C_SDA, I3C_SCL, 1000000U, I3CBusType::Pure, 1000000U); |
| 143 | + I3C.setClock(1000000U); |
144 | 144 |
|
145 | 145 | uint8_t i3cData = 0; |
146 | | - I3C1Bus.isI3CDeviceReady(0x30, 1, 1); |
147 | | - I3C1Bus.isI2CDeviceReady(0x48, 1, 1); |
148 | | - I3C1Bus.readReg(0x30, 0x00, i3cData, 1); |
149 | | - I3C1Bus.readReg(0x48, 0x00, i3cData, I3CTransferType::I2C, 1); |
| 146 | + I3C.isI3CDeviceReady(0x30, 1, 1); |
| 147 | + I3C.isI2CDeviceReady(0x48, 1, 1); |
| 148 | + I3C.readReg(0x30, 0x00, i3cData, 1); |
| 149 | + I3C.readReg(0x48, 0x00, i3cData, I3CTransferType::I2C, 1); |
150 | 150 | #endif |
151 | 151 |
|
152 | 152 | // CMSIS DSP |
|
0 commit comments