forked from xiaozhi/xiaozhi-esp32
add m5stack cores3 support
This commit is contained in:
@@ -29,3 +29,7 @@ uint8_t I2cDevice::ReadReg(uint8_t reg) {
|
||||
ESP_ERROR_CHECK(i2c_master_transmit_receive(i2c_device_, ®, 1, buffer, 1, 100));
|
||||
return buffer[0];
|
||||
}
|
||||
|
||||
void I2cDevice::ReadRegs(uint8_t reg, uint8_t* buffer, size_t length) {
|
||||
ESP_ERROR_CHECK(i2c_master_transmit_receive(i2c_device_, ®, 1, buffer, length, 100));
|
||||
}
|
||||
@@ -12,6 +12,7 @@ protected:
|
||||
|
||||
void WriteReg(uint8_t reg, uint8_t value);
|
||||
uint8_t ReadReg(uint8_t reg);
|
||||
void ReadRegs(uint8_t reg, uint8_t* buffer, size_t length);
|
||||
};
|
||||
|
||||
#endif // I2C_DEVICE_H
|
||||
|
||||
Reference in New Issue
Block a user