This is a port of Henning Kralsen's UTFT library for Arduino/chipKIT to mbed, refactored to make full use of C inheritance and access control, in order to reduce work when implementing new drivers and at the same time make the code more readable and easier to maintain. As of now supported are SSD1289 (16-bit interface), HX8340-B (serial interface) and ST7735 (serial interface). Drivers for other controllers will be added as time and resources to acquire the displays to test the code permit.

Dependents:   UTFT_SSD1289

Fork of TFTLCD by Todor Todorov

Committer:
ttodorov
Date:
Thu Jun 13 03:47:51 2013 +0000
Revision:
23:eca4414196ca
Child:
24:ac6e35658037
- ILI9328 driver not working yet

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ttodorov 23:eca4414196ca 1 /** \file ili9328.h
ttodorov 23:eca4414196ca 2 * \brief mbed LCD driver for displays with the ILI9328 controller.
ttodorov 23:eca4414196ca 3 * \copyright GNU Public License, v2. or later
ttodorov 23:eca4414196ca 4 *
ttodorov 23:eca4414196ca 5 * This library is based on the Arduino/chipKIT UTFT library by Henning
ttodorov 23:eca4414196ca 6 * Karlsen, http://henningkarlsen.com/electronics/library.php?id=52
ttodorov 23:eca4414196ca 7 *
ttodorov 23:eca4414196ca 8 * Copyright (C)2010-2012 Henning Karlsen. All right reserved.
ttodorov 23:eca4414196ca 9 *
ttodorov 23:eca4414196ca 10 * Copyright (C)2012-2013 Todor Todorov.
ttodorov 23:eca4414196ca 11 *
ttodorov 23:eca4414196ca 12 * This library is free software; you can redistribute it and/or
ttodorov 23:eca4414196ca 13 * modify it under the terms of the GNU Lesser General Public
ttodorov 23:eca4414196ca 14 * License as published by the Free Software Foundation; either
ttodorov 23:eca4414196ca 15 * version 2.1 of the License, or (at your option) any later version.
ttodorov 23:eca4414196ca 16 *
ttodorov 23:eca4414196ca 17 * This library is distributed in the hope that it will be useful,
ttodorov 23:eca4414196ca 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ttodorov 23:eca4414196ca 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ttodorov 23:eca4414196ca 20 * Lesser General Public License for more details.
ttodorov 23:eca4414196ca 21 *
ttodorov 23:eca4414196ca 22 * You should have received a copy of the GNU Lesser General Public
ttodorov 23:eca4414196ca 23 * License along with this library; if not, write to:
ttodorov 23:eca4414196ca 24 *
ttodorov 23:eca4414196ca 25 * Free Software Foundation, Inc.
ttodorov 23:eca4414196ca 26 * 51 Franklin St, 5th Floor, Boston, MA 02110-1301, USA
ttodorov 23:eca4414196ca 27 *
ttodorov 23:eca4414196ca 28 *********************************************************************/
ttodorov 23:eca4414196ca 29 #ifndef TFTLCD_ILI9328_H
ttodorov 23:eca4414196ca 30 #define TFTLCD_ILI9328_H
ttodorov 23:eca4414196ca 31
ttodorov 23:eca4414196ca 32 #include "lcd_base.h"
ttodorov 23:eca4414196ca 33
ttodorov 23:eca4414196ca 34 #ifdef __cplusplus
ttodorov 23:eca4414196ca 35 extern "C" {
ttodorov 23:eca4414196ca 36 #endif
ttodorov 23:eca4414196ca 37
ttodorov 23:eca4414196ca 38 class ILI9328_LCD : public LCD
ttodorov 23:eca4414196ca 39 {
ttodorov 23:eca4414196ca 40 public:
ttodorov 23:eca4414196ca 41 ILI9328_LCD( PinName CS, PinName RESET, PinName RS, PinName WR, BusOut* DATA_PORT, PinName BL = NC, PinName RD = NC, backlight_t blType = Constant, float defaultBackLightLevel = 1.0 );
ttodorov 23:eca4414196ca 42 virtual void Initialize( orientation_t orientation = LANDSCAPE, colordepth_t colors = RGB16 );
ttodorov 23:eca4414196ca 43 virtual void Sleep( void );
ttodorov 23:eca4414196ca 44 virtual void WakeUp( void );
ttodorov 23:eca4414196ca 45
ttodorov 23:eca4414196ca 46 protected:
ttodorov 23:eca4414196ca 47 virtual void WriteCmd( unsigned short cmd );
ttodorov 23:eca4414196ca 48 virtual void WriteData( unsigned short data );
ttodorov 23:eca4414196ca 49 virtual void SetXY( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2 );
ttodorov 23:eca4414196ca 50 virtual void SetPixelColor( unsigned int color, colordepth_t mode = RGB24 );
ttodorov 23:eca4414196ca 51
ttodorov 23:eca4414196ca 52 private:
ttodorov 23:eca4414196ca 53 DigitalOut _lcd_pin_wr;
ttodorov 23:eca4414196ca 54 BusOut* _lcd_port;
ttodorov 23:eca4414196ca 55 DigitalOut* _lcd_pin_bl;
ttodorov 23:eca4414196ca 56 DigitalOut* _lcd_pin_rd;
ttodorov 23:eca4414196ca 57 };
ttodorov 23:eca4414196ca 58
ttodorov 23:eca4414196ca 59 #ifdef __cplusplus
ttodorov 23:eca4414196ca 60 }
ttodorov 23:eca4414196ca 61 #endif
ttodorov 23:eca4414196ca 62
ttodorov 23:eca4414196ca 63 #endif /* TFTLCD_ILI9328_H */