Gustavo D. Serafim / UniGraphicILI9486GraphicsTest

Dependents:   mbed_ili9486

Files at this revision

API Documentation at this revision

Comitter:
guhserafs
Date:
Wed May 20 12:57:44 2020 +0000
Parent:
33:f87f06292637
Commit message:
Changed ili9486 init methods to support pinName arrays.

Changed in this revision

Inits/ILI9486.cpp Show annotated file Show diff for this revision Revisions of this file
Inits/ILI9486.h Show annotated file Show diff for this revision Revisions of this file
--- a/Inits/ILI9486.cpp	Mon Feb 06 12:29:33 2017 +0000
+++ b/Inits/ILI9486.cpp	Wed May 20 12:57:44 2020 +0000
@@ -28,6 +28,21 @@
     cls();
     locate(0,0); 
 }
+
+ILI9486::ILI9486(proto_t displayproto, PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char *name , unsigned int LCDSIZE_X, unsigned  int LCDSIZE_Y)
+    : TFT(displayproto, buspins, CS, reset, DC, WR, RD, LCDSIZE_X, LCDSIZE_Y, name)
+{
+    hw_reset();
+    BusEnable(true);
+    identify(); // will collect tftID and set mipistd flag
+    init();
+    auto_gram_read_format();// try to get read gram pixel format, could be 16bit or 18bit, RGB or BGR. Will set flags accordingly
+    set_orientation(0);
+ //   FastWindow(true); // most but not all controllers support this, even if datasheet tells they should. ILI9486 does not, at least in par mode
+    cls();
+    locate(0,0); 
+}
+
 ILI9486::ILI9486(proto_t displayproto, int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, const char *name, unsigned int LCDSIZE_X, unsigned  int LCDSIZE_Y)
     : TFT(displayproto, Hz, mosi, miso, sclk, CS, reset, DC, LCDSIZE_X, LCDSIZE_Y, name)
 {
@@ -41,6 +56,7 @@
     cls();
     locate(0,0); 
 }
+
 // reset and init the lcd controller
 void ILI9486::init()
 {
--- a/Inits/ILI9486.h	Mon Feb 06 12:29:33 2017 +0000
+++ b/Inits/ILI9486.h	Wed May 20 12:57:44 2020 +0000
@@ -27,6 +27,21 @@
     * @param LCDSIZE_Y y size in pixel - optional
     */ 
     ILI9486(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);
+    
+    /** Create a BUS display interface
+    * @param displayproto BUS_8 or BUS_16
+    * @param port GPIO port name to use
+    * @param CS pin connected to CS of display
+    * @param reset pin connected to RESET of display
+    * @param DC pin connected to data/command of display
+    * @param WR pin connected to SDI of display
+    * @param RD pin connected to RS of display
+    * @param name The name used by the parent class to access the interface
+    * @param LCDSIZE_X x size in pixel - optional
+    * @param LCDSIZE_Y y size in pixel - optional
+    */ 
+    
+    ILI9486(proto_t displayproto, PinName* buspins, PinName CS, PinName reset, PinName DC, PinName WR, PinName RD, const char* name, unsigned int LCDSIZE_X = 320, unsigned  int LCDSIZE_Y = 480);
   
     /** Create an SPI display interface
     * @param displayproto SPI_8 or SPI_16