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/ILI932x.h@20:14daa48ffd4c, 2015-03-23 (annotated)
- Committer:
- Geremia
- Date:
- Mon Mar 23 14:08:04 2015 +0000
- Revision:
- 20:14daa48ffd4c
- Child:
- 21:ae0a4eedfc90
Add ILI 9320/9325/9328 custom TFT932x class, parallel/spi 8/16bit, with orientation, scroll, pixelread, fastwindow.; Par8 and 16 tested, SPI not at all, needs checking if the CS toggle is necessary (see SPI8.cpp SPI16.cpp).
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Geremia | 20:14daa48ffd4c | 1 | #ifndef MBED_ILI932x_H |
Geremia | 20:14daa48ffd4c | 2 | #define MBED_ILI932x_H |
Geremia | 20:14daa48ffd4c | 3 | |
Geremia | 20:14daa48ffd4c | 4 | |
Geremia | 20:14daa48ffd4c | 5 | |
Geremia | 20:14daa48ffd4c | 6 | #include "mbed.h" |
Geremia | 20:14daa48ffd4c | 7 | #include "TFT932x.h" |
Geremia | 20:14daa48ffd4c | 8 | |
Geremia | 20:14daa48ffd4c | 9 | /** Class for ILI932x tft display controller |
Geremia | 20:14daa48ffd4c | 10 | * to be copypasted and adapted for other controllers |
Geremia | 20:14daa48ffd4c | 11 | */ |
Geremia | 20:14daa48ffd4c | 12 | class ILI932x : public TFT932x |
Geremia | 20:14daa48ffd4c | 13 | { |
Geremia | 20:14daa48ffd4c | 14 | |
Geremia | 20:14daa48ffd4c | 15 | public: |
Geremia | 20:14daa48ffd4c | 16 | |
Geremia | 20:14daa48ffd4c | 17 | /** Create a PAR display interface |
Geremia | 20:14daa48ffd4c | 18 | * @param displayproto PAR_8 or PAR_16 |
Geremia | 20:14daa48ffd4c | 19 | * @param port GPIO port name to use |
Geremia | 20:14daa48ffd4c | 20 | * @param CS pin connected to CS of display |
Geremia | 20:14daa48ffd4c | 21 | * @param reset pin connected to RESET of display |
Geremia | 20:14daa48ffd4c | 22 | * @param DC pin connected to data/command of display |
Geremia | 20:14daa48ffd4c | 23 | * @param WR pin connected to SDI of display |
Geremia | 20:14daa48ffd4c | 24 | * @param RD pin connected to RS of display |
Geremia | 20:14daa48ffd4c | 25 | * @param name The name used by the parent class to access the interface |
Geremia | 20:14daa48ffd4c | 26 | * @param LCDSIZE_X x size in pixel - optional |
Geremia | 20:14daa48ffd4c | 27 | * @param LCDSIZE_Y y size in pixel - optional |
Geremia | 20:14daa48ffd4c | 28 | */ |
Geremia | 20:14daa48ffd4c | 29 | ILI932x(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 = 320); |
Geremia | 20:14daa48ffd4c | 30 | |
Geremia | 20:14daa48ffd4c | 31 | /** Create an SPI display interface |
Geremia | 20:14daa48ffd4c | 32 | * @param displayproto SPI_8 or SPI_16 |
Geremia | 20:14daa48ffd4c | 33 | * @param Hz SPI speed in Hz |
Geremia | 20:14daa48ffd4c | 34 | * @param mosi SPI pin |
Geremia | 20:14daa48ffd4c | 35 | * @param miso SPI pin |
Geremia | 20:14daa48ffd4c | 36 | * @param sclk SPI pin |
Geremia | 20:14daa48ffd4c | 37 | * @param CS pin connected to CS of display |
Geremia | 20:14daa48ffd4c | 38 | * @param reset pin connected to RESET of display |
Geremia | 20:14daa48ffd4c | 39 | * @param name The name used by the parent class to access the interface |
Geremia | 20:14daa48ffd4c | 40 | * @param LCDSIZE_X x size in pixel - optional |
Geremia | 20:14daa48ffd4c | 41 | * @param LCDSIZE_Y y size in pixel - optional |
Geremia | 20:14daa48ffd4c | 42 | */ |
Geremia | 20:14daa48ffd4c | 43 | ILI932x(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, const char* name, unsigned int LCDSIZE_X = 240, unsigned int LCDSIZE_Y= 320); |
Geremia | 20:14daa48ffd4c | 44 | |
Geremia | 20:14daa48ffd4c | 45 | |
Geremia | 20:14daa48ffd4c | 46 | |
Geremia | 20:14daa48ffd4c | 47 | protected: |
Geremia | 20:14daa48ffd4c | 48 | |
Geremia | 20:14daa48ffd4c | 49 | |
Geremia | 20:14daa48ffd4c | 50 | /** Init command sequence |
Geremia | 20:14daa48ffd4c | 51 | */ |
Geremia | 20:14daa48ffd4c | 52 | void init9325(); |
Geremia | 20:14daa48ffd4c | 53 | |
Geremia | 20:14daa48ffd4c | 54 | |
Geremia | 20:14daa48ffd4c | 55 | |
Geremia | 20:14daa48ffd4c | 56 | }; |
Geremia | 20:14daa48ffd4c | 57 | #endif |