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
Fork of the UniGraphic-Library for monochrome LCDs with ST7920 controller and 128x64-IIC-OLED-Display with SH1106-Controller
Had to adapt LCD for following reasons:
- Give access to screenbuffer buffer[] to parent class
- pixel() and pixel_read() as they are hardware-dependent
- added reset-pin to IIC-Interface
GraphicDisplay:: sends buffer to LCD when auto_update is set to true.
Testprogram for ST7920 can be found here:
https://developer.mbed.org/users/charly/code/UniGraphic-St7920-Test/
Inits/ILI9486.h@4:12ba0ecc2c1f, 2015-02-15 (annotated)
- Committer:
- Geremia
- Date:
- Sun Feb 15 20:06:07 2015 +0000
- Revision:
- 4:12ba0ecc2c1f
- Child:
- 9:1749ae993cfe
Added PAR16, separated 16bit writes for cmd parameters and pixeldata
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Geremia | 4:12ba0ecc2c1f | 1 | #ifndef MBED_ILI9486_H |
Geremia | 4:12ba0ecc2c1f | 2 | #define MBED_ILI9486_H |
Geremia | 4:12ba0ecc2c1f | 3 | |
Geremia | 4:12ba0ecc2c1f | 4 | |
Geremia | 4:12ba0ecc2c1f | 5 | |
Geremia | 4:12ba0ecc2c1f | 6 | #include "mbed.h" |
Geremia | 4:12ba0ecc2c1f | 7 | #include "TFT.h" |
Geremia | 4:12ba0ecc2c1f | 8 | |
Geremia | 4:12ba0ecc2c1f | 9 | /** Class for ILI9486 tft display controller |
Geremia | 4:12ba0ecc2c1f | 10 | * to be copypasted and adapted for other controllers |
Geremia | 4:12ba0ecc2c1f | 11 | */ |
Geremia | 4:12ba0ecc2c1f | 12 | class ILI9486 : public TFT |
Geremia | 4:12ba0ecc2c1f | 13 | { |
Geremia | 4:12ba0ecc2c1f | 14 | |
Geremia | 4:12ba0ecc2c1f | 15 | public: |
Geremia | 4:12ba0ecc2c1f | 16 | |
Geremia | 4:12ba0ecc2c1f | 17 | /** Create a PAR display interface |
Geremia | 4:12ba0ecc2c1f | 18 | * @param displayproto only supports PAR_8 |
Geremia | 4:12ba0ecc2c1f | 19 | * @param port GPIO port name to use |
Geremia | 4:12ba0ecc2c1f | 20 | * @param CS pin connected to CS of display |
Geremia | 4:12ba0ecc2c1f | 21 | * @param reset pin connected to RESET of display |
Geremia | 4:12ba0ecc2c1f | 22 | * @param DC pin connected to data/command of display |
Geremia | 4:12ba0ecc2c1f | 23 | * @param WR pin connected to SDI of display |
Geremia | 4:12ba0ecc2c1f | 24 | * @param RD pin connected to RS of display |
Geremia | 4:12ba0ecc2c1f | 25 | * @param name The name used by the parent class to access the interface |
Geremia | 4:12ba0ecc2c1f | 26 | */ |
Geremia | 4:12ba0ecc2c1f | 27 | ILI9486(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name); |
Geremia | 4:12ba0ecc2c1f | 28 | |
Geremia | 4:12ba0ecc2c1f | 29 | /** Create an SPI display interface |
Geremia | 4:12ba0ecc2c1f | 30 | * @param displayproto only supports SPI_8 |
Geremia | 4:12ba0ecc2c1f | 31 | * @param Hz SPI speed in Hz |
Geremia | 4:12ba0ecc2c1f | 32 | * @param mosi SPI pin |
Geremia | 4:12ba0ecc2c1f | 33 | * @param miso SPI pin |
Geremia | 4:12ba0ecc2c1f | 34 | * @param sclk SPI pin |
Geremia | 4:12ba0ecc2c1f | 35 | * @param CS pin connected to CS of display |
Geremia | 4:12ba0ecc2c1f | 36 | * @param reset pin connected to RESET of display |
Geremia | 4:12ba0ecc2c1f | 37 | * @param DC pin connected to data/command of display |
Geremia | 4:12ba0ecc2c1f | 38 | * @param name The name used by the parent class to access the interface |
Geremia | 4:12ba0ecc2c1f | 39 | */ |
Geremia | 4:12ba0ecc2c1f | 40 | ILI9486(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name); |
Geremia | 4:12ba0ecc2c1f | 41 | |
Geremia | 4:12ba0ecc2c1f | 42 | |
Geremia | 4:12ba0ecc2c1f | 43 | |
Geremia | 4:12ba0ecc2c1f | 44 | protected: |
Geremia | 4:12ba0ecc2c1f | 45 | |
Geremia | 4:12ba0ecc2c1f | 46 | |
Geremia | 4:12ba0ecc2c1f | 47 | /** Init command sequence |
Geremia | 4:12ba0ecc2c1f | 48 | */ |
Geremia | 4:12ba0ecc2c1f | 49 | void init(); |
Geremia | 4:12ba0ecc2c1f | 50 | |
Geremia | 4:12ba0ecc2c1f | 51 | |
Geremia | 4:12ba0ecc2c1f | 52 | |
Geremia | 4:12ba0ecc2c1f | 53 | }; |
Geremia | 4:12ba0ecc2c1f | 54 | #endif |