esp-who/components/lcd
XiaochaoGONG bf9fe9ea9c Init commit 2018-10-26 21:09:52 +08:00
..
Adafruit-GFX-Library Init commit 2018-10-26 21:09:52 +08:00
include Init commit 2018-10-26 21:09:52 +08:00
test Init commit 2018-10-26 21:09:52 +08:00
README.md Init commit 2018-10-26 21:09:52 +08:00
adaptation.cpp Init commit 2018-10-26 21:09:52 +08:00
component.mk Init commit 2018-10-26 21:09:52 +08:00
font7s.c Init commit 2018-10-26 21:09:52 +08:00
iot_lcd.cpp Init commit 2018-10-26 21:09:52 +08:00
spi_lcd.c Init commit 2018-10-26 21:09:52 +08:00

README.md

##TFT LCD Example Code for ESP32##

This example is based on Adafruits Library for ILI9341. This component can display

  1. Text
  2. Bitmap Images
  3. Shapes
    on the 320*240 TFT LCD
    Users can refer ui_example.jpg in the root folder of this example to learn more about the APIs & what they do.

LCD has Serial & Parallel Interfaces, esp-wrover-kit is designed for Serial SPI interfacing. However, LCD requires some additional pins except the normal SPI pins.

Tip: TFT LCDs work on a basic bitmap, where you should tell each pixel what to do. The library is able to display data by a concept of foreground and background.
For eg: If white text is required on a black background, screen is filled with black, the foreground color is set to white. Only the bitmap pixels which define the font are cleared, and the rest are kept as they are. This is how bitmaps, fonts and shapes are printed on the screen.

Additional files required for the GUI

components\lcd folder

  1. Adafruit-GFX-Library: Adafruit-GFX-Library
  2. Adafruit_lcd_fast_as.cpp: Used for drawing pixels and some lines on the screen, and this subclass overrides most of the superclass methods in Adafruit_GFX.cpp
  3. Adafruit-GFX-Library/Font files: It is the bitmap for various sizes of fonts (Prefer to only #include your desired fonts to save space)
  4. spi_lcd.c : It has some SPI structures & functions which use the spi_master driver for sending out the data as required by Adafruit Libraries.

Note: To reduce the number of pins between the LCD & ESP32

  • It is okay to leave out the MISO pin
  • Short the backlight pin to always ON
  • Reset pin can be shorted with the ESP32s reset pin, but it might lead to unexpected behavior depending on the code.

There have been multiple additions to the Adafruit repository for the LCD, users can replace these files by new library if needed. Adafruit has made a good documentation on TFT LCDs.

If you are willing to share your User Interface for ESP32, you can do so by posting on the forum here.