fix for ILI9325

Fork of TFTLCD by Todor Todorov

ili9328.h

Committer:
ttodorov
Date:
2013-06-13
Revision:
23:eca4414196ca
Child:
24:ac6e35658037

File content as of revision 23:eca4414196ca:

/** \file ili9328.h
 *  \brief mbed LCD driver for displays with the ILI9328 controller.
 *  \copyright GNU Public License, v2. or later
 *
 * This library is based on the Arduino/chipKIT UTFT library by Henning
 * Karlsen, http://henningkarlsen.com/electronics/library.php?id=52
 *
 * Copyright (C)2010-2012 Henning Karlsen. All right reserved.
 *
 * Copyright (C)2012-2013 Todor Todorov.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to:
 *
 * Free Software Foundation, Inc.
 * 51 Franklin St, 5th Floor, Boston, MA 02110-1301, USA
 *
 *********************************************************************/
#ifndef TFTLCD_ILI9328_H
#define TFTLCD_ILI9328_H

#include "lcd_base.h"

#ifdef __cplusplus
extern "C" {
#endif

class ILI9328_LCD : public LCD
{
public:
    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 );
    virtual void Initialize( orientation_t orientation = LANDSCAPE, colordepth_t colors = RGB16 );
    virtual void Sleep( void );
    virtual void WakeUp( void );

protected:
    virtual void WriteCmd( unsigned short cmd );
    virtual void WriteData( unsigned short data );
    virtual void SetXY( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2 );
    virtual void SetPixelColor( unsigned int color, colordepth_t mode = RGB24 );

private:
    DigitalOut  _lcd_pin_wr;
    BusOut*     _lcd_port;
    DigitalOut* _lcd_pin_bl;
    DigitalOut* _lcd_pin_rd;
};

#ifdef __cplusplus
}
#endif

#endif /* TFTLCD_ILI9328_H */