7static const char *
const TAG =
"st7789v";
9static constexpr size_t TEMP_BUFFER_SIZE = 1024;
11static constexpr size_t TEMP_BUFFER_SIZE = 512;
15#ifdef USE_POWER_SUPPLY
127 LOG_DISPLAY(
"",
"SPI ST7789V",
this);
132 " Height Offset: %u\n"
133 " Width Offset: %u\n"
134 " 8-bit color mode: %s\n"
138 LOG_PIN(
" CS Pin: ", this->
cs_);
139 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
142 LOG_UPDATE_INTERVAL(
this);
143#ifdef USE_POWER_SUPPLY
144 ESP_LOGCONFIG(TAG,
" Power Supply Configured: yes");
181 uint8_t temp_buffer[TEMP_BUFFER_SIZE];
182 size_t temp_index = 0;
185 for (
size_t index = 0; index < width; ++index) {
189 temp_buffer[temp_index++] = (uint8_t) (color >> 8);
190 temp_buffer[temp_index++] = (uint8_t) color;
191 if (temp_index == TEMP_BUFFER_SIZE) {
244 byte[0] = (addr1 >> 8) & 0xFF;
245 byte[1] = addr1 & 0xFF;
246 byte[2] = (addr2 >> 8) & 0xFF;
247 byte[3] = addr2 & 0xFF;
254 uint8_t
byte[TEMP_BUFFER_SIZE];
255 uint16_t remaining =
size;
257 while (remaining > 0) {
258 uint16_t batch = std::min(remaining,
static_cast<uint16_t
>(
sizeof(
byte) / 2));
260 for (
int i = 0; i < batch; i++) {
261 byte[index++] = (color >> 8) & 0xFF;
262 byte[index++] = color & 0xFF;
296 for (
int i = x1; i <= x2; i++) {
297 uint16_t
size = y2 - y1 + 1;
314 this->
buffer_[pos++] = (color565 >> 8) & 0xff;
virtual void digital_write(bool value)=0
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
static uint8_t color_to_332(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
static Color to_color(uint32_t colorcode, ColorOrder color_order, ColorBitness color_bitness=ColorBitness::COLOR_BITNESS_888, bool right_bit_aligned=true)
void init_internal_(uint32_t buffer_length)
void spi_setup() override
void write_byte(uint8_t data)
void write_array(const uint8_t *data, size_t length)
void dump_config() override
void draw_absolute_pixel_internal(int x, int y, Color color) override
void backlight_(bool onoff)
void write_addr_(uint16_t addr1, uint16_t addr2)
void draw_filled_rect_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
void set_model_str(const char *model_str)
void write_command_(uint8_t value)
void write_display_data()
float get_setup_priority() const override
int get_height_internal() override
void write_data_(uint8_t value)
size_t get_buffer_length_()
void write_color_(uint16_t color, uint16_t size)
int get_width_internal() override
power_supply::PowerSupplyRequester power_
constexpr float PROCESSOR
For components that use data from sensors like displays.
void HOT delay(uint32_t ms)