mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 10:38:27 +02:00
Ili9341 8bit indexed mode pt1 (#2490)
This commit is contained in:
@@ -14,6 +14,11 @@ enum ILI9341Model {
|
||||
TFT_24,
|
||||
};
|
||||
|
||||
enum ILI9341ColorMode {
|
||||
BITS_8,
|
||||
BITS_8_INDEXED,
|
||||
};
|
||||
|
||||
class ILI9341Display : public PollingComponent,
|
||||
public display::DisplayBuffer,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
|
||||
@@ -24,6 +29,8 @@ class ILI9341Display : public PollingComponent,
|
||||
void set_reset_pin(GPIOPin *reset) { this->reset_pin_ = reset; }
|
||||
void set_led_pin(GPIOPin *led) { this->led_pin_ = led; }
|
||||
void set_model(ILI9341Model model) { this->model_ = model; }
|
||||
void set_palette(const uint8_t *palette) { this->palette_ = palette; }
|
||||
void set_buffer_color_mode(ILI9341ColorMode color_mode) { this->buffer_color_mode_ = color_mode; }
|
||||
|
||||
void command(uint8_t value);
|
||||
void data(uint8_t value);
|
||||
@@ -59,6 +66,9 @@ class ILI9341Display : public PollingComponent,
|
||||
uint16_t y_low_{0};
|
||||
uint16_t x_high_{0};
|
||||
uint16_t y_high_{0};
|
||||
const uint8_t *palette_;
|
||||
|
||||
ILI9341ColorMode buffer_color_mode_{BITS_8};
|
||||
|
||||
uint32_t get_buffer_length_();
|
||||
int get_width_internal() override;
|
||||
|
||||
Reference in New Issue
Block a user