My controller identifies as an ILI9328, but only works if initialised as an ILI9325. This fork includes a fix to force 9325 initialization when a 9328 is detected.

Dependents:   TouchScreenCalibrate TouchScreenGUIDemo

Fork of UniGraphic by GraphicsDisplay

Committer:
Duncan McIntyre
Date:
Sun Jun 21 15:23:02 2020 +0100
Revision:
34:091b954c3205
Parent:
30:87855d03d91a
Updated to include latest changes from upstream
Added a class to provide an interface for my MINI-STM32-V3.0 board.
This class uses direct GPIO access to achieve decent update speeds.

Who changed what in which revision?

UserRevisionLine numberNew 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 21:ae0a4eedfc90 30
Geremia 21:ae0a4eedfc90 31 /** Create a BUS display interface
Geremia 21:ae0a4eedfc90 32 * @param displayproto BUS_8 or BUS_16
Geremia 21:ae0a4eedfc90 33 * @param buspins array of PinName to group as Bus
Geremia 21:ae0a4eedfc90 34 * , i.e. PinName buspins[8]={PC_0,PC_1,PC_2,PC_3,D9,D8,D7,D6};
Geremia 21:ae0a4eedfc90 35 * @param CS pin connected to CS of display
Geremia 21:ae0a4eedfc90 36 * @param reset pin connected to RESET of display
Geremia 21:ae0a4eedfc90 37 * @param DC pin connected to data/command of display
Geremia 21:ae0a4eedfc90 38 * @param WR pin connected to SDI of display
Geremia 21:ae0a4eedfc90 39 * @param RD pin connected to RS of display
Geremia 21:ae0a4eedfc90 40 * @param name The name used by the parent class to access the interface
Geremia 21:ae0a4eedfc90 41 * @param LCDSIZE_X x size in pixel - optional
Geremia 21:ae0a4eedfc90 42 * @param LCDSIZE_Y y size in pixel - optional
Geremia 21:ae0a4eedfc90 43 */
Geremia 21:ae0a4eedfc90 44 ILI932x(proto_t displayproto, PinName* buspins, 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 45
Geremia 20:14daa48ffd4c 46 /** Create an SPI display interface
Geremia 20:14daa48ffd4c 47 * @param displayproto SPI_8 or SPI_16
Geremia 20:14daa48ffd4c 48 * @param Hz SPI speed in Hz
Geremia 20:14daa48ffd4c 49 * @param mosi SPI pin
Geremia 20:14daa48ffd4c 50 * @param miso SPI pin
Geremia 20:14daa48ffd4c 51 * @param sclk SPI pin
Geremia 20:14daa48ffd4c 52 * @param CS pin connected to CS of display
Geremia 20:14daa48ffd4c 53 * @param reset pin connected to RESET of display
Geremia 20:14daa48ffd4c 54 * @param name The name used by the parent class to access the interface
Geremia 20:14daa48ffd4c 55 * @param LCDSIZE_X x size in pixel - optional
Geremia 20:14daa48ffd4c 56 * @param LCDSIZE_Y y size in pixel - optional
Geremia 20:14daa48ffd4c 57 */
Geremia 20:14daa48ffd4c 58 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 59
Duncan McIntyre 34:091b954c3205 60 /** Create a MINISTM32 interface */
Duncan McIntyre 34:091b954c3205 61 ILI932x(const char* name);
Geremia 20:14daa48ffd4c 62
Geremia 20:14daa48ffd4c 63 protected:
Geremia 20:14daa48ffd4c 64
Geremia 20:14daa48ffd4c 65
Geremia 20:14daa48ffd4c 66 /** Init command sequence
Geremia 20:14daa48ffd4c 67 */
Geremia 20:14daa48ffd4c 68 void init9325();
Geremia 30:87855d03d91a 69 void init9320();
Geremia 20:14daa48ffd4c 70
Geremia 20:14daa48ffd4c 71 };
Geremia 20:14daa48ffd4c 72 #endif