ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
index page

README

Documentation
  • Please use this link for Documentation and this README
See also
https://rawgit.com/magore/esp8266_ili9341/master/doxygen/html/index.html
Copyright
  • See COPYRIGHT.md for a full copyright notice for the project
Description
  • ESP8266 support libraries
    • All of the code in this project, except where noted is written by me
    • Analog Devices ADF4351 Wideband Synthesizer driver and test code
      • Control is via serial terminal that works while the other demos run
      • adf4351 123456000 10000
        • Frequency, and channel spacing used in calculations
      • adf4351_scan 144e6 145e6 10000
        • start frequency, end frequency, channel spacing
    • ILI9341 display driver
      • Multiple custom size windows
      • Custom fonts
      • Window scrolling
      • readPixel() function supported
      • The specific display this was tested on is a TM022HDH26 display I got from eBay.
      • Not limited by ILI9341 hardware scroll restrictions.
    • xpt2046 touch controller
      • filtered read of XY
      • debounced key press read of queued events
      • 5 point calibration routines
    • BDF FONT compiler tools and fonts sets
      • Tools to creates C code used in the display drivers
    • Wireframe Viewer
      • Code generator for Earth coastline data
      • I created two wireframe demos
        • Cube wireframe dataset
        • Earth coastline dataset - wireframe view still needs hidden line removal option
    • CORDIC C code generator and 3D transformation code support functions use by wireframe viewer code
    • Small PRINTF with full floating point support - much smaller then GNU full version along
    • Additional number IO functions, ATOF etc
    • WEB server using SD CARD with CGI processing - files and CGI results can be ANY SIZE!
      • Example web site for testing
      • WEB server can update TFT display
        • Simple door sign status update using web page - see html/msg.cgi and web/web.c for code
    • Network server client example for display updates
    • Uart network server client for serial uart to Network Bridge.
    • Generic queue handling code
    • ESP8266 support for FatFS by ChaN 2016
      • SD card and microSD support
    • POSIX wrappers for FatFS - provides UNIX/LINUX file I/O operations
    • POSIX time functions and RTC set with NTP
    • Multiple timers used by RTC and time functions
    • HSPI code that can handle multiple devices each with varying clock frequencies
Credits
  • Project compiles using ESP Open SDK - or esp8266-devkit by CHERTS
See also
https://github.com/pfalcon/esp-open-sdk
https://github.com/CHERTS/esp8266-devkit
  • Display drivers from third parties A few of the display driver functions are from the Adafruit GFX Library
https://github.com/adafruit/Adafruit-GFX-Library Optimized Line drawing function and Makefile from CHERTS
https://github.com/CHERTS/esp8266-devkit/tree/master/Espressif/examples/esp8266_ili9341
  • Font sources:
https://www.gnu.org/software/freefont/
https://www.rockbox.org
http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format
https://partners.adobe.com/public/developer/en/font/5005.BDF_Spec.pdf
http://elm-chan.org/fsw/ff/00index_e.html
  • Yield Code extracted from ESP8266 Arduino Project
https://github.com/esp8266/Arduino
Directories
  • Files
    • COPYRIGHT.md - Project Copyright file
    • Doxyfile - Doxygen configuration file
    • display.jpg - image of the ili9341 display while the software is running
    • doit - bash script that compiles and uploads firmware then starts miniterm
    • doxyfile.inc - automatically created file lists directories to search for documentation
    • header - common include header that can be used by user C files
    • get_esp-open-sdk - shell script to download / compile and install the current version of ESP OPEN SDK
      • This project is now using versions 2.0.0 of the SDK
      • Tested on Ubuntu 16.04.1 and Ubuntu 14.04.5
      • Installs under /opt/Expressif/esp-open-sdk
    • get_esptool - downloads the latest version of esptool - required for this project
    • header - example C headers required for C programs in this project
    • Makefile from CHERTS modified for the project
      • Features are all controlled by variables in Makefile
      • Note the Makefile downloads the latest esptool automatically so it is no longer includd here
    • meminfo.sh - displays current RAM usage for the project
      • Example: ./meminfo.sh build/demo.elf
    • miniterm - shell script to launch terminal to 115200 baud Defaults to /dev/ttyUSB0 115200
    • README.md - Project readme file
      • Tested with ESP8266_NONOS_SDK_V2.0.0_16_08_10, 1 Nov 2016
    • send.c
      • Send message to network server
      • Example: ./send -i 192.168.200.116 -m ''
        • These escape characters are processed on the display:
          , ,
    • setpath - set the current environment for the SDK and tools
      • Example: . setpath
    • testflash.c
      • Create and read a test pattern filled file for flash testing
    • video.mp4
      • Video of ili9341 display with web server CGI updating the display
  • Eclipse Project files and Directories
    • Change .settings/language.settings.xml
    • .cproject
    • .project
    • .settings
      • .settings/language.settings.xml
        • Contains path to cross compiler for indexing - matches assumptions in SDK installer script: get_esp-open-sdk
  • Directories
    • adf4351 - Analog Devices ADF4351 Wideband Synthesizer with Integrated VCO driver
      • adf4351.c
      • adf4351.h
        • Main ADF4351 interface code
      • adf4351_cmd.c
      • adf4351_cmd.h
        • User interface and frequency scanning task
      • adf4351_hal.c
      • adf4351_hal.h
        • Hardware Abstraction layer
    • bridge - Serial bridge code - send and receive serial data via network
      • bridge.c
      • bridge.h
        • Opens a port on port 23 so you can use telnet to test
          • Note: at the moment no telnet command processing is done.

docs - ili9431 and esp8266 related documents

earth - Earth coast line data and display code

esp8266 - ESP8266 specific code

fatfs - R0.12b FatFS code from (C)ChaN, 2016

fatfs.hal - My updated FatFS hardware abstraction layer code for ESP8266

fatfs.sup - My POSIX wrappers for FatFS and user interface code

fonts - BDF Font conversion code

html - A working web site with files that can be put on an SD card

include

ld - Linker scripts

Connections
* ESP8266           
  * MISO/GPIO12 
  * MOSI/GPIO13
  * CLK/GPIO14
  * CHIP_EN ---1K--- VCC3.3V
  * CH_PD   ---1K--- VCC3.3V
  * REST    ---1K--- VCC3.3V   Ground REST to reset ESP8266 and ILI9341
  * GPIO  2 ---1K--- VCC3.3V
  * GPIO  0 ---1K--- VCC3.3V   Ground GPIO 0 to to enable flashing
  * GPIO 15 ---1K--- GND       Need pull down for boot
  * GPIO 14 ---1K--- GND       Keeps floating pins from generating false clocks on attached devices
  * GND ------------ GND
  * T_OUT ------ +            T_OUT is connected to varaible VR100K 
                 | 
    VCC--330K--VR100K-- GND   Variable VR100K is connected to 330K then VCC
                              Max voltage to T_OUT pin is VCC * 100K / (330K+100K)

* FTDI232 USB/TTL      ESP8266 
  * TXD ----1K--------  RXD
  * RXD --------------  TXD
  * RTS ---|<--------- REST    Optional - Diode with Cathode to RTS, Anode to ESP8266 Reset
  * DTR ---|<----1K--- GPIO 00 Optional - Diode with cathode to DTR, Anode to 1K to ESP8266 GPIO00 for flashing
  * GND --------------  GND
  * Note: if you use the optional DTR,RTS conneections you have to use miniterm script provided
    recommend using jumpers to anable this feature if you do not wish to have the ESP8266 reset automatically

* xpt2046        ESP8266
  * MOSI   MOSI  GPIO 13
  * MISO   MISO  GPIO 12
  * SCK    CLK   GPIO 14 
  * CS           GPIO 02

* ILI9341        ESP8266
  * Data/Command GPIO 05 (see io.c and SWAP45 in Makefile - my pin lables are backwards!)
  * CS           GPIO 15 (see io.c)
  * SDI    MOSI  GPIO 13
  * SDO    MISO  GPIO 12
  * SCK    CLK   GPIO 14 
  * RST    REST  RESET
  * VCC          VCC3.3V
  * GND          GND

* MMC/SD reader  ESP8266
  * D3/CS        GPIO 04 (see io.c and SWAP45 in Makefile - my pin lables are backwards!)
  * CMD/DI MOSI  GPIO 13
  * D0     MISO  GPIO 12
  * CLK    CLK   GPIO 14
  * VCC          VCC3.3V
  * GND          GND

* ADF4351        ESP8266
  * LE           GPIO 00 (see io.c)
  * DATA   MOSI  GPIO 13
  * CLK     CLK  GPIO 14
  * MUXOUT            NC
  * CE                NC
  * VCC          VCC3.3V
  * GND          GND
Demo Video
Demo Images
  • Running demo and sending a message to the network window
  • "./send -i 192.168.200.116 -m 'testing\nTest3\nscrolling\ntext\n1\n2'"
    • Diagnostics from send ip:192.168.200.116, port:31415, message: testing Test3 scrolling text 1 2 Host name: 192.168.200.116
      • Result: