5 namespace ssd1306_i2c {
7 static const char *
const TAG =
"ssd1306_i2c";
10 ESP_LOGCONFIG(TAG,
"Setting up I2C SSD1306...");
13 auto err = this->
write(
nullptr, 0);
23 LOG_DISPLAY(
"",
"I2C SSD1306",
this);
25 ESP_LOGCONFIG(TAG,
" Model: %s", this->
model_str_());
27 ESP_LOGCONFIG(TAG,
" External VCC: %s", YESNO(this->
external_vcc_));
28 ESP_LOGCONFIG(TAG,
" Flip X: %s", YESNO(this->
flip_x_));
29 ESP_LOGCONFIG(TAG,
" Flip Y: %s", YESNO(this->
flip_y_));
30 ESP_LOGCONFIG(TAG,
" Offset X: %d", this->
offset_x_);
31 ESP_LOGCONFIG(TAG,
" Offset Y: %d", this->
offset_y_);
32 ESP_LOGCONFIG(TAG,
" Inverted Color: %s", YESNO(this->
invert_));
33 LOG_UPDATE_INTERVAL(
this);
36 ESP_LOGE(TAG,
"Communication with SSD1306 failed!");
56 for (uint8_t &j : data)
62 size_t block_size = 16;
69 uint8_t data[block_size];
70 for (uint8_t &j : data)
int get_height_internal() override
ErrorCode write(const uint8_t *data, size_t len, bool stop=true)
writes an array of bytes to a device using an I2CBus
size_t get_buffer_length_()
const char * model_str_()
No error found during execution of method.
int get_width_internal() override
void write_display_data() override
void dump_config() override
void command(uint8_t value) override
bool write_byte(uint8_t a_register, uint8_t data, bool stop=true)
virtual void mark_failed()
Mark this component as failed.
Implementation of SPI Controller mode.
bool write_bytes(uint8_t a_register, const uint8_t *data, uint8_t len, bool stop=true)