Eric Coyle / TFT_ST7735

Dependents:   ME503_VehicleAssembly

Files at this revision

API Documentation at this revision

Comitter:
DrCoyle
Date:
Tue Aug 27 20:24:10 2019 +0000
Parent:
7:58d9c26fd03c
Commit message:
2019 Update

Changed in this revision

Adafruit_ST7735.cpp Show annotated file Show diff for this revision Revisions of this file
Adafruit_ST7735.h Show annotated file Show diff for this revision Revisions of this file
--- a/Adafruit_ST7735.cpp	Wed Sep 13 20:53:01 2017 +0000
+++ b/Adafruit_ST7735.cpp	Tue Aug 27 20:24:10 2019 +0000
@@ -19,9 +19,8 @@
 #include "mbed.h"
 #include "Adafruit_ST7735.h"
 
-
 // Constructor 
-Adafruit_ST7735::Adafruit_ST7735(PinName mosi, PinName miso, PinName clk, PinName cs, PinName rs): lcdPort(mosi,miso,clk), _cs(cs), _rs(rs),Adafruit_GFX(ST7735_TFTWIDTH, ST7735_TFTHEIGHT)
+Adafruit_ST7735::Adafruit_ST7735(PinName mosi, PinName miso, PinName clk, PinName cs, PinName rs, PinName rst): lcdPort(mosi,miso,clk), _cs(cs), _rs(rs), _rst(rst), Adafruit_GFX(ST7735_TFTWIDTH, ST7735_TFTHEIGHT)
 {
     lcdPort.format(8,3);
     lcdPort.frequency(10000000);
@@ -269,6 +268,11 @@
 
     // toggle RST low to reset; CS low so it'll listen to us
     _cs = 0;
+    _rst = 1;
+    wait_ms(500);
+    _rst = 0;
+    wait_ms(500);
+    _rst = 1;
     wait_ms(500);
     if(cmdList) commandList(cmdList);
     
--- a/Adafruit_ST7735.h	Wed Sep 13 20:53:01 2017 +0000
+++ b/Adafruit_ST7735.h	Tue Aug 27 20:24:10 2019 +0000
@@ -93,7 +93,7 @@
 
  public:
 
-  Adafruit_ST7735(PinName mosi, PinName miso, PinName clk, PinName CS, PinName RS);//PinName mosi, PinName miso, PinName sck
+  Adafruit_ST7735(PinName mosi, PinName miso, PinName clk, PinName CS, PinName RS, PinName RST);
 
   void     initB(void);                             // for ST7735B displays
   void     initR(uint8_t options = INITR_GREENTAB); // for ST7735R
@@ -127,7 +127,7 @@
     SPI lcdPort;            // does SPI MOSI, MISO and SCK
     DigitalOut _cs;         // does SPI CE
     DigitalOut _rs;         // register/date select
-    //DigitalOut _rst;        // does 3310 LCD_RST
+    DigitalOut _rst;        // does 3310 LCD_RST
 };
 
 #endif