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: afero_poc15_180216 afero_poc15_180223 afero_poc15_180302 afero_poc15_180403R ... more
Fork of UniGraphic by
UniGraphic for La Suno Version.
To go with La Suno, WatchDog Reset functions were added in ILI9341.
Inits/IST3020.h@18:ffa58f1a680a, 2015-03-02 (annotated)
- Committer:
- Geremia
- Date:
- Mon Mar 02 10:35:41 2015 +0000
- Revision:
- 18:ffa58f1a680a
- Parent:
- 9:1749ae993cfe
Added LCD ST7565, compatible with UC1701
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Geremia | 0:75ec1b3cde17 | 1 | #ifndef MBED_IST3020_H |
Geremia | 0:75ec1b3cde17 | 2 | #define MBED_IST3020_H |
Geremia | 0:75ec1b3cde17 | 3 | |
Geremia | 0:75ec1b3cde17 | 4 | |
Geremia | 0:75ec1b3cde17 | 5 | |
Geremia | 0:75ec1b3cde17 | 6 | #include "mbed.h" |
Geremia | 0:75ec1b3cde17 | 7 | #include "LCD.h" |
Geremia | 0:75ec1b3cde17 | 8 | |
Geremia | 0:75ec1b3cde17 | 9 | /** Class for IST3020 display controller |
Geremia | 0:75ec1b3cde17 | 10 | * to be copypasted and adapted for other controllers |
Geremia | 0:75ec1b3cde17 | 11 | */ |
Geremia | 0:75ec1b3cde17 | 12 | class IST3020 : public LCD |
Geremia | 0:75ec1b3cde17 | 13 | { |
Geremia | 0:75ec1b3cde17 | 14 | |
Geremia | 0:75ec1b3cde17 | 15 | public: |
Geremia | 0:75ec1b3cde17 | 16 | |
Geremia | 1:ff019d22b275 | 17 | /** Create a PAR display interface |
Geremia | 1:ff019d22b275 | 18 | * @param displayproto only supports PAR_8 |
Geremia | 0:75ec1b3cde17 | 19 | * @param port GPIO port name to use |
Geremia | 0:75ec1b3cde17 | 20 | * @param CS pin connected to CS of display |
Geremia | 0:75ec1b3cde17 | 21 | * @param reset pin connected to RESET of display |
Geremia | 0:75ec1b3cde17 | 22 | * @param DC pin connected to data/command of display |
Geremia | 0:75ec1b3cde17 | 23 | * @param WR pin connected to SDI of display |
Geremia | 0:75ec1b3cde17 | 24 | * @param RD pin connected to RS of display |
Geremia | 0:75ec1b3cde17 | 25 | * @param name The name used by the parent class to access the interface |
dreschpe | 9:1749ae993cfe | 26 | * @param LCDSIZE_X x size in pixel - optional |
dreschpe | 9:1749ae993cfe | 27 | * @param LCDSIZE_Y y size in pixel - optional |
Geremia | 0:75ec1b3cde17 | 28 | */ |
dreschpe | 9:1749ae993cfe | 29 | 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); |
Geremia | 0:75ec1b3cde17 | 30 | |
Geremia | 1:ff019d22b275 | 31 | /** Create an SPI display interface |
Geremia | 18:ffa58f1a680a | 32 | * @param displayproto SPI_8 or SPI_16 |
Geremia | 1:ff019d22b275 | 33 | * @param Hz SPI speed in Hz |
Geremia | 0:75ec1b3cde17 | 34 | * @param mosi SPI pin |
Geremia | 0:75ec1b3cde17 | 35 | * @param miso SPI pin |
Geremia | 0:75ec1b3cde17 | 36 | * @param sclk SPI pin |
Geremia | 0:75ec1b3cde17 | 37 | * @param CS pin connected to CS of display |
Geremia | 0:75ec1b3cde17 | 38 | * @param reset pin connected to RESET of display |
Geremia | 0:75ec1b3cde17 | 39 | * @param DC pin connected to data/command of display |
Geremia | 0:75ec1b3cde17 | 40 | * @param name The name used by the parent class to access the interface |
dreschpe | 9:1749ae993cfe | 41 | * @param LCDSIZE_X x size in pixel - optional |
dreschpe | 9:1749ae993cfe | 42 | * @param LCDSIZE_Y y size in pixel - optional |
Geremia | 0:75ec1b3cde17 | 43 | */ |
dreschpe | 9:1749ae993cfe | 44 | 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); |
Geremia | 0:75ec1b3cde17 | 45 | |
Geremia | 0:75ec1b3cde17 | 46 | |
Geremia | 0:75ec1b3cde17 | 47 | |
Geremia | 0:75ec1b3cde17 | 48 | protected: |
Geremia | 0:75ec1b3cde17 | 49 | |
Geremia | 0:75ec1b3cde17 | 50 | |
Geremia | 0:75ec1b3cde17 | 51 | /** Init command sequence |
Geremia | 0:75ec1b3cde17 | 52 | */ |
Geremia | 0:75ec1b3cde17 | 53 | void init(); |
Geremia | 0:75ec1b3cde17 | 54 | |
Geremia | 0:75ec1b3cde17 | 55 | |
Geremia | 0:75ec1b3cde17 | 56 | |
Geremia | 0:75ec1b3cde17 | 57 | }; |
Geremia | 0:75ec1b3cde17 | 58 | #endif |