You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
389 B
19 lines
389 B
#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
|