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.
Inits/IST3020.h@1:ff019d22b275, 2015-02-13 (annotated)
- Committer:
- Geremia
- Date:
- Fri Feb 13 15:25:10 2015 +0000
- Revision:
- 1:ff019d22b275
- Parent:
- 0:75ec1b3cde17
- Child:
- 9:1749ae993cfe
Added SPI_16, LCD done
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 |
Geremia | 0:75ec1b3cde17 | 26 | */ |
Geremia | 0:75ec1b3cde17 | 27 | IST3020(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name); |
Geremia | 0:75ec1b3cde17 | 28 | |
Geremia | 1:ff019d22b275 | 29 | /** Create an SPI display interface |
Geremia | 1:ff019d22b275 | 30 | * @param displayproto only supports SPI_8 |
Geremia | 1:ff019d22b275 | 31 | * @param Hz SPI speed in Hz |
Geremia | 0:75ec1b3cde17 | 32 | * @param mosi SPI pin |
Geremia | 0:75ec1b3cde17 | 33 | * @param miso SPI pin |
Geremia | 0:75ec1b3cde17 | 34 | * @param sclk SPI pin |
Geremia | 0:75ec1b3cde17 | 35 | * @param CS pin connected to CS of display |
Geremia | 0:75ec1b3cde17 | 36 | * @param reset pin connected to RESET of display |
Geremia | 0:75ec1b3cde17 | 37 | * @param DC pin connected to data/command of display |
Geremia | 0:75ec1b3cde17 | 38 | * @param name The name used by the parent class to access the interface |
Geremia | 0:75ec1b3cde17 | 39 | */ |
Geremia | 1:ff019d22b275 | 40 | IST3020(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name); |
Geremia | 0:75ec1b3cde17 | 41 | |
Geremia | 0:75ec1b3cde17 | 42 | |
Geremia | 0:75ec1b3cde17 | 43 | |
Geremia | 0:75ec1b3cde17 | 44 | protected: |
Geremia | 0:75ec1b3cde17 | 45 | |
Geremia | 0:75ec1b3cde17 | 46 | |
Geremia | 0:75ec1b3cde17 | 47 | /** Init command sequence |
Geremia | 0:75ec1b3cde17 | 48 | */ |
Geremia | 0:75ec1b3cde17 | 49 | void init(); |
Geremia | 0:75ec1b3cde17 | 50 | |
Geremia | 0:75ec1b3cde17 | 51 | |
Geremia | 0:75ec1b3cde17 | 52 | |
Geremia | 0:75ec1b3cde17 | 53 | }; |
Geremia | 0:75ec1b3cde17 | 54 | #endif |