-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19944: cpu/esp32: add low-level LCD parallel interface using LCD peripheral r=benpicco a=gschorcht ### Contribution description This PR the implementation of the LCD low-level MCU 8080 parallel interface using the LCD peripheral for ESP32, ESP32-S2 and ESP32-S3 or `periph_gpio_ll` for the ESP32-C3. ### Testing procedure ``` BOARD=esp32s3-wt32-sc01-plus make -C tests/drivers/st77xx flash ``` should work on top of PR #19941. Drawing operations should be much faster. ### Issues/PRs references Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
- Loading branch information
Showing
17 changed files
with
722 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2022 Gunar Schorcht | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
# | ||
|
||
config MODULE_ESP_IDF_LCD | ||
bool | ||
depends on TEST_KCONFIG | ||
depends on MODULE_ESP_IDF && HAS_ESP_LCD | ||
|
||
default y if MODULE_LCD_PARALLEL_LL_MCU | ||
|
||
help | ||
ESP-IDF code for peripheral GPIO. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
MODULE = esp_idf_lcd | ||
|
||
# source files to be compiled for this module | ||
ESP32_SDK_SRC = \ | ||
components/esp_lcd/src/esp_lcd_common.c \ | ||
components/esp_lcd/src/esp_lcd_panel_io.c \ | ||
components/esp_pm/pm_locks.c \ | ||
components/soc/$(CPU_FAM)/lcd_periph.c \ | ||
# | ||
|
||
ifeq (esp32s3,$(CPU_FAM)) | ||
ESP32_SDK_SRC += \ | ||
components/driver/gdma.c \ | ||
components/esp_lcd/src/esp_lcd_panel_io_i80.c \ | ||
components/hal/gdma_hal.c \ | ||
components/hal/lcd_hal.c \ | ||
components/soc/$(CPU_FAM)/gdma_periph.c \ | ||
# | ||
else ifneq (,$(filter esp32 esp32s2,$(CPU_FAM))) | ||
ESP32_SDK_SRC = \ | ||
components/driver/i2s.c \ | ||
components/esp_lcd/src/esp_lcd_panel_io_i2s.c \ | ||
components/hal/i2s_hal.c \ | ||
# | ||
endif | ||
|
||
# additional include pathes required by this module | ||
INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_lcd/include | ||
INCLUDES += -I$(ESP32_SDK_DIR)/components/esp_lcd/interface | ||
|
||
include $(RIOTBASE)/Makefile.base | ||
|
||
ESP32_SDK_BIN = $(BINDIR)/$(MODULE) | ||
|
||
include ../esp_idf.mk | ||
include ../esp_idf_cflags.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright (c) 2023 Gunar Schorcht | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
# | ||
|
||
menuconfig MODULE_ESP_LCD | ||
bool "Enable LCD low-level parallel interface driver" | ||
depends on MODULE_LCD | ||
default y if HAVE_LCD_PARALLEL_LL_MCU | ||
help | ||
Enabe the MCU-driven low-level MCU 8080 8-/16-bit parallel interface | ||
driver. | ||
|
||
if MODULE_ESP_LCD | ||
|
||
config MODULE_ESP_LCD_GPIO | ||
bool "GPIO-driven low-level parallel interface driver" | ||
depends on !CPU_FAM_ESP32 && !CPU_FAM_ESP32S2 && !CPU_FAM_ESP32S3 | ||
default y | ||
help | ||
The ESP32x SoC variant used does not have a peripheral for the parallel | ||
low-level interface. However, it can be emulated with special low-level | ||
GPIO operations. It is faster than the GPIO-driven 8-/16-bit parallel | ||
interface implemented in the LCD driver, but requires 4 kByte RAM for | ||
8-bit data bus width and 8 kByte RAM for 16-bit data bus width. | ||
|
||
config LCD_WRITE_CLOCK_MHZ | ||
int "LCD write clock rate in MHz" | ||
range 1 80 | ||
depends on CPU_FAM_ESP32 || CPU_FAM_ESP32S2 || CPU_FAM_ESP32S3 | ||
default 10 if CPU_FAM_ESP32 | ||
default 40 if CPU_FAM_ESP32S2 | ||
default 20 if CPU_FAM_ESP32S3 | ||
help | ||
Defines the clock rate that is used for the LCD write signal. It | ||
depends on used ESP32x SoC variant and used display interface. | ||
|
||
config LCD_DATA_BUF_SIZE | ||
int "LCD data buffer size in byte" | ||
depends on CPU_FAM_ESP32 || CPU_FAM_ESP32S2 || CPU_FAM_ESP32S3 | ||
default 512 | ||
help | ||
Defines the size of the buffers used to write data to the LCD | ||
screen. Since double buffering is used, there are two buffers | ||
of this size. One buffer is used first by the LCD driver to | ||
write the data that needs to be transferred to the LCD, and | ||
one buffer from which the DMA then transfers the data to the | ||
LCD peripherals. This allows data to be written before the | ||
DMA transfer is complete. The larger the buffers, the better | ||
the performance, but the higher the memory requirements. | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MODULE = esp_lcd | ||
|
||
ifneq (,$(filter esp32 esp32s2 esp32s3,$(CPU_FAM))) | ||
SRC = esp_lcd_mcu.c | ||
else | ||
SRC = esp_lcd_gpio.c | ||
endif | ||
|
||
include $(RIOTBASE)/Makefile.base |
Oops, something went wrong.