From 6a0bc0e04e85a84b3c3bd01d009f101379fb0adf Mon Sep 17 00:00:00 2001 From: fvanroie Date: Wed, 16 Dec 2020 15:47:23 +0100 Subject: [PATCH] Add display pinout --- docs/displays/MHS4001.md | 55 +++++++++++++++++++ docs/displays/MRB3511.md | 71 +++++++++++++++++++++++++ docs/displays/Waveshare_40RPi_LCD(C).md | 61 +++++++++++++++++++++ include/lv_conf_v7.h | 4 +- 4 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 docs/displays/MHS4001.md create mode 100644 docs/displays/MRB3511.md create mode 100644 docs/displays/Waveshare_40RPi_LCD(C).md diff --git a/docs/displays/MHS4001.md b/docs/displays/MHS4001.md new file mode 100644 index 00000000..49ea3ecd --- /dev/null +++ b/docs/displays/MHS4001.md @@ -0,0 +1,55 @@ +6 GPIOs are required to drive the SPI display. One additional GPIO is needed for the XPT2046 touch sensor. Including the Vcc and Gnd pins, a total of 12 connections need to be made to the MCU: + +Pin |Function |ESP32 Pin |Config Name|Display Pin | +------|--------------------|-----------|-----------|------------| +1 |Module Power 3.3V |3.3V | |3.3V +2 |Module Power 5v |5V | |5V +3 | Not connected | | |NC +4 |~~LED Backlight PWM *5V*~~ | |~~TFT_BCKL~~|5V +5-10 | Not connected | | |NC +11 | Touch Interrupt |NC | |TP_IRQ +12-13 | Not connected | | |NC +14 |Module Ground |GND | |GND +15-16 | Not connected | | |NC +17 |Module Power |3.3V | |3.3V +18 |Data Command control pin|GPIO4 |TFT_DC |LCD_RS +19 |SPI Master Out Slave In |GPIO23 |TFT_MOSI |LCD/SI/TP_SI +20 |Not connected | | |NC +21 |Touch Panel Slave Out|GPIO19 |TFT_MISO |TP_SO +22 |LCD Reset pin |GPIO32 |TFT_RST |RST +23 |SPI Clock |GPIO18 |TFT_SCLK |LCD_SCK/TP_SCK +24 |Chip select control pin|GPIO15 |TFT_CS |LCD_CS +25 |Module Ground |GND | |GND +26 |Touch Chip Select |GPIO22 |TOUCH_CS |TP_CS + +~~By default, pin 4 is normally connected to 5V. This turns the display backlight LED on all time. In order to control the backlight you can drive pin 4 of the display using a PNP transistor. The electronics circuit needed is not part of this diagram.~~ + +SPI MISO, MOSI and SCLK are shared between the touch controller and the lcd controller. + +## lcd_mhs4001 config: +```ini +raspberrypi = + -D RPI_DISPLAY_TYPE=1 + -D ST7796_DRIVER=1 + -D TFT_WIDTH=320 + -D TFT_HEIGHT=480 + -D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree + -D SPI_FREQUENCY=80000000 + -D SPI_TOUCH_FREQUENCY=2500000 + -D USER_SETUP_LOADED=1 + -D TOUCH_DRIVER=0 ; XPT2606 Resistive touch panel driver + -D SUPPORT_TRANSACTIONS +``` + +## HASP build_flags +``` +build_flags = + ${flags.esp32_flags} +; -- TFT_eSPI build options ------------------------ + ${lcd.raspberrypi} + ${pins.vspi32} + -D TFT_CS=15 + -D TFT_DC=4 + -D TFT_RST=32 + -D TOUCH_CS=22 +``` \ No newline at end of file diff --git a/docs/displays/MRB3511.md b/docs/displays/MRB3511.md new file mode 100644 index 00000000..c8836100 --- /dev/null +++ b/docs/displays/MRB3511.md @@ -0,0 +1,71 @@ +14 GPIOs are required to drive the 8-bit parallel display. Another 3 GPIOs are needed for the I²C touch sensor. Including the Vcc, Gnd an Rst pins, a total of 23 connections need to be made to the MCU: + +Pin |Function |ESP32 Pin |Config Name|Display Pin | +------|--------------------|-----------|-----------|------------| +1 |Chip select control pin|GPIO33 |TFT_CS |CS +2 |Data Command control pin|GPIO15 |TFT_DC |RS +3 |Write control pin |GPIO04 |TFT_WR |WR +4 |Read control pin |GPIO02 |TFT_RD |RD +5 |LCD Reset pin |GPIO32 |TFT_RST |RST +6 | |GPIO12 |TFT_D0 |D0 +7 | |GPIO13 |TFT_D1 |D1 +8 | |GPIO26 |TFT_D2 |D2 +9 |8-bit parallel data |GPIO25 |TFT_D3 |D3 +10 | |GPIO17 |TFT_D4 |D4 +11 | |GPIO16 |TFT_D5 |D5 +12 | |GPIO27 |TFT_D6 |D6 +13 | |GPIO14 |TFT_D7 |D7 +14-21 |Not used, don't connect| NC | |D8-15 +22 |Module Ground |GND | |GND +23 |LED Backlight PWM |GPIO5 |TFT_BCKL |BL +24-25 |Module Power |- | |VDD +26-27 |Module Ground |GND | |GND +28-29 | Not connected | | |NC +30 |IO, I²C SDA |GPIO21 |TOUCH_SDA |SDA +31 |Touch Chip Interrupt|GPIO34 |TOUCH_IRQ |INT +32 | Not connected | | |NC +33 |Touch IC Reset |3.3V | |CRST +34 |IO, I²C SCL |GPIO22 |TOUCH_SCL |SCL + +You need to desolder the 0R resistor on the back side of the panel from the 16-bit position. Then resolder the 0R resistor in the 8-bit position. + +There are no pins shared between the touch controller and the lcd controller. + +## ${lcd.mrb3511} config: +```ini +mrb3511 = + -D ESP32_PARALLEL=1 + -D ILI9488_DRIVER=1 + -D TFT_WIDTH=320 + -D TFT_HEIGHT=480 + -D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree + -D USER_SETUP_LOADED=1 + -D TOUCH_DRIVER=1 ; GT911 Capacitive touch panel driver + -D SUPPORT_TRANSACTIONS +``` + +## HASP build_flags +``` +build_flags = + ${flags.esp32_flags} +; -- TFT_eSPI build options ------------------------ + ${lcd.mrb3511} + -D TFT_BCKL=5 ;None, configurable via web UI (e.g. 2 for D4) + -D TFT_CS=33 ; Chip select control pin + -D TFT_DC=15 ; =RS; Data Command control pin - must use a pin in the range 0-31 + -D TFT_RST=32 ; Reset pin + -D TFT_WR=4 ; Write strobe control pin - must use a pin in the range 0-31 + -D TFT_RD=2 + -D TFT_D0=12 ; Must use pins in the range 0-31 for the data bus + -D TFT_D1=13 ; so a single register write sets/clears all bits + -D TFT_D2=26 + -D TFT_D3=25 + -D TFT_D4=17 + -D TFT_D5=16 + -D TFT_D6=27 + -D TFT_D7=14 + -D TOUCH_SDA=21 + -D TOUCH_SCL=22 + -D TOUCH_IRQ=34 ; use 34-39 as these are input only pins + -D TOUCH_RST=-1 ; not used, connected to 3.3V +``` \ No newline at end of file diff --git a/docs/displays/Waveshare_40RPi_LCD(C).md b/docs/displays/Waveshare_40RPi_LCD(C).md new file mode 100644 index 00000000..f25d0f37 --- /dev/null +++ b/docs/displays/Waveshare_40RPi_LCD(C).md @@ -0,0 +1,61 @@ + +## WaveShare 4.0" RPi LCD (rev C) + +6 GPIOs are required to drive the SPI display. One additional GPIO is needed for the XPT2046 touch sensor and one extra GPIO for backlight dimming. +Including the Vcc and Gnd pins, a total of 13 connections need to be made to the MCU: + +Pin |Function |ESP32 Pin |Config Name|Display Pin | +------|--------------------|-----------|-----------|------------| +1 |Module Power 3.3V |3.3V | |3.3V +2 |Module Power 5v |5V | |5V +3 | Not connected | | |NC +4 | | | |5V +5-10 | Not connected | | |NC +11 | Touch Interrupt |NC | |TP_IRQ +12 (*)| LED Backlight PWM | |TFT_BCKL |LCD_LED +13 | Not connected | | |NC +14 |Module Ground |GND | |GND +15-16 | Not connected | | |NC +17 |Module Power |3.3V | |3.3V +18 |Data Command control pin|GPIO4 |TFT_DC |LCD_RS +19 |SPI Master Out Slave In |GPIO23 |TFT_MOSI |LCD/SI/TP_SI +20 |Not connected | | |NC +21 |Touch Panel Slave Out|GPIO19 |TFT_MISO |TP_SO +22 |LCD Reset pin |GPIO32 |TFT_RST |RST +23 |SPI Clock |GPIO18 |TFT_SCLK |LCD_SCK/TP_SCK +24 |Chip select control pin|GPIO15 |TFT_CS |LCD_CS +25 |Module Ground |GND | |GND +26 |Touch Chip Select |GPIO22 |TOUCH_CS |TP_CS + +!> (*)Only the WaveShare 4.0" RPi LCD Revision C has a solder jumper on the back to enable PWM backlight dimming. +Other revisions of this board do not have this feature. + +SPI MISO, MOSI and SCLK are shared between the touch controller and the lcd controller. + +## lcd_mhs4001 config: +```ini +raspberrypi = + -D RPI_DISPLAY_TYPE=1 + -D ST7796_DRIVER=1 + -D TFT_WIDTH=320 + -D TFT_HEIGHT=480 + -D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree + -D SPI_FREQUENCY=80000000 + -D SPI_TOUCH_FREQUENCY=2500000 + -D USER_SETUP_LOADED=1 + -D TOUCH_DRIVER=0 ; XPT2606 Resistive touch panel driver + -D SUPPORT_TRANSACTIONS +``` + +## HASP build_flags +``` +build_flags = + ${flags.esp32_flags} +; -- TFT_eSPI build options ------------------------ + ${lcd.raspberrypi} + ${pins.vspi32} + -D TFT_CS=15 + -D TFT_DC=4 + -D TFT_RST=32 + -D TOUCH_CS=22 +``` \ No newline at end of file diff --git a/include/lv_conf_v7.h b/include/lv_conf_v7.h index b3d03678..8939161f 100644 --- a/include/lv_conf_v7.h +++ b/include/lv_conf_v7.h @@ -554,10 +554,10 @@ typedef struct { #define LV_USE_LABEL 1 #if LV_USE_LABEL != 0 /*Hor, or ver. scroll speed [px/sec] in 'LV_LABEL_LONG_ROLL/ROLL_CIRC' mode*/ -# define LV_LABEL_DEF_SCROLL_SPEED 25 +# define LV_LABEL_DEF_SCROLL_SPEED 20 // default 25 /* Waiting period at beginning/end of animation cycle */ -# define LV_LABEL_WAIT_CHAR_COUNT 3 +# define LV_LABEL_WAIT_CHAR_COUNT 5 // default 3 /*Enable selecting text of the label */ # define LV_LABEL_TEXT_SEL 0