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.

Dependents:   testUniGraphic_150217 maze_TFT_MMA8451Q TFT_test_frdm-kl25z TFT_test_NUCLEO-F411RE ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ST7565.h Source File

ST7565.h

00001 #ifndef MBED_ST7565_H
00002 #define MBED_ST7565_H
00003 
00004 
00005 
00006 #include "mbed.h"
00007 #include "LCD.h"
00008 
00009 /** Class for ST7565 and similar display controllers
00010 * to be copypasted and adapted for other controllers
00011 */
00012 class ST7565 : 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     ST7565(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name, unsigned int LCDSIZE_X = 132, unsigned  int LCDSIZE_Y = 64);
00030     
00031     /** Create a BUS display interface
00032     * @param displayproto only supports BUS_8
00033     * @param buspins array of PinName to group as Bus
00034     * @param CS pin connected to CS of display
00035     * @param reset pin connected to RESET of display
00036     * @param DC pin connected to data/command of display
00037     * @param WR pin connected to SDI of display
00038     * @param RD pin connected to RS of display
00039     * @param name The name used by the parent class to access the interface
00040     * @param LCDSIZE_X x size in pixel - optional
00041     * @param LCDSIZE_Y y size in pixel - optional
00042     */ 
00043     ST7565(proto_t displayproto, PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name, unsigned int LCDSIZE_X = 132, unsigned  int LCDSIZE_Y = 64);
00044   
00045     /** Create an SPI display interface
00046     * @param displayproto SPI_8 or SPI_16
00047     * @param Hz SPI speed in Hz
00048     * @param mosi SPI pin
00049     * @param miso SPI pin
00050     * @param sclk SPI pin
00051     * @param CS pin connected to CS of display
00052     * @param reset pin connected to RESET of display
00053     * @param DC pin connected to data/command of display
00054     * @param name The name used by the parent class to access the interface
00055     * @param LCDSIZE_X x size in pixel - optional
00056     * @param LCDSIZE_Y y size in pixel - optional
00057     */ 
00058     ST7565(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name, unsigned int LCDSIZE_X = 132, unsigned  int LCDSIZE_Y = 64);
00059   
00060 
00061   
00062 protected:
00063     
00064     
00065     /** Init command sequence  
00066     */
00067     void init();
00068 
00069 
00070 
00071 };
00072 #endif