7 static const char *
const TAG =
"st7789v";
8 static const size_t TEMP_BUFFER_SIZE = 128;
11 ESP_LOGCONFIG(TAG,
"Setting up SPI ST7789V...");
12 #ifdef USE_POWER_SUPPLY 124 LOG_DISPLAY(
"",
"SPI ST7789V",
this);
125 ESP_LOGCONFIG(TAG,
" Model: %s", this->
model_str_);
126 ESP_LOGCONFIG(TAG,
" Height: %u", this->
height_);
127 ESP_LOGCONFIG(TAG,
" Width: %u", this->
width_);
129 ESP_LOGCONFIG(TAG,
" Width Offset: %u", this->
offset_width_);
130 ESP_LOGCONFIG(TAG,
" 8-bit color mode: %s", YESNO(this->
eightbitcolor_));
131 LOG_PIN(
" CS Pin: ", this->
cs_);
132 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
135 LOG_UPDATE_INTERVAL(
this);
136 ESP_LOGCONFIG(TAG,
" Data rate: %dMHz", (
unsigned) (this->
data_rate_ / 1000000));
137 #ifdef USE_POWER_SUPPLY 138 ESP_LOGCONFIG(TAG,
" Power Supply Configured: yes");
175 uint8_t temp_buffer[TEMP_BUFFER_SIZE];
176 size_t temp_index = 0;
182 temp_buffer[temp_index++] = (uint8_t) (color >> 8);
183 temp_buffer[temp_index++] = (uint8_t) color;
184 if (temp_index == TEMP_BUFFER_SIZE) {
236 static uint8_t byte[4];
237 byte[0] = (addr1 >> 8) & 0xFF;
238 byte[1] = addr1 & 0xFF;
239 byte[2] = (addr2 >> 8) & 0xFF;
240 byte[3] = addr2 & 0xFF;
247 static uint8_t byte[1024];
249 for (
int i = 0; i < size; i++) {
250 byte[index++] = (color >> 8) & 0xFF;
251 byte[index++] = color & 0xFF;
285 for (
int i = x1; i <= x2; i++) {
286 uint16_t size = y2 - y1 + 1;
303 this->
buffer_[pos++] = (color565 >> 8) & 0xff;
304 this->
buffer_[pos] = color565 & 0xff;
virtual void digital_write(bool value)=0
float get_setup_priority() const override
void dump_config() override
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void spi_setup() override
void write_color_(uint16_t color, uint16_t size)
void set_model_str(const char *model_str)
void draw_absolute_pixel_internal(int x, int y, Color color) override
void write_display_data()
void write_byte(uint8_t data)
void init_internal_(uint32_t buffer_length)
int get_width_internal() override
void draw_filled_rect_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
void write_command_(uint8_t value)
void write_data_(uint8_t value)
static uint8_t color_to_332(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void line(int x1, int y1, int x2, int y2, Color color=COLOR_ON)
Draw a straight line from the point [x1,y1] to [x2,y2] with the given color.
const float PROCESSOR
For components that use data from sensors like displays.
void write_addr_(uint16_t addr1, uint16_t addr2)
void write_array(const uint8_t *data, size_t length)
Implementation of SPI Controller mode.
static Color to_color(uint32_t colorcode, ColorOrder color_order, ColorBitness color_bitness=ColorBitness::COLOR_BITNESS_888, bool right_bit_aligned=true)
power_supply::PowerSupplyRequester power_
size_t get_buffer_length_()
void backlight_(bool onoff)
int get_height_internal() override
void IRAM_ATTR HOT delay(uint32_t ms)