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:
dswood
Date:
Fri Jan 07 12:05:27 2022 +0000
Revision:
34:67b3634507da
Parent:
18:ffa58f1a680a
The libraries used would not output %.  I tried escaping it but nothing worked. So I changed the & in the font and used that.  Not cleaver I know.  I don't recommend this to anyone.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Geremia 4:12ba0ecc2c1f 1 #ifndef MBED_TFT_MIPI_H
Geremia 4:12ba0ecc2c1f 2 #define MBED_TFT_MIPI_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 (quite)standard MIPI-DBI TypeB (parallel) and TypeC (spi) TFT display controller
Geremia 4:12ba0ecc2c1f 10 * for Ilitek ILI9481, Renesas R61581, Raydium RM68042
Geremia 4:12ba0ecc2c1f 11 * to be copypasted and adapted for other controllers
Geremia 4:12ba0ecc2c1f 12 */
Geremia 4:12ba0ecc2c1f 13 class TFT_MIPI : public TFT
Geremia 4:12ba0ecc2c1f 14 {
Geremia 4:12ba0ecc2c1f 15
Geremia 4:12ba0ecc2c1f 16 public:
Geremia 4:12ba0ecc2c1f 17
Geremia 4:12ba0ecc2c1f 18 /** Create a PAR display interface
Geremia 18:ffa58f1a680a 19 * @param displayproto PAR_8 or PAR_16
Geremia 4:12ba0ecc2c1f 20 * @param port GPIO port name to use
Geremia 4:12ba0ecc2c1f 21 * @param CS pin connected to CS of display
Geremia 4:12ba0ecc2c1f 22 * @param reset pin connected to RESET of display
Geremia 4:12ba0ecc2c1f 23 * @param DC pin connected to data/command of display
Geremia 4:12ba0ecc2c1f 24 * @param WR pin connected to SDI of display
Geremia 4:12ba0ecc2c1f 25 * @param RD pin connected to RS of display
Geremia 4:12ba0ecc2c1f 26 * @param name The name used by the parent class to access the interface
dreschpe 9:1749ae993cfe 27 * @param LCDSIZE_X x size in pixel - optional
dreschpe 9:1749ae993cfe 28 * @param LCDSIZE_Y y size in pixel - optional
Geremia 4:12ba0ecc2c1f 29 */
dreschpe 9:1749ae993cfe 30 TFT_MIPI(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name , unsigned int LCDSIZE_X = 320, unsigned int LCDSIZE_Y = 480);
Geremia 4:12ba0ecc2c1f 31
Geremia 4:12ba0ecc2c1f 32 /** Create an SPI display interface
Geremia 18:ffa58f1a680a 33 * @param displayproto SPI_8 or SPI_16
Geremia 4:12ba0ecc2c1f 34 * @param Hz SPI speed in Hz
Geremia 4:12ba0ecc2c1f 35 * @param mosi SPI pin
Geremia 4:12ba0ecc2c1f 36 * @param miso SPI pin
Geremia 4:12ba0ecc2c1f 37 * @param sclk SPI pin
Geremia 4:12ba0ecc2c1f 38 * @param CS pin connected to CS of display
Geremia 4:12ba0ecc2c1f 39 * @param reset pin connected to RESET of display
Geremia 4:12ba0ecc2c1f 40 * @param DC pin connected to data/command of display
Geremia 4:12ba0ecc2c1f 41 * @param name The name used by the parent class to access the interface
dreschpe 9:1749ae993cfe 42 * @param LCDSIZE_X x size in pixel - optional
dreschpe 9:1749ae993cfe 43 * @param LCDSIZE_Y y size in pixel - optional
Geremia 4:12ba0ecc2c1f 44 */
dreschpe 9:1749ae993cfe 45 TFT_MIPI(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name , unsigned int LCDSIZE_X = 320, unsigned int LCDSIZE_Y = 480);
Geremia 4:12ba0ecc2c1f 46
Geremia 4:12ba0ecc2c1f 47
Geremia 4:12ba0ecc2c1f 48
Geremia 4:12ba0ecc2c1f 49 protected:
Geremia 4:12ba0ecc2c1f 50
Geremia 4:12ba0ecc2c1f 51
Geremia 4:12ba0ecc2c1f 52 /** Init command sequence
Geremia 4:12ba0ecc2c1f 53 */
Geremia 4:12ba0ecc2c1f 54 void init();
Geremia 4:12ba0ecc2c1f 55
Geremia 4:12ba0ecc2c1f 56
Geremia 4:12ba0ecc2c1f 57
Geremia 4:12ba0ecc2c1f 58 };
Geremia 4:12ba0ecc2c1f 59 #endif