Giter Site home page Giter Site logo

esp32_adafruit_ili9341's Introduction

Demos for ILI9341-based TFT displays using the Espressif ESP32

See end of this file for credits and code provenance

This project uses a combination of Adafruit's Arduino ILI9341 driver (heavily modified) and their Arduino display graphics library (with a few specific fonts from there compiled in).

The original Arduino libraries above work for those using the Arduino-ESP32 project, with some pin modifications for your particular setup (e.g., the ESP-WROVER-KIT, which also controls the backlight on GPIO_5). The ILI9341 driver in particular is ESP32-aware now.

While there are no plans to convert the native SDK-based demos below to Arduino-ESP32 code, Arduino-specific demos are included here now.

Demo code (tested using the ESP-WROVER-KIT)

  • demos/arduino-esp32

    • Install Arduino-ESP32
    • Add the Adafruit_ILI9341 and the Adafruit-GFX-Library
    • Build and flash via the Arduino IDE
  • demos/esp-idf

About the SDK-based sample code:

The sample code consists of two parts:

The driver itself and needed dependencies are in /driver and /include/driver.

The driver is written in C++ which is not well supported by ESP8266 toolchain and sdk, so some dirty hack is needed to properly contstruct C++ objects. The code for this is in user/routines.cpp.

In spite of the fact that according to the datasheet max ILI9341's clock speed is 10MHz mine robustly works at up to 40MHz so I added SPI speed prescaler macro at the beginning of hspi.c. Defining it to 1 means HSPI will be clocked at 40MHz, 4 means 10 MHz.

What to demonstrate is controlled by macro UIDEMO defined at the beginning of user_main.cpp. If it's defined then the sample HVAC controller UI is shown, else, the rotating cube is rendered.

Wiring (see code for the ESP-WROVER-KIT default values)

The code uses hardware HSPI with hardware controlled CS, so the wiring shall be as follows:

ILI9341 pin --> ESP32 GPIO pin of choice
MOSI        --> GPIO13
MISO        --> n/c
CLK         --> GPIO14
CS          --> GPIO15
DC          --> GPIO2
Reset       --> pull up to 3.3V
GND         --> ground

Credits

Basis 1: https://github.com/adafruit/Adafruit_ILI9341 This is a library for the Adafruit ILI9341 display products

This library works with the Adafruit 2.8" Touch Shield V2 (SPI)
  ----> http://www.adafruit.com/products/1651
 
Check out the links above for our tutorials and wiring diagrams.
These displays use SPI to communicate, 4 or 5 pins are required
to interface (RST is optional).

Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution

Basis 2: https://github.com/adafruit/Adafruit-GFX-Library This is the core graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.). It needs to be paired with a hardware-specific library for each display device we carry (to handle the lower-level functions).

Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.

Both as modified by Sermus for the ESP8266: https://github.com/Sermus/ESP8266_Adafruit_ILI9341

Further modifications by Rudi, et. al. for the ESP32: http://esp32.com/viewtopic.php?f=18&t=636#p2907

Extended with text rendering routines from: http://www.instructables.com/id/Arduino-TFT-display-and-font-library/?ALLSTEPS

Original hspi code: https://github.com/Perfer/esp8266_ili9341

esp32_adafruit_ili9341's People

Contributors

martymacgyver avatar sermus avatar

Watchers

Frostxnet avatar

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.