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:   testUniGraphic_150217 maze_TFT_MMA8451Q TFT_test_frdm-kl25z TFT_test_NUCLEO-F411RE ... more

Committer:
Geremia
Date:
Tue Jan 25 17:57:55 2022 +0000
Revision:
34:c66986d80f72
Parent:
21:ae0a4eedfc90
align attribute fixed to gcc style, updated to OS6 then got bored

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Geremia 18:ffa58f1a680a 1 #ifndef MBED_ST7565_H
Geremia 18:ffa58f1a680a 2 #define MBED_ST7565_H
Geremia 18:ffa58f1a680a 3
Geremia 18:ffa58f1a680a 4
Geremia 18:ffa58f1a680a 5
Geremia 18:ffa58f1a680a 6 #include "mbed.h"
Geremia 18:ffa58f1a680a 7 #include "LCD.h"
Geremia 18:ffa58f1a680a 8
Geremia 18:ffa58f1a680a 9 /** Class for ST7565 and similar display controllers
Geremia 18:ffa58f1a680a 10 * to be copypasted and adapted for other controllers
Geremia 18:ffa58f1a680a 11 */
Geremia 18:ffa58f1a680a 12 class ST7565 : public LCD
Geremia 18:ffa58f1a680a 13 {
Geremia 18:ffa58f1a680a 14
Geremia 18:ffa58f1a680a 15 public:
Geremia 18:ffa58f1a680a 16
Geremia 18:ffa58f1a680a 17 /** Create a PAR display interface
Geremia 18:ffa58f1a680a 18 * @param displayproto only supports PAR_8
Geremia 18:ffa58f1a680a 19 * @param port GPIO port name to use
Geremia 18:ffa58f1a680a 20 * @param CS pin connected to CS of display
Geremia 18:ffa58f1a680a 21 * @param reset pin connected to RESET of display
Geremia 18:ffa58f1a680a 22 * @param DC pin connected to data/command of display
Geremia 18:ffa58f1a680a 23 * @param WR pin connected to SDI of display
Geremia 18:ffa58f1a680a 24 * @param RD pin connected to RS of display
Geremia 18:ffa58f1a680a 25 * @param name The name used by the parent class to access the interface
Geremia 18:ffa58f1a680a 26 * @param LCDSIZE_X x size in pixel - optional
Geremia 18:ffa58f1a680a 27 * @param LCDSIZE_Y y size in pixel - optional
Geremia 18:ffa58f1a680a 28 */
Geremia 18:ffa58f1a680a 29 ST7565(proto_t displayproto, PortName port, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name, unsigned int LCDSIZE_X = 132, unsigned int LCDSIZE_Y = 64);
Geremia 21:ae0a4eedfc90 30
Geremia 21:ae0a4eedfc90 31 /** Create a BUS display interface
Geremia 21:ae0a4eedfc90 32 * @param displayproto only supports BUS_8
Geremia 21:ae0a4eedfc90 33 * @param buspins array of PinName to group as Bus
Geremia 21:ae0a4eedfc90 34 * @param CS pin connected to CS of display
Geremia 21:ae0a4eedfc90 35 * @param reset pin connected to RESET of display
Geremia 21:ae0a4eedfc90 36 * @param DC pin connected to data/command of display
Geremia 21:ae0a4eedfc90 37 * @param WR pin connected to SDI of display
Geremia 21:ae0a4eedfc90 38 * @param RD pin connected to RS of display
Geremia 21:ae0a4eedfc90 39 * @param name The name used by the parent class to access the interface
Geremia 21:ae0a4eedfc90 40 * @param LCDSIZE_X x size in pixel - optional
Geremia 21:ae0a4eedfc90 41 * @param LCDSIZE_Y y size in pixel - optional
Geremia 21:ae0a4eedfc90 42 */
Geremia 21:ae0a4eedfc90 43 ST7565(proto_t displayproto, PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name, unsigned int LCDSIZE_X = 132, unsigned int LCDSIZE_Y = 64);
Geremia 18:ffa58f1a680a 44
Geremia 18:ffa58f1a680a 45 /** Create an SPI display interface
Geremia 18:ffa58f1a680a 46 * @param displayproto SPI_8 or SPI_16
Geremia 18:ffa58f1a680a 47 * @param Hz SPI speed in Hz
Geremia 18:ffa58f1a680a 48 * @param mosi SPI pin
Geremia 18:ffa58f1a680a 49 * @param miso SPI pin
Geremia 18:ffa58f1a680a 50 * @param sclk SPI pin
Geremia 18:ffa58f1a680a 51 * @param CS pin connected to CS of display
Geremia 18:ffa58f1a680a 52 * @param reset pin connected to RESET of display
Geremia 18:ffa58f1a680a 53 * @param DC pin connected to data/command of display
Geremia 18:ffa58f1a680a 54 * @param name The name used by the parent class to access the interface
Geremia 18:ffa58f1a680a 55 * @param LCDSIZE_X x size in pixel - optional
Geremia 18:ffa58f1a680a 56 * @param LCDSIZE_Y y size in pixel - optional
Geremia 18:ffa58f1a680a 57 */
Geremia 18:ffa58f1a680a 58 ST7565(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char* name, unsigned int LCDSIZE_X = 132, unsigned int LCDSIZE_Y = 64);
Geremia 18:ffa58f1a680a 59
Geremia 18:ffa58f1a680a 60
Geremia 18:ffa58f1a680a 61
Geremia 18:ffa58f1a680a 62 protected:
Geremia 18:ffa58f1a680a 63
Geremia 18:ffa58f1a680a 64
Geremia 18:ffa58f1a680a 65 /** Init command sequence
Geremia 18:ffa58f1a680a 66 */
Geremia 18:ffa58f1a680a 67 void init();
Geremia 18:ffa58f1a680a 68
Geremia 18:ffa58f1a680a 69
Geremia 18:ffa58f1a680a 70
Geremia 18:ffa58f1a680a 71 };
Geremia 18:ffa58f1a680a 72 #endif