1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| #ifndef I2C_DEVICE_H
| #define I2C_DEVICE_H
|
| #include <driver/i2c_master.h>
|
| class I2cDevice {
| public:
| I2cDevice(i2c_master_bus_handle_t i2c_bus, uint8_t addr);
|
| protected:
| i2c_master_dev_handle_t i2c_device_;
|
| 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
|
|