Basically i glued Peter Drescher and Simon Ford libs in a GraphicsDisplay class, then derived TFT or LCD class (which inherits Protocols class), then the most derived ones (Inits), which are per-display and are the only part needed to be adapted to diff hw.

Fork of UniGraphic by GraphicsDisplay

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IST3020.h Source File

IST3020.h

00001 #ifndef MBED_IST3020_H
00002 #define MBED_IST3020_H
00003 
00004 
00005 
00006 #include "mbed.h"
00007 #include "LCD.h"
00008 
00009 /** Class for IST3020 display controller
00010 * to be copypasted and adapted for other controllers
00011 */
00012 class IST3020 : public LCD
00013 {
00014  
00015  public:
00016 
00017     /** Create a PAR display interface
00018     * @param displayproto only supports PAR_8
00019     * @param port GPIO port name to use
00020     * @param CS pin connected to CS of display
00021     * @param reset pin connected to RESET of display
00022     * @param DC pin connected to data/command of display
00023     * @param WR pin connected to SDI of display
00024     * @param RD pin connected to RS of display
00025     * @param name The name used by the parent class to access the interface
00026     * @param LCDSIZE_X x size in pixel - optional
00027     * @param LCDSIZE_Y y size in pixel - optional
00028     */ 
00029     IST3020(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name, unsigned int LCDSIZE_X = 192, unsigned  int LCDSIZE_Y = 64);
00030   
00031     /** Create an SPI display interface
00032     * @param displayproto SPI_8 or SPI_16
00033     * @param Hz SPI speed in Hz
00034     * @param mosi SPI pin
00035     * @param miso SPI pin
00036     * @param sclk SPI pin
00037     * @param CS pin connected to CS of display
00038     * @param reset pin connected to RESET of display
00039     * @param DC pin connected to data/command of display
00040     * @param name The name used by the parent class to access the interface
00041     * @param LCDSIZE_X x size in pixel - optional
00042     * @param LCDSIZE_Y y size in pixel - optional
00043     */ 
00044     IST3020(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name, unsigned int LCDSIZE_X = 192, unsigned  int LCDSIZE_Y = 64);
00045   
00046 
00047   
00048 protected:
00049     
00050     
00051     /** Init command sequence  
00052     */
00053     void init();
00054 
00055 
00056 
00057 };
00058 #endif