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:   Brew

Committer:
Geremia
Date:
Sat Nov 28 18:37:19 2015 +0000
Revision:
29:866213bb9bf0
Add ILI9327 and S6D04D1 (240x400 displays)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Geremia 29:866213bb9bf0 1 #ifndef MBED_S6D04D1_H
Geremia 29:866213bb9bf0 2 #define MBED_S6D04D1_H
Geremia 29:866213bb9bf0 3
Geremia 29:866213bb9bf0 4
Geremia 29:866213bb9bf0 5
Geremia 29:866213bb9bf0 6 #include "mbed.h"
Geremia 29:866213bb9bf0 7 #include "TFT.h"
Geremia 29:866213bb9bf0 8
Geremia 29:866213bb9bf0 9 /** Class for S6D04D1 TFT display controller
Geremia 29:866213bb9bf0 10 * for BM8K5113 TFT1P3520-E TFT8K5113FPC-A1-E and TFT1P3520
Geremia 29:866213bb9bf0 11 * to be copypasted and adapted for other controllers
Geremia 29:866213bb9bf0 12 */
Geremia 29:866213bb9bf0 13 class S6D04D1 : public TFT
Geremia 29:866213bb9bf0 14 {
Geremia 29:866213bb9bf0 15
Geremia 29:866213bb9bf0 16 public:
Geremia 29:866213bb9bf0 17
Geremia 29:866213bb9bf0 18 /** Create a PAR display interface
Geremia 29:866213bb9bf0 19 * @param displayproto PAR_8 or PAR_16
Geremia 29:866213bb9bf0 20 * @param port GPIO port name to use
Geremia 29:866213bb9bf0 21 * @param CS pin connected to CS of display
Geremia 29:866213bb9bf0 22 * @param reset pin connected to RESET of display
Geremia 29:866213bb9bf0 23 * @param DC pin connected to data/command of display
Geremia 29:866213bb9bf0 24 * @param WR pin connected to SDI of display
Geremia 29:866213bb9bf0 25 * @param RD pin connected to RS of display
Geremia 29:866213bb9bf0 26 * @param name The name used by the parent class to access the interface
Geremia 29:866213bb9bf0 27 * @param LCDSIZE_X x size in pixel - optional
Geremia 29:866213bb9bf0 28 * @param LCDSIZE_Y y size in pixel - optional
Geremia 29:866213bb9bf0 29 */
Geremia 29:866213bb9bf0 30 S6D04D1(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name , unsigned int LCDSIZE_X = 240, unsigned int LCDSIZE_Y = 400);
Geremia 29:866213bb9bf0 31
Geremia 29:866213bb9bf0 32 /** Create a BUS display interface
Geremia 29:866213bb9bf0 33 * @param displayproto BUS_8 or BUS_16
Geremia 29:866213bb9bf0 34 * @param buspins array of PinName to group as Bus
Geremia 29:866213bb9bf0 35 * @param CS pin connected to CS of display
Geremia 29:866213bb9bf0 36 * @param reset pin connected to RESET of display
Geremia 29:866213bb9bf0 37 * @param DC pin connected to data/command of display
Geremia 29:866213bb9bf0 38 * @param WR pin connected to SDI of display
Geremia 29:866213bb9bf0 39 * @param RD pin connected to RS of display
Geremia 29:866213bb9bf0 40 * @param name The name used by the parent class to access the interface
Geremia 29:866213bb9bf0 41 * @param LCDSIZE_X x size in pixel - optional
Geremia 29:866213bb9bf0 42 * @param LCDSIZE_Y y size in pixel - optional
Geremia 29:866213bb9bf0 43 */
Geremia 29:866213bb9bf0 44 S6D04D1(proto_t displayproto, PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name ,const unsigned int LCDSIZE_X = 240, unsigned int LCDSIZE_Y = 400);
Geremia 29:866213bb9bf0 45
Geremia 29:866213bb9bf0 46
Geremia 29:866213bb9bf0 47 /** Create an SPI display interface
Geremia 29:866213bb9bf0 48 * @param displayproto SPI_8 or SPI_16
Geremia 29:866213bb9bf0 49 * @param Hz SPI speed in Hz
Geremia 29:866213bb9bf0 50 * @param mosi SPI pin
Geremia 29:866213bb9bf0 51 * @param miso SPI pin
Geremia 29:866213bb9bf0 52 * @param sclk SPI pin
Geremia 29:866213bb9bf0 53 * @param CS pin connected to CS of display
Geremia 29:866213bb9bf0 54 * @param reset pin connected to RESET of display
Geremia 29:866213bb9bf0 55 * @param DC pin connected to data/command of display
Geremia 29:866213bb9bf0 56 * @param name The name used by the parent class to access the interface
Geremia 29:866213bb9bf0 57 * @param LCDSIZE_X x size in pixel - optional
Geremia 29:866213bb9bf0 58 * @param LCDSIZE_Y y size in pixel - optional
Geremia 29:866213bb9bf0 59 */
Geremia 29:866213bb9bf0 60 S6D04D1(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name , unsigned int LCDSIZE_X = 240, unsigned int LCDSIZE_Y = 400);
Geremia 29:866213bb9bf0 61
Geremia 29:866213bb9bf0 62 // unsigned int status();
Geremia 29:866213bb9bf0 63
Geremia 29:866213bb9bf0 64
Geremia 29:866213bb9bf0 65
Geremia 29:866213bb9bf0 66 protected:
Geremia 29:866213bb9bf0 67
Geremia 29:866213bb9bf0 68
Geremia 29:866213bb9bf0 69 /** Init command sequence
Geremia 29:866213bb9bf0 70 */
Geremia 29:866213bb9bf0 71 void init();
Geremia 29:866213bb9bf0 72
Geremia 29:866213bb9bf0 73
Geremia 29:866213bb9bf0 74 };
Geremia 29:866213bb9bf0 75 #endif