klips/esp/cpp/07_lcd-panel/main/ssd1306.cpp
2025-02-16 07:25:02 -05:00

25 lines
780 B
C++

#include "ssd1306.h"
// To use LV_COLOR_FORMAT_I1 we need an extra buffer to hold the converted data.
uint8_t SSD1306::oled_buffer_[LCD_H_RES * LCD_V_RES / 8];
SSD1306::SSD1306(I2C& i2c,
esp_lcd_panel_ssd1306_config_t config,
int width,
int height) :
IPanelDevice(i2c,
(esp_lcd_panel_io_i2c_config_t) {
.dev_addr = I2C_HW_ADDR,
.control_phase_bytes = 1,
.dc_bit_offset = 6,
.lcd_cmd_bits = LCD_CMD_BITS,
.lcd_param_bits = LCD_CMD_BITS,
.scl_speed_hz = LCD_PIXEL_CLOCK_HZ,
},
width,
height
),
ssd1306_config_(config)
{ }