6 namespace ade7953_i2c {
8 static const char *
const TAG =
"ade7953";
11 ESP_LOGCONFIG(TAG,
"ADE7953_i2c:");
34 data[2] = value >> 24;
35 data[3] = value >> 16;
42 reg_data[0] = reg >> 8;
43 reg_data[1] = reg >> 0;
47 err = this->
read(value, 1);
52 reg_data[0] = reg >> 8;
53 reg_data[1] = reg >> 0;
58 err = this->
read(recv, 2);
66 reg_data[0] = reg >> 8;
67 reg_data[1] = reg >> 0;
72 err = this->
read(recv, 4);
bool ade_read_32(uint16_t reg, uint32_t *value) override
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
ErrorCode read(uint8_t *data, size_t len)
reads an array of bytes from the device using an I2CBus
constexpr uint32_t encode_uint32(uint8_t byte1, uint8_t byte2, uint8_t byte3, uint8_t byte4)
Encode a 32-bit value given four bytes in most to least significant byte order.
bool ade_read_8(uint16_t reg, uint8_t *value) override
ErrorCode write(const uint8_t *data, size_t len, bool stop=true)
writes an array of bytes to a device using an I2CBus
void dump_config() override
void dump_config() override
No error found during execution of method.
bool ade_write_32(uint16_t reg, uint32_t value) override
constexpr uint16_t encode_uint16(uint8_t msb, uint8_t lsb)
Encode a 16-bit value given the most and least significant byte.
bool ade_write_8(uint16_t reg, uint8_t value) override
Implementation of SPI Controller mode.
bool ade_read_16(uint16_t reg, uint16_t *value) override
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
bool ade_write_16(uint16_t reg, uint16_t value) override