1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-15 22:35:46 +00:00

Add support for ST7789V display module (as on TTGO T-Display) (#1050)

* TFT-LCD ST7789V of ESP32 TTGO.

This patch allows you to use TFT-LCD ST7789V of ESP32 TTGO

* Lots of polish and a few tweaks

* Add test

* Add color to core, take 1

* Where did those tabs come from?

* Fix lines too long

* Added color component

* Linted

* Rebase, SPI fix, test

* Shuffle bits

* One more thing...oops

* Image type fix...oops

* Make display_buffer use Color

* Fix BGR/RGB, remove predefined colors

* Fix all the things

* renamed colors to color

* migrate max7219

Co-authored-by: musk95 <musk95@naver.com>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
Keith Burzinski
2020-06-28 16:37:36 -05:00
committed by GitHub
parent bfb9cb6732
commit 491f7e96f0
21 changed files with 843 additions and 85 deletions

View File

@@ -123,7 +123,7 @@ int MAX7219Component::get_width_internal() { return this->num_chips_ * 8; }
size_t MAX7219Component::get_buffer_length_() { return this->num_chips_ * 8; }
void HOT MAX7219Component::draw_absolute_pixel_internal(int x, int y, int color) {
void HOT MAX7219Component::draw_absolute_pixel_internal(int x, int y, Color color) {
if (x + 1 > this->max_displaybuffer_.size()) { // Extend the display buffer in case required
this->max_displaybuffer_.resize(x + 1, this->bckgrnd_);
}
@@ -134,7 +134,7 @@ void HOT MAX7219Component::draw_absolute_pixel_internal(int x, int y, int color)
uint16_t pos = x; // X is starting at 0 top left
uint8_t subpos = y; // Y is starting at 0 top left
if (color == 1) {
if (color.is_on()) {
this->max_displaybuffer_[pos] |= (1 << subpos);
} else {
this->max_displaybuffer_[pos] &= ~(1 << subpos);