8using dfrobot_sen0465_base::FRAME_SIZE;
9using dfrobot_sen0465_base::RESPONSE_TIMEOUT_ID;
11static constexpr uint8_t DATA_REGISTER = 0x00;
14static constexpr uint32_t RESPONSE_DELAY_MS = 100;
17 DFRobotSEN0465Component::dump_config();
26 this->
set_timeout(RESPONSE_TIMEOUT_ID, RESPONSE_DELAY_MS, [
this]() {
27 uint8_t frame[FRAME_SIZE];
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
void handle_no_response_()
void handle_response_(const uint8_t *frame)
bool write_frame(const uint8_t *frame) override
void read_response() override
void dump_config() override
ErrorCode write_register(uint8_t a_register, const uint8_t *data, size_t len) const
writes an array of bytes to a specific register in the I²C device
ErrorCode write(const uint8_t *data, size_t len) const
writes an array of bytes to a device using an I2CBus
ErrorCode read(uint8_t *data, size_t len) const
reads an array of bytes from the device using an I2CBus
ESPHOME_LOG_TAG(TAG, "dfrobot_sen0465_i2c")
@ ERROR_OK
No error found during execution of method.