UniGraphic-Fork for ST7920-LCD-controller and SH1106. Tested with 128x64 LCD with SPI and 128x64-OLED with IIC

Dependents:   UniGraphic-St7920-Test AfficheurUTILECO

Fork of UniGraphic by GraphicsDisplay

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SEPS225.h Source File

SEPS225.h

00001 #ifndef SEPS225_H
00002 #define SEPS225_H included
00003 
00004 #include "mbed.h"
00005 #include "TFT.h"
00006 //#include "vt100.h"    
00007 //extern vt100 *tty ;
00008  
00009 /** Class for SEPS225 Syncoam Co.,Ltd
00010  * 128 x 128 Dots, 262K Colors PM-OLED Display Driver and Controller
00011  */
00012  
00013 class SEPS225 : public TFT
00014 {
00015 
00016 public:
00017 
00018     /** Create a PAR display interface
00019     * @param displayproto PAR_8 or PAR_16
00020     * @param port GPIO port name to use
00021     * @param CS pin connected to CS of display
00022     * @param reset pin connected to RESET of display
00023     * @param DC pin connected to data/command of display
00024     * @param WR pin connected to SDI of display
00025     * @param RD pin connected to RS of display
00026     * @param name The name used by the parent class to access the interface
00027     * @param LCDSIZE_X x size in pixel - optional
00028     * @param LCDSIZE_Y y size in pixel - optional
00029     */ 
00030     SEPS225(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name ,const unsigned int LCDSIZE_X = 128, unsigned  int LCDSIZE_Y = 128);
00031     
00032     /** Create a BUS display interface
00033     * @param displayproto BUS_8 or BUS_16
00034     * @param buspins array of PinName to group as Bus
00035     * @param CS pin connected to CS of display
00036     * @param reset pin connected to RESET of display
00037     * @param DC pin connected to data/command of display
00038     * @param WR pin connected to SDI of display
00039     * @param RD pin connected to RS 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     SEPS225(proto_t displayproto, PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name ,const unsigned int LCDSIZE_X = 128, unsigned  int LCDSIZE_Y = 128);
00045   
00046     /** Create an SPI display interface
00047     * @param displayproto SPI_8 or SPI_16
00048     * @param Hz SPI speed in Hz
00049     * @param mosi SPI pin
00050     * @param miso SPI pin
00051     * @param sclk SPI pin
00052     * @param CS pin connected to CS of display
00053     * @param reset pin connected to RESET of display
00054     * @param DC pin connected to data/command of display
00055     * @param name The name used by the parent class to access the interface
00056     * @param LCDSIZE_X x size in pixel - optional
00057     * @param LCDSIZE_Y y size in pixel - optional
00058     */ 
00059     SEPS225(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name ,unsigned int LCDSIZE_X = 128, unsigned  int LCDSIZE_Y = 128);
00060   
00061 
00062     virtual void pixel(int x, int y, unsigned short color);
00063     virtual void window(int x, int y, int w, int h);
00064     virtual void rect(int x0, int y0, int x1, int y1, unsigned short color) ;
00065     virtual void cls(void) ; // virtual
00066     virtual unsigned short pixelread(int x, int y);
00067     virtual void window4read(int x, int y, int w, int h);
00068     virtual void window_pushpixel(unsigned short color);
00069     virtual void window_pushpixel(unsigned short color, unsigned int count);
00070     virtual void window_pushpixelbuf(unsigned short* color, unsigned int lenght);
00071     void display(int onoff) ;
00072     
00073     void reg_write(unsigned char cmd, unsigned char data) ;
00074     void cmd_write(unsigned char cmd) ;
00075     void data_write(unsigned char data) ;
00076     void write8(unsigned char data) ;
00077     void write16(unsigned short sdata) ;
00078     void bufwrite8(unsigned char *data, unsigned long len) ;
00079     void bufwrite16(unsigned short *sdata, unsigned long len) ;
00080   
00081 protected:
00082     
00083     
00084     /** Init command sequence  
00085     */
00086     void init();
00087 
00088 
00089 private:
00090     DigitalOut *_cs ;
00091     DigitalOut *_rs ;
00092 } ;
00093  
00094  #endif /* SEPS225_H */
00095