Skip to content

Commit

Permalink
Add support for ST7789 displays
Browse files Browse the repository at this point in the history
Right now it has been tested only on 320x240 displays, such as the one
used on LilyGo T-Deck.

Signed-off-by: Davide Bettio <[email protected]>
  • Loading branch information
bettio committed Oct 20, 2024
1 parent af6d613 commit 1aaf2b1
Show file tree
Hide file tree
Showing 3 changed files with 930 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ idf_component_register(SRCS
"ili934x_display_driver.c"
"memory_display_driver.c"
"ssd1306_display_driver.c"
"st7789_display_driver.c"
"spi_display.c"
"backlight_gpio.c"
PRIV_REQUIRES "libatomvm" "avm_sys" "avm_builtins" "driver" "sdmmc" "vfs" "fatfs"
Expand Down
3 changes: 3 additions & 0 deletions display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Context *acep_5in65_7c_display_driver_create_port(GlobalContext *global, term op
Context *ili934x_display_create_port(GlobalContext *global, term opts);
Context *memory_lcd_display_create_port(GlobalContext *global, term opts);
Context *ssd1306_display_create_port(GlobalContext *global, term opts);
Context *st7789_display_create_port(GlobalContext *global, term opts);

Context *display_create_port(GlobalContext *global, term opts)
{
Expand Down Expand Up @@ -64,6 +65,8 @@ Context *display_create_port(GlobalContext *global, term opts)
ctx = ssd1306_display_create_port(global, opts);
} else if (!strcmp(compat_string, "sino-wealth,sh1106")) {
ctx = ssd1306_display_create_port(global, opts);
} else if (!strcmp(compat_string, "sitronix,st7789")) {
ctx = st7789_display_create_port(global, opts);
} else {
ESP_LOGE(TAG, "No matching display driver for given `comptaible`: `%s`.", compat_string);
}
Expand Down
Loading

0 comments on commit 1aaf2b1

Please sign in to comment.