for Arduino TFT LCD Screen 160x128

Dependents:   TFTLCDSCREEN Pong_ILI9163C

Fork of TFT_ILI9163C by _ peu605

Committer:
peu605
Date:
Sun Feb 01 15:36:04 2015 +0000
Revision:
7:3dcb98ecf29f
Parent:
6:83f3605478ab
Child:
8:8dea70cf3ae8
separate source

Who changed what in which revision?

UserRevisionLine numberNew contents of line
peu605 0:f90a4405ef98 1 /*
peu605 0:f90a4405ef98 2 ILI9163C - A fast SPI driver for TFT that use Ilitek ILI9163C.
peu605 0:f90a4405ef98 3
peu605 0:f90a4405ef98 4 Features:
peu605 0:f90a4405ef98 5 - Very FAST!, expecially with Teensy 3.x where uses DMA SPI.
peu605 0:f90a4405ef98 6 - It uses just 4 or 5 wires.
peu605 0:f90a4405ef98 7 - Compatible at command level with Adafruit display series so it's easy to adapt existing code.
peu605 0:f90a4405ef98 8 - It uses the standard Adafruit_GFX Library (you need to install).
peu605 0:f90a4405ef98 9
peu605 0:f90a4405ef98 10 Background:
peu605 0:f90a4405ef98 11 I got one of those displays from a chinese ebay seller but unfortunatly I cannot get
peu605 0:f90a4405ef98 12 any working library so I decided to hack it. ILI9163C looks pretty similar to other
peu605 0:f90a4405ef98 13 display driver but it uses it's own commands so it's tricky to work with it unlsess you
peu605 0:f90a4405ef98 14 carefully fight with his gigantic and not so clever datasheet.
peu605 0:f90a4405ef98 15 My display it's a 1.44"", 128x128 that suppose to substitute Nokia 5110 LCD and here's the
peu605 0:f90a4405ef98 16 first confusion! Many sellers claim that it's compatible with Nokia 5110 (that use a philips
peu605 0:f90a4405ef98 17 controller) but the only similarity it's the pin names since that this one it's color and
peu605 0:f90a4405ef98 18 have totally different controller that's not compatible.
peu605 0:f90a4405ef98 19 http://www.ebay.com/itm/Replace-Nokia-5110-LCD-1-44-Red-Serial-128X128-SPI-Color-TFT-LCD-Display-Module-/141196897388
peu605 0:f90a4405ef98 20 http://www.elecrow.com/144-128x-128-tft-lcd-with-spi-interface-p-855.html
peu605 0:f90a4405ef98 21 Pay attention that can drive different resolutions and your display can be
peu605 0:f90a4405ef98 22 160*128 or whatever, also there's a strain of this display with a black PCB that a friend of mine
peu605 0:f90a4405ef98 23 got some weeks ago and need some small changes in library to get working.
peu605 0:f90a4405ef98 24 If you look at TFT_ILI9163C.h file you can add your modifications and let me know so I
peu605 0:f90a4405ef98 25 can include for future versions.
peu605 0:f90a4405ef98 26
peu605 0:f90a4405ef98 27 Code Optimizations:
peu605 0:f90a4405ef98 28 The purpose of this library it's SPEED. I have tried to use hardware optimized calls
peu605 0:f90a4405ef98 29 where was possible and results are quite good for most applications, actually nly filled circles
peu605 0:f90a4405ef98 30 are still a bit slow. Many SPI call has been optimized by reduce un-needed triggers to RS and CS
peu605 0:f90a4405ef98 31 lines. Of course it can be improved so feel free to add suggestions.
peu605 0:f90a4405ef98 32 -------------------------------------------------------------------------------
peu605 0:f90a4405ef98 33 Copyright (c) 2014, .S.U.M.O.T.O.Y., coded by Max MC Costa.
peu605 0:f90a4405ef98 34
peu605 0:f90a4405ef98 35 TFT_ILI9163C Library is free software: you can redistribute it and/or modify
peu605 0:f90a4405ef98 36 it under the terms of the GNU General Public License as published by
peu605 0:f90a4405ef98 37 the Free Software Foundation, either version 3 of the License, or
peu605 0:f90a4405ef98 38 (at your option) any later version.
peu605 0:f90a4405ef98 39
peu605 0:f90a4405ef98 40 TFT_ILI9163C Library is distributed in the hope that it will be useful,
peu605 0:f90a4405ef98 41 but WITHOUT ANY WARRANTY; without even the implied warranty of
peu605 0:f90a4405ef98 42 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
peu605 0:f90a4405ef98 43 GNU General Public License for more details.
peu605 0:f90a4405ef98 44
peu605 0:f90a4405ef98 45 You should have received a copy of the GNU General Public License
peu605 0:f90a4405ef98 46 along with Foobar. If not, see <http://www.gnu.org/licenses/>.
peu605 0:f90a4405ef98 47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
peu605 0:f90a4405ef98 48 This file needs the following Libraries:
peu605 0:f90a4405ef98 49
peu605 0:f90a4405ef98 50 Adafruit_GFX by Adafruit:
peu605 0:f90a4405ef98 51 https://github.com/adafruit/Adafruit-GFX-Library
peu605 0:f90a4405ef98 52 Remember to update GFX library often to have more features with this library!
peu605 0:f90a4405ef98 53 From this version I'm using my version of Adafruit_GFX library:
peu605 0:f90a4405ef98 54 https://github.com/sumotoy/Adafruit-GFX-Library
peu605 0:f90a4405ef98 55 It has faster char rendering and some small little optimizations but you can
peu605 0:f90a4405ef98 56 choose one of the two freely since are both fully compatible.
peu605 0:f90a4405ef98 57 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
peu605 0:f90a4405ef98 58 Special Thanks:
peu605 0:f90a4405ef98 59 Thanks Adafruit for his Adafruit_GFX!
peu605 0:f90a4405ef98 60 Thanks to Paul Stoffregen for his beautiful Teensy3 and DMA SPI.
peu605 0:f90a4405ef98 61
peu605 0:f90a4405ef98 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
peu605 0:f90a4405ef98 63 Version:
peu605 0:f90a4405ef98 64 0.1a1: First release, compile correctly. Altrough not fully working!
peu605 0:f90a4405ef98 65 0.1a3: Better but still some addressing problems.
peu605 0:f90a4405ef98 66 0.1b1: Beta! Addressing solved, now rotation works and boundaries ok.
peu605 0:f90a4405ef98 67 0.2b1: Cleaned up.
peu605 0:f90a4405ef98 68 0.2b3: Added 2.2" Red PCB parameters
peu605 0:f90a4405ef98 69 0.2b4: Bug fixes, added colorSpace (for future send image)
peu605 0:f90a4405ef98 70 0.2b5: Cleaning
peu605 0:f90a4405ef98 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
peu605 0:f90a4405ef98 72 BugList of the current version:
peu605 0:f90a4405ef98 73
peu605 0:f90a4405ef98 74 - Actually no scroll commands (only in release will be included).
peu605 0:f90a4405ef98 75 */
peu605 0:f90a4405ef98 76
peu605 0:f90a4405ef98 77 /**
peu605 0:f90a4405ef98 78 * TFT_ILI9163C library for ST Nucleo F411RE
peu605 0:f90a4405ef98 79 *
peu605 0:f90a4405ef98 80 * @author Copyright (c) 2014, .S.U.M.O.T.O.Y., coded by Max MC Costa
peu605 0:f90a4405ef98 81 * https://github.com/sumotoy/TFT_ILI9163C
peu605 0:f90a4405ef98 82 *
peu605 0:f90a4405ef98 83 * @author modified by masuda, Masuda Naika
peu605 0:f90a4405ef98 84 */
peu605 0:f90a4405ef98 85
peu605 0:f90a4405ef98 86 #ifndef _TFT_ILI9163CLIB_H_
peu605 0:f90a4405ef98 87 #define _TFT_ILI9163CLIB_H_
peu605 0:f90a4405ef98 88
peu605 7:3dcb98ecf29f 89 #if defined(TARGET_NUCLEO_F411RE)
peu605 7:3dcb98ecf29f 90 // #define __F411RE_SOFT__
peu605 7:3dcb98ecf29f 91 // #define __F411RE_DMA__
peu605 7:3dcb98ecf29f 92 #define __F411RE_DMA_IT__
peu605 7:3dcb98ecf29f 93 #elif defined(TARGET_NUCLEO_F302R8)
peu605 7:3dcb98ecf29f 94 // #define __F302R8_SOFT__
peu605 7:3dcb98ecf29f 95 #define __F302R8_DMA__
peu605 7:3dcb98ecf29f 96 #else
peu605 7:3dcb98ecf29f 97 #define __MBED_GENERIC__
peu605 1:c271e7e2e330 98 #endif
peu605 0:f90a4405ef98 99
peu605 0:f90a4405ef98 100
peu605 7:3dcb98ecf29f 101 #if defined(__F411RE_SOFT__)
peu605 7:3dcb98ecf29f 102 #include "TFT_ILI9163C_F411RE_SOFT.h"
peu605 7:3dcb98ecf29f 103 #elif defined(__F411RE_DMA__)
peu605 7:3dcb98ecf29f 104 #include "TFT_ILI9163C_F411RE_DMA.h"
peu605 7:3dcb98ecf29f 105 #elif defined(__F411RE_DMA_IT__)
peu605 7:3dcb98ecf29f 106 #include "TFT_ILI9163C_F411RE_DMA_IT.h"
peu605 7:3dcb98ecf29f 107 #elif defined(__F302R8_SOFT__)
peu605 7:3dcb98ecf29f 108 #include "TFT_ILI9163C_F302R8_SOFT.h"
peu605 7:3dcb98ecf29f 109 #elif defined(__F302R8_DMA__)
peu605 7:3dcb98ecf29f 110 #include "TFT_ILI9163C_F302R8_DMA.h"
peu605 0:f90a4405ef98 111 #else
peu605 7:3dcb98ecf29f 112 #include "TFT_ILI9163C_GENERIC.h"
peu605 0:f90a4405ef98 113 #endif
peu605 6:83f3605478ab 114
peu605 0:f90a4405ef98 115 #endif