Git Product home page Git Product logo

esp-idf-st7789's Introduction

esp-idf-st7789

ST7789 Driver for esp-idf

The demo video by Dmitry Andreev.
https://www.youtube.com/watch?v=aOyaK0pUiPk&t

Software requirements

ESP-IDF V4.4/V5.x.

Installation for ESP-IDF V4.4

git clone -b v4.4 https://github.com/nopnop2002/esp-idf-st7789
cd esp-idf-st7789/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c3}
idf.py menuconfig
idf.py flash

Note for ESP32-S2
The tjpgd library is not included in the ESP32-S2 ROM because the ROM of the ESP32-S2 is small.
Therefore, JPEG files cannot be displayed.

Note for ESP32-C3
For some reason, there are development boards that cannot use GPIO06, GPIO08, GPIO09, GPIO19 for SPI clock pins.
According to the ESP32-C3 specifications, these pins can also be used as SPI clocks.
I used a raw ESP-C3-13 to verify that these pins could be used as SPI clocks.

Installation for ESP-IDF V5.x

git clone https://github.com/nopnop2002/esp-idf-st7789
cd esp-idf-st7789/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash

Note for ESP32-S2/ESP32-C2
The tjpgd library is not included in the ESP32-S2/ESP32-C2 ROM.
However, you can use this IDF component registry.
JPEG files can be displayed.

Note for ESP32-C6
ESP-IDF V5.1 is required when using ESP32-C6.

Configuration

config-top

Generic ST7789 1.3 Inch

There is 2 kinds of marking.
The pin marking is written as SCL/SDA, so it looks like i2c, but it is SPI.
SCL is SCLK, SDA is MOSI.
st7789-back

config-240x240

MISO is not use.

st7789-1 st7789-2 st7789-3 st7789-4 st7789-5 st7789-6 st7789-7 st7789-8 st7789-9 st7789-10

BMP file
st7789-11

JPEG file(ESP32/ESP32S2/ESP32C3)
st7789-JPEG

PNG file
st7789-PNG

QR-CODE
st7789-QRCODE

Generic ST7789 1.14 Inch

st7789-135x240-2 st7789-135x240-1

Generic ST7789 1.9 Inch

st7789-170x320-1 st7789-170x320-2 st7789-170x320-3 config

Generic ST7789 2.0 Inch

st778-240x320-1 st778-240x320-2 st778-240x320-3 st7789-240x320-4

SPI Clock speed

According to the ST7789 datasheet, the minimum SPI clock cycle time is 16ns.
Therefore, the maximum SPI clock frequency is 62.5MHz.
The SPI clock frequency used by this project is 20MHz.
Higher SPI clock frequencies can be specified using spi_clock_speed().
When using higher SPI clock frequencies, you need to be careful about the length of the wire cable.

    //int speed = 40000000; // 40MHz
    int speed = 60000000; // 60MHz
    spi_clock_speed(speed);
    spi_master_init(&dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO, CONFIG_BL_GPIO);
    lcdInit(&dev, CONFIG_WIDTH, CONFIG_HEIGHT, CONFIG_OFFSETX, CONFIG_OFFSETY);
  • Benchmarking using ESP32 & 1.3 inch TFT Without Frame Buffer.
    Clock up has little effect.
20MHz 40MHz 60MHz
FillTest 1150 1090 1090
ColorBarTest 50 50 50
ArrowTest 280 250 250
LineTest 2190 2150 2150
CircleTest 1940 1910 1910
RoundRectTest 1980 1940 1940
DirectionTest 450 430 430
HorizontalTest 1070 1040 1040
VerticalTest 1070 1040 1040
FillRectTest 190 150 150
ColorTest 260 220 220
CodeTest 1070 1040 1040
BMPTest 7160 7130 7130
JPEGTest 2550 2530 2530
PNGTest 2850 2830 2830
QRTest 220 170 170
  • Benchmarking using ESP32 & 1.3 inch TFT With Frame Buffer.
    The effect of clocking up varies depending on the test case.
20MHz 40MHz 60MHz
FillTest 1150 1090 1090
ColorBarTest 70 50 50
ArrowTest 60 30 30
LineTest 50 30 30
CircleTest 60 30 30
RoundRectTest 50 30 30
DirectionTest 70 50 50
HorizontalTest 70 40 40
VerticalTest 70 40 40
FillRectTest 60 30 30
ColorTest 60 30 30
CodeTest 100 80 80
BMPTest 7490 7470 7470
JPEGTest 2550 2530 2530
PNGTest 2850 2830 2830
QRTest 120 100 100

SPI BUS selection

config-spi-bus

The ESP32 series has three SPI BUSs.
SPI1_HOST is used for communication with Flash memory.
You can use SPI2_HOST and SPI3_HOST freely.
When you use SDSPI(SD Card via SPI), SDSPI uses SPI2_HOST BUS.
When using this module at the same time as SDSPI or other SPI device using SPI2_HOST, it needs to be changed to SPI3_HOST.
When you don't use SDSPI, both SPI2_HOST and SPI3_HOST will work.
Previously it was called HSPI_HOST / VSPI_HOST, but now it is called SPI2_HOST / SPI3_HOST.

Using Frame Buffer

config-frame-buffer

When FrameBuffer is enabled, all output will be stored in the internal FrameBuffer and reflected to the device with lcdDrawFinish.
If you don't use FrameBuffer, lcdDrawFinish does nothing.
If your main purpose is to display text, it's well worth using FrameBuffer.
If your main purpose is to display images, there is no value in using FrameBuffer.
Enabling FrameBuffer does not make image display faster.
This is because image analysis takes time.
ESP32C2 has too small memory to use this function.
Note that using FrameBuffer consumes memory.

If your SoC has PSRAM, you can avoid running out of memory by enabling PSRAM.
ESP32S2 has less RAM, but some ESP32S2 have PSRAM.

Benchmarking using ESP32 & 1.3 inch TFT

Without Frame Buffer With Frame Buffer
FillTest 1150 1150
ColorBarTest 50 70
ArrowTest 280 60
LineTest 2190 50
CircleTest 1940 60
RoundRectTest 1980 50
DirectionTest 450 70
HorizontalTest 1070 70
VerticalTest 1070 70
FillRectTest 190 60
ColorTest 260 60
CodeTest 1070 100
BMPTest 7160 7060
JPEGTest 2550 2550
PNGTest 2850 2840
QRTest 220 120

LILYGO TTGO 1.14 Inch ESP32

ttgo-1 ttgo-2

LILYGO TTGO T8 ESP32-S2

TTGO_T8_ESP32-S2-1 TTGO_T8_ESP32-S2-2

Custom PCB

Details can be found here.

esp32s2-pcb-1 esp32s2_pcb-2

JPEG Decoder

The ESP-IDF component includes Tiny JPEG Decompressor.
The document of Tiny JPEG Decompressor is here.
This can reduce the image to 1/2 1/4 1/8.

PNG Decoder

The ESP-IDF component includes part of the miniz library, such as mz_crc32.
But it doesn't support all of the miniz.
The document of miniz library is here.

And I ported the pngle library from here.
This can reduce the image to any size.

Font File

You can add your original fonts.
The format of the font file is the FONTX format.
Your font file is put in font directory.
Your font file is uploaded to SPIFFS partition using meke flash.

Please refer this page about FONTX format.

Font File Editor(FONTX Editor)

There is a font file editor.
This can be done on Windows 10.
Developer page is here.

FontxEditor

This library uses the following as default fonts:

  • font/ILGH16XB.FNT // 8x16Dot Gothic
  • font/ILGH24XB.FNT // 12x24Dot Gothic
  • font/ILGH32XB.FNT // 16x32Dot Gothic
  • font/ILMH16XB.FNT // 8x16Dot Mincyo
  • font/ILMH24XB.FNT // 12x24Dot Mincyo
  • font/ILMH32XB.FNT // 16x32Dot Mincyo

From 0x00 to 0x7f, the characters image of Alphanumeric are stored.
From 0x80 to 0xff, the characters image of Japanese are stored.
Changing this file will change the font.

How to build your own font file

step1)
download fontxedit.exe.

step2)
download BDF font file from Internet.
I downloaded from here.
fontxedit.exe can ONLY import Monospaced bitmap fonts file.
Monospaced bitmap fonts can also be downloaded here.

step3)
import the BDF font file into your fontxedit.exe.
this tool can convert from BDF to FONTX.
FONTX-EDITTOR-1

step4)
adjust font size.
FONTX-EDITTOR-2

step5)
check font pattern.
FONTX-EDITTOR-13

step6)
save as .fnt file from your fontedit.exe.
FONTX-EDITTOR-14

step7)
upload your font file to $HOME/esp-idf-st7789/fonts directory.

step8)
add font to use

FontxFile fx32L[2];
InitFontx(fx32L,"/spiffs/LATIN32B.FNT",""); // 16x32Dot LATIN

Font file that From 0x80 to 0xff, the characters image of Japanese are stored.
st7789-KANA

Font file that From 0x80 to 0xff, the characters image of Latin are stored.
st7789-LATIN

How to add your color

Change here.

#define RED    rgb565(255,   0,   0) // 0xf800
#define GREEN  rgb565(  0, 255,   0) // 0x07e0
#define BLUE   rgb565(  0,   0, 255) // 0x001f
#define BLACK  rgb565(  0,   0,   0) // 0x0000
#define WHITE  rgb565(255, 255, 255) // 0xffff
#define GRAY   rgb565(128, 128, 128) // 0x8410
#define YELLOW rgb565(255, 255,   0) // 0xFFE0
#define CYAN   rgb565(  0, 156, 209) // 0x04FA
#define PURPLE rgb565(128,   0, 128) // 0x8010

External input module

You can use these if you need some input.

esp-idf-st7789's People

Contributors

beoran avatar hossein-m98 avatar nopnop2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-idf-st7789's Issues

fontx.c needs to be added to CMakeLists in order to compile

Hi. Thanks for your effort creating this library. I had to add fontx.c to compile without errors. The create partition line will load the STIFFs.

set(COMPONENT_SRCS "st7789.c" "main.c" fontx.c)
set(COMPONENT_ADD_INCLUDEDIRS ".")

register_component()
spiffs_create_partition_image(storage ../font FLASH_IN_PROJECT)

PlatformIO IDE use

image

board_build.partitions = partitions_example.csv

image

spiffs_create_partition_image(storage ../font FLASH_IN_PROJECT)

image

image

image

pio run -t menuconfig

Run the program

06A38A105C93B0314E000E3CD7DE9EED.mp4

SPI data is sampled on rising edge of clock, wrong mode?

Connecting a waveshare screen to an esp32-s3 it did not work, after looking in datasheet of the screen:
(https://www.waveshare.com/w/upload/a/ae/ST7789_Datasheet.pdf)

image

and the timings:
image

it looks like that the data is sampled on the rising edge of the clock. This should indicate it is spi mode 0 or 3. In diagram clock idles low so 0?. Changing this also fixes the black screen and I get a working demo.
image

I am not sure if waveshare uses a slightly different version of the chip?

Thanks for the library.

(I got a déjà vu feeling, but could not find earlier issue. might have been somewhere else.).

SVG logging

I implemented SVG output via ESP logging and sent you a pull request (#30). This is really handy for making screen captures, which is otherwise tricky on the device. Attached are the SVG renderings of the test cases from main.c. Since the SVG output doesn't really understand the animations in some of the test cases, what you see in the SVG is usually the final result even though all of the graphical steps are in the SVG file.

samples.zip

How to display 1 bit depth BMP image?

Hello, I am using BMPTest function in esp_idf library st7789 but this function only supports displaying BMP image with 24 bit depth.
Here is the command line:
if((result->dib.depth == 24) && (result->dib.compress_type == 0)){
....................................................
}
How to print 1 bit depth BMP image? Please help me fix it, I'm looking forward to your help.
Thanks.

Blank Display

Hi, I'm trying to use the library but I can't make it work. I already did the configuration as you show in the pictures, the program compile and runs well but never shows anything on the display. I also test the display with and Arduino library and works perfect. Could you give some idea to make it work? Thanks.
Captura

No demo appears on screen

Hi,
I have been trying to run this demo on an 1.3" display with ST7889 driver connected to a ESP32C3 board. I believe that the pin connections are fine because I managed to get some small example running on Rust with the same wiring. I get this output in the monitor (debug level activated). I don't see any error, but something is still not right.

Executing action: monitor
Serial port /dev/ttyUSB0
Connecting....ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x16c8
load:0x403ce000,len:0x930
load:0x403d0000,len:0x2d40
entry 0x403ce000
I (30) boot: ESP-IDF v4.4-84-g257d95fc22-dirty 2nd stage bootloader
I (30) boot: compile time 22:34:31
I (30) boot: chip revision: 3
I (33) boot.esp32c3: SPI Speed      : 80MHz
I (38) boot.esp32c3: SPI Mode       : DIO
I (43) boot.esp32c3: SPI Flash Size : 2MB
I (48) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (57) boot: ## Label            Usage          Type ST Offset   Length
I (64) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (71) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (79) boot:  2 factory          factory app      00 00 00010000 00100000
I (86) boot:  3 storage          Unknown data     01 82 00110000 000f0000
I (94) boot: End of partition table
I (98) esp_image: segment 0: paddr=00010020 vaddr=3c030020 size=0a5d8h ( 42456) map
I (113) esp_image: segment 1: paddr=0001a600 vaddr=3fc8be00 size=0157ch (  5500) load
I (116) esp_image: segment 2: paddr=0001bb84 vaddr=40380000 size=04494h ( 17556) load
I (127) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=284e4h (165092) map
I (158) esp_image: segment 4: paddr=0004850c vaddr=40384494 size=07804h ( 30724) load
I (164) esp_image: segment 5: paddr=0004fd18 vaddr=50000010 size=00010h (    16) load
I (167) boot: Loaded app from partition at offset 0x10000
I (169) boot: Disabling RNG early entropy source...
I (186) cpu_start: Pro cpu up.
D (186) efuse: In EFUSE_BLK2__DATA4_REG is used 3 bits starting with 0 bit
D (187) efuse: In EFUSE_BLK2__DATA4_REG is used 8 bits starting with 12 bit
D (193) efuse: In EFUSE_BLK1__DATA3_REG is used 3 bits starting with 18 bit
D (200) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 5 bit
D (207) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 7 bit
D (214) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 14 bit
D (221) efuse: In EFUSE_BLK1__DATA4_REG is used 8 bits starting with 21 bit
D (228) efuse: In EFUSE_BLK1__DATA4_REG is used 3 bits starting with 29 bit
D (235) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 0 bit
D (249) clk: RTC_SLOW_CLK calibration value: 3775962
I (258) cpu_start: Pro cpu start user code
I (258) cpu_start: cpu freq: 160000000
I (258) cpu_start: Application information:
I (261) cpu_start: Project name:     st7789
I (266) cpu_start: App version:      bd9dcac-dirty
I (271) cpu_start: Compile time:     Jan 28 2022 22:34:30
I (277) cpu_start: ELF file SHA256:  dc6250632bdfbf57...
I (283) cpu_start: ESP-IDF:          v4.4-84-g257d95fc22-dirty
D (290) memory_layout: Checking 4 reserved memory ranges:
D (295) memory_layout: Reserved memory range 0x3fc80000 - 0x3fc8be00
D (302) memory_layout: Reserved memory range 0x3fc8be00 - 0x3fc8ea10
D (308) memory_layout: Reserved memory range 0x3fcdf060 - 0x3fce0000
D (315) memory_layout: Reserved memory range 0x50000000 - 0x50000020
D (321) memory_layout: Building list of available memory regions:
D (327) memory_layout: Available memory region 0x3fc8ea10 - 0x3fca0000
D (334) memory_layout: Available memory region 0x3fca0000 - 0x3fcc0000
D (340) memory_layout: Available memory region 0x3fcc0000 - 0x3fcdf060
D (347) memory_layout: Available memory region 0x50000020 - 0x50002000
I (354) heap_init: Initializing. RAM available for dynamic allocation:
D (361) heap_init: New heap initialised at 0x3fc8ea10
I (366) heap_init: At 3FC8EA10 len 000315F0 (197 KiB): DRAM
I (372) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
D (379) heap_init: New heap initialised at 0x50000020
I (384) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
D (391) FLASH_HAL: extra_dummy: 0
D (394) spi_flash: trying chip: issi
D (398) spi_flash: trying chip: gd
D (401) spi_flash: trying chip: mxic
D (405) spi_flash: trying chip: winbond
D (409) spi_flash: trying chip: boya
D (412) spi_flash: trying chip: generic
I (416) spi_flash: detected chip: generic
I (421) spi_flash: flash io: dio
D (425) cpu_start: calling init function: 0x4200002a
D (430) intr_alloc: Connected src 39 to int 2 (cpu 0)
I (435) sleep: Configure to isolate all GPIO pins in sleep state
I (442) sleep: Enable automatic switching of GPIO sleep configuration
D (449) intr_alloc: Connected src 50 to int 3 (cpu 0)
I (454) cpu_start: Starting scheduler.
D (458) intr_alloc: Connected src 37 to int 4 (cpu 0)
D (458) heap_init: New heap initialised at 0x3fcc0000
D (458) intr_alloc: Connected src 33 to int 7 (cpu 0)
I (468) ST7789: Initializing SPIFFS
D (468) partition: Loading the partition table
D (468) partition: Partition table MD5 verified
I (498) ST7789: Partition size: total: 896321, used: 313499
I (498) SPIFFS_Directory: d_name=esp_logo.png d_ino=0 d_type=1
I (498) SPIFFS_Directory: d_name=LATIN32B.FNT d_ino=0 d_type=1
I (508) SPIFFS_Directory: d_name=ILMH32XB.FNT d_ino=0 d_type=1
I (518) SPIFFS_Directory: d_name=image.bmp d_ino=0 d_type=1
I (528) SPIFFS_Directory: d_name=ILMH16XB.FNT d_ino=0 d_type=1
I (528) SPIFFS_Directory: d_name=esp32.jpeg d_ino=0 d_type=1
I (538) SPIFFS_Directory: d_name=ILGH16XB.FNT d_ino=0 d_type=1
I (538) SPIFFS_Directory: d_name=ILMH24XB.FNT d_ino=0 d_type=1
I (548) SPIFFS_Directory: d_name=ILGH32XB.FNT d_ino=0 d_type=1
I (558) SPIFFS_Directory: d_name=ILGH24XB.FNT d_ino=0 d_type=1
I (568) ST7789: GPIO_CS=-1
I (568) ST7789: GPIO_DC=8
I (568) gpio: GPIO[8]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (578) ST7789: GPIO_RESET=9
I (578) gpio: GPIO[9]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
D (588) ST7789: ms=50 _ms=59 portTICK_PERIOD_MS=10 xTicksToDelay=5
D (648) ST7789: ms=100 _ms=109 portTICK_PERIOD_MS=10 xTicksToDelay=10
D (748) ST7789: ms=50 _ms=59 portTICK_PERIOD_MS=10 xTicksToDelay=5
I (798) ST7789: GPIO_BL=18
I (798) gpio: GPIO[18]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (798) ST7789: GPIO_MOSI=7
I (798) ST7789: GPIO_SCLK=6
D (798) gdma: new group (0) at 0x3fc909b4
D (808) gdma: new pair (0,0) at 0x3fc909e0
D (808) gdma: new tx channel (0,0) at 0x3fc9234c
D (818) gdma: new rx channel (0,0) at 0x3fc90a00
D (818) spi: SPI2 use iomux pins.
D (818) ST7789: spi_bus_initialize=0
D (828) intr_alloc: Connected src 19 to int 9 (cpu 0)
D (828) spi_hal: eff: 20000, limit: 80000k(/0), 0 dummy, -1 delay
D (838) spi_master: SPI2: New device added to CS5, effective clock: 20000kHz
D (848) ST7789: spi_bus_add_device=0
D (848) ST7789: ms=150 _ms=159 portTICK_PERIOD_MS=10 xTicksToDelay=15
D (1008) ST7789: ms=255 _ms=264 portTICK_PERIOD_MS=10 xTicksToDelay=26
D (1268) ST7789: ms=10 _ms=19 portTICK_PERIOD_MS=10 xTicksToDelay=1
D (1278) ST7789: ms=10 _ms=19 portTICK_PERIOD_MS=10 xTicksToDelay=1
D (1288) ST7789: ms=10 _ms=19 portTICK_PERIOD_MS=10 xTicksToDelay=1
D (1298) ST7789: ms=255 _ms=264 portTICK_PERIOD_MS=10 xTicksToDelay=26
D (1558) ST7789: offset(x)=0 offset(y)=0
D (2108) ST7789: offset(x)=0 offset(y)=0
D (2658) ST7789: offset(x)=0 offset(y)=0
I (3208) FillTest: elapsed time[ms]:1650
D (7208) ST7789: offset(x)=0 offset(y)=0
D (7228) ST7789: offset(x)=0 offset(y)=0
D (7248) ST7789: offset(x)=0 offset(y)=0
I (7258) ColorBarTest: elapsed time[ms]:50
D (11268) ST7789: offset(x)=0 offset(y)=0
I (11548) ArrowTest: elapsed time[ms]:280
D (15548) ST7789: offset(x)=0 offset(y)=0

I have followed the instructions on the page, and I am also using ESP-IDF 4.4 for this (I checked out today the release/v4.4 branch)

$ idf.py --version
ESP-IDF v4.4-84-g257d95fc22-dirty

Any ideas? Thanks for your help!

decode_image.c not included in cmake

/root/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.JPEGTest+0x8): undefined reference to `decode_image'

You probably forget it:
set(COMPONENT_SRCS main.c st7789.c fontx.c decode_image.c)

Can not auto reset on my board

The screen cant reset after I flash the code. After I double the delay of reset pin it can auto reset now.

	if ( GPIO_RESET >= 0 ) {
		//gpio_pad_select_gpio( GPIO_RESET );
		gpio_reset_pin( GPIO_RESET );
		gpio_set_direction( GPIO_RESET, GPIO_MODE_OUTPUT );
		gpio_set_level( GPIO_RESET, 1 );
		delayMS(50);
		gpio_set_level( GPIO_RESET, 0 );
		// change from 50
		delayMS(100);
		gpio_set_level( GPIO_RESET, 1 );
		delayMS(50);
	}

did you original this st7789 library?

I'm curious if you created this st7789 library or if it's derived from something else. I'm asking because I'm planning to use it in a small project of my own, and I want to give proper credit in my documentation. (In any case, thanks for your work here.)

Video playing

Hi, is it possible to play video on LILYGO TTGO T8 ESP32-S2?

Preventing black screen while refreshing text

Hi,
i measure values every second an print them onto the screen. To clear old values i first fill the screen black and then draw the text. That results in a visible "refresh" effect, everything is black and the text slowly appears again line per line.
Is it possible to draw everything in a frame buffer and then paint the screen at once? So that there isn't a completly black screen for one frame. Thanks and cool library!

TFT backlight not powered on for Lilygo TTGO T-Watch-2020

I am trying to use your library with a Lilygo TTGO T-Watch-2020
https://www.tindie.com/products/ttgo/lilygor-ttgo-t-watch-2020/
I am using the correct pins and I tried several SPI frequencies but the display is not powered on, even if I set the backlight pin.

The lvgl esp32 port here:
https://github.com/lvgl/lv_port_esp32/blob/master/components/lvgl_esp32_drivers/lvgl_tft/st7789.c
does work correctly, so I assume something is wrong with the device initialization.
How could I find out what is going wrong?

Slow Refresh Rate of ST7789 Screen Compared to ESP-IDF Screen Library

I've been using the ESP-IDF-ST7789 library for my project, and while I love the rendering capabilities of the GFX, I have noticed that the refresh rate of the ST7789 screen is significantly slower compared to the screen library of the ESP-IDF.

I believe that this issue could potentially hinder the performance of certain projects that rely heavily on fast refresh rates. It would be great if there could be some improvements made to the library to enhance the refresh rate of the ST7789 screen and bring it closer to the performance of the ESP-IDF screen library.

Thank you for your hard work on this library, and I look forward to seeing how this issue can be addressed.

Fontx: not found.

Like this:
image
How should I put the font file into SPIFFS Filesystem?

Not working in ESP-IDF5.0

I just clone this repo, set pins in menuconfig and no see demo
Display backlight changes correctly, but not displaying demo.
Also: in esp-idf5.0 i had to fix types in ESP_LOG calls.

UART log
I (30) boot: ESP-IDF v5.0-beta1-473-geea8629fa1-dirt 2nd stage bootloader
I (30) boot: compile time 21:22:17
I (31) boot: chip revision: V100
I (35) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (42) boot.esp32: SPI Speed      : 40MHz
I (47) boot.esp32: SPI Mode       : DIO
I (52) boot.esp32: SPI Flash Size : 2MB
I (56) boot: Enabling RNG early entropy source...
I (62) boot: Partition Table:
I (65) boot: ## Label            Usage          Type ST Offset   Length
I (72) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (80) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (87) boot:  2 factory          factory app      00 00 00010000 00100000
I (95) boot:  3 storage          Unknown data     01 82 00110000 000f0000
I (102) boot: End of partition table
I (107) boot_comm: chip revision: 1, min. application chip revision: 0
I (114) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=0b7d4h ( 47060) map
I (139) esp_image: segment 1: paddr=0001b7fc vaddr=3ffb0000 size=02a10h ( 10768) load
I (144) esp_image: segment 2: paddr=0001e214 vaddr=40080000 size=01e04h (  7684) load
I (148) esp_image: segment 3: paddr=00020020 vaddr=400d0020 size=260f0h (155888) map
I (210) esp_image: segment 4: paddr=00046118 vaddr=40081e04 size=0b68ch ( 46732) load
I (229) esp_image: segment 5: paddr=000517ac vaddr=50000000 size=00010h (    16) load
I (237) boot: Loaded app from partition at offset 0x10000
I (237) boot: Disabling RNG early entropy source...
I (249) cpu_start: Pro cpu up.
I (250) cpu_start: Starting app cpu, entry point is 0x40081148
I (0) cpu_start: App cpu up.
I (264) cpu_start: Pro cpu start user code
I (264) cpu_start: cpu freq: 240000000 Hz
I (264) cpu_start: Application information:
I (269) cpu_start: Project name:     st7789
I (274) cpu_start: App version:      1
I (278) cpu_start: Compile time:     Nov  4 2022 22:59:37
I (284) cpu_start: ELF file SHA256:  dd5bdf4f472a3adf...
I (290) cpu_start: ESP-IDF:          v5.0-beta1-473-geea8629fa1-dirt
I (297) heap_init: Initializing. RAM available for dynamic allocation:
I (304) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (310) heap_init: At 3FFB3B38 len 0002C4C8 (177 KiB): DRAM
I (317) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (323) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (329) heap_init: At 4008D490 len 00012B70 (74 KiB): IRAM
I (337) spi_flash: detected chip: generic
I (340) spi_flash: flash io: dio
W (344) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (358) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (368) ST7789: Initializing SPIFFS
I (458) ST7789: Partition size: total: 896321, used: 321782
I (458) SPIFFS_Directory: d_name=esp32.jpeg d_ino=0 d_type=1
I (458) SPIFFS_Directory: d_name=esp_logo.png d_ino=0 d_type=1
I (468) SPIFFS_Directory: d_name=ILGH16XB.FNT d_ino=0 d_type=1
I (468) SPIFFS_Directory: d_name=ILGH24XB.FNT d_ino=0 d_type=1
I (478) SPIFFS_Directory: d_name=ILGH32XB.FNT d_ino=0 d_type=1
I (478) SPIFFS_Directory: d_name=ILMH16XB.FNT d_ino=0 d_type=1
I (488) SPIFFS_Directory: d_name=ILMH24XB.FNT d_ino=0 d_type=1
I (498) SPIFFS_Directory: d_name=ILMH32XB.FNT d_ino=0 d_type=1
I (498) SPIFFS_Directory: d_name=image.bmp d_ino=0 d_type=1
I (518) SPIFFS_Directory: d_name=LATIN32B.FNT d_ino=0 d_type=1
I (518) SPIFFS_Directory: d_name=qrcode.bmp d_ino=0 d_type=1
I (538) ST7789: GPIO_CS=-1
I (538) ST7789: GPIO_DC=27
I (548) gpio: GPIO[27]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (548) ST7789: GPIO_RESET=33
I (548) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (738) ST7789: GPIO_BL=32
I (738) gpio: GPIO[32]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (738) ST7789: GPIO_MOSI=23
I (738) ST7789: GPIO_SCLK=18
I (3138) FillTest: elapsed time[ms]:1650
I (7188) ColorBarTest: elapsed time[ms]:50
I (11458) ArrowTest: elapsed time[ms]:270
I (17588) LineTest: elapsed time[ms]:2130
I (23478) CircleTest: elapsed time[ms]:1890
I (29408) RoundRectTest: elapsed time[ms]:1930
I (39408) RectAngleTest: elapsed time[ms]:6000
I (50398) TriangleTest: elapsed time[ms]:6980
I (54828) DirectionTest: elapsed time[ms]:430
I (59878) HorizontalTest: elapsed time[ms]:1050
I (64928) VerticalTest: elapsed time[ms]:1050
I (69118) FillRectTest: elapsed time[ms]:190
I (73358) ColorTest: elapsed time[ms]:240
I (78378) CodeTest: elapsed time[ms]:1020
I (84018) CodeTest: elapsed time[ms]:1640
I (95288) BMPTest: elapsed time[ms]:7270
I (101858) JPEGTest: elapsed time[ms]:2570
I (108658) PNGTest: elapsed time[ms]:2800
I (112848) QRTest: elapsed time[ms]:190
I (123308) FillTest: elapsed time[ms]:1650
I (127358) ColorBarTest: elapsed time[ms]:50
I (131628) ArrowTest: elapsed time[ms]:270
I (137758) LineTest: elapsed time[ms]:2130
I (143648) CircleTest: elapsed time[ms]:1890
I (149578) RoundRectTest: elapsed time[ms]:1930
I (159578) RectAngleTest: elapsed time[ms]:6000
I (170568) TriangleTest: elapsed time[ms]:6980
I (174998) DirectionTest: elapsed time[ms]:430
I (180048) HorizontalTest: elapsed time[ms]:1050
I (185098) VerticalTest: elapsed time[ms]:1050
I (189318) FillRectTest: elapsed time[ms]:220
I (193558) ColorTest: elapsed time[ms]:240
I (198578) CodeTest: elapsed time[ms]:1020
I (204208) CodeTest: elapsed time[ms]:1630
I (215448) BMPTest: elapsed time[ms]:7240

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.