ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
ssd1327_i2c.cpp
Go to the documentation of this file.
1#include "ssd1327_i2c.h"
2#include "esphome/core/log.h"
3
5
6ESPHOME_LOG_TAG(TAG, "ssd1327_i2c");
7
9 this->init_reset_();
10
11 auto err = this->write(nullptr, 0);
12 if (err != i2c::ERROR_OK) {
13 this->mark_failed(LOG_STR(ESP_LOG_MSG_COMM_FAIL));
14 return;
15 }
16
17 SSD1327::setup();
18}
20 LOG_DISPLAY("", "I2C SSD1327", this);
21 LOG_I2C_DEVICE(this);
22 ESP_LOGCONFIG(TAG, " Model: %s", this->model_str_());
23 LOG_PIN(" Reset Pin: ", this->reset_pin_);
24 LOG_UPDATE_INTERVAL(this);
25}
26void I2CSSD1327::command(uint8_t value) { this->write_byte(0x00, value); }
28 for (uint32_t i = 0; i < this->get_buffer_length_();) {
29 uint8_t data[16];
30 for (uint8_t &j : data)
31 j = this->buffer_[i++];
32 this->write_bytes(0x40, data, sizeof(data));
33 }
34}
35
36} // namespace esphome::ssd1327_i2c
void mark_failed()
Mark this component as failed.
ErrorCode write(const uint8_t *data, size_t len) const
writes an array of bytes to a device using an I2CBus
Definition i2c.h:195
bool write_byte(uint8_t a_register, uint8_t data) const
Definition i2c.h:312
bool write_bytes(uint8_t a_register, const uint8_t *data, uint8_t len) const
Definition i2c.h:298
void command(uint8_t value) override
@ ERROR_OK
No error found during execution of method.
Definition i2c_bus.h:15
ESPHOME_LOG_TAG(TAG, "ssd1327_i2c")
static void uint32_t