output

Dependencies:   images mbed

Fork of display by madhu sudhana

Revision:
3:7d97b4f535c6
Parent:
2:e7a5b9bc75b4
--- a/ili9163lcd.h	Wed Jun 13 11:34:37 2018 +0000
+++ b/ili9163lcd.h	Thu Oct 04 11:19:42 2018 +0000
@@ -144,7 +144,124 @@
 #define NEGATIVE_GAMMA_CORRECT  0xE1
 #define GAM_R_SEL               0xF2
 
+//ADDING
+#define ST7735_NOP 0x0
+#define ST7735_SWRESET 0x01
+#define ST7735_RDDID 0x04
+#define ST7735_RDDST 0x09
 
+#define ST7735_SLPIN  0x10
+#define ST7735_SLPOUT  0x11
+#define ST7735_PTLON  0x12
+#define ST7735_NORON  0x13
+
+#define ST7735_INVOFF 0x20
+#define ST7735_INVON 0x21
+#define ST7735_DISPOFF 0x28
+#define ST7735_DISPON 0x29
+#define ST7735_CASET 0x2A
+#define ST7735_RASET 0x2B
+#define ST7735_RAMWR 0x2C
+#define ST7735_RAMRD 0x2E
+
+#define ST7735_COLMOD 0x3A
+#define ST7735_MADCTL 0x36
+
+
+#define ST7735_FRMCTR1 0xB1
+#define ST7735_FRMCTR2 0xB2
+#define ST7735_FRMCTR3 0xB3
+#define ST7735_INVCTR 0xB4
+#define ST7735_DISSET5 0xB6
+
+#define ST7735_PWCTR1 0xC0
+#define ST7735_PWCTR2 0xC1
+#define ST7735_PWCTR3 0xC2
+#define ST7735_PWCTR4 0xC3
+#define ST7735_PWCTR5 0xC4
+#define ST7735_VMCTR1 0xC5
+
+#define ST7735_RDID1 0xDA
+#define ST7735_RDID2 0xDB
+#define ST7735_RDID3 0xDC
+#define ST7735_RDID4 0xDD
+
+#define ST7735_PWCTR6 0xFC
+
+#define ST7735_GMCTRP1 0xE0
+#define ST7735_GMCTRN1 0xE1
+
+//ADDING
+#define _TFTWIDTH  240
+#define _TFTHEIGHT 320
+
+#define ILI9340_NOP     0x00
+#define ILI9340_SWRESET 0x01
+#define ILI9340_RDDID   0x04
+#define ILI9340_RDDST   0x09
+
+#define ILI9340_SLPIN   0x10
+#define ILI9340_SLPOUT  0x11
+#define ILI9340_PTLON   0x12
+#define ILI9340_NORON   0x13
+
+#define ILI9340_RDMODE  0x0A
+#define ILI9340_RDMADCTL  0x0B
+#define ILI9340_RDPIXFMT  0x0C
+#define ILI9340_RDIMGFMT  0x0A
+#define ILI9340_RDSELFDIAG  0x0F
+
+#define ILI9340_INVOFF  0x20
+#define ILI9340_INVON   0x21
+#define ILI9340_GAMMASET 0x26
+#define ILI9340_DISPOFF 0x28
+#define ILI9340_DISPON  0x29
+
+#define ILI9340_CASET   0x2A
+#define ILI9340_PASET   0x2B
+#define ILI9340_RAMWR   0x2C
+#define ILI9340_RAMRD   0x2E
+
+#define ILI9340_PTLAR   0x30
+#define ILI9340_MADCTL  0x36
+
+
+#define ILI9340_MADCTL_MY  0x80
+#define ILI9340_MADCTL_MX  0x40
+#define ILI9340_MADCTL_MV  0x20
+#define ILI9340_MADCTL_ML  0x10
+#define ILI9340_MADCTL_RGB 0x00
+#define ILI9340_MADCTL_BGR 0x08
+#define ILI9340_MADCTL_MH  0x04
+
+#define ILI9340_PIXFMT  0x3A
+
+#define ILI9340_FRMCTR1 0xB1
+#define ILI9340_FRMCTR2 0xB2
+#define ILI9340_FRMCTR3 0xB3
+#define ILI9340_INVCTR  0xB4
+#define ILI9340_DFUNCTR 0xB6
+
+#define ILI9340_PWCTR1  0xC0
+#define ILI9340_PWCTR2  0xC1
+#define ILI9340_PWCTR3  0xC2
+#define ILI9340_PWCTR4  0xC3
+#define ILI9340_PWCTR5  0xC4
+#define ILI9340_VMCTR1  0xC5
+#define ILI9340_VMCTR2  0xC7
+
+#define ILI9340_RDID1   0xDA
+#define ILI9340_RDID2   0xDB
+#define ILI9340_RDID3   0xDC
+#define ILI9340_RDID4   0xDD
+
+#define ILI9340_GMCTRP1 0xE0
+#define ILI9340_GMCTRN1 0xE1
+
+
+#define ST7735_CMD 0x100
+#define ST7735_DLY 0x200
+#define ST7735_END 0x400
 class ILI9163 {
  public:
 
@@ -158,11 +275,10 @@
   //
   // ILI9163 tft(D2,D3,D4,D5,D6);
   //
-  ILI9163(PinName SCK, PinName SDA, PinName A0, PinName RESET, PinName CS);
+  ILI9163(PinName SCK, PinName SDA,  PinName RESET, PinName CS);
 
   DigitalOut SCK_;
   DigitalOut SDA_;
-  DigitalOut A0_;
   DigitalOut RESET_;
   DigitalOut CS_;
 
@@ -196,8 +312,11 @@
   inline uint8_t lcdTextY(uint8_t y) { return y*font_hor; }
 
   //  LCD function prototypes
+  void mosi_test(void);
+
   void lcdReset(void);
   void lcdWriteCommand(uint8_t address);
+ void  WriteData(uint8_t Data);
   void lcdWriteParameter(uint8_t parameter);
   void lcdWriteData(uint8_t dataByte1, uint8_t dataByte2);
   void lcdInitialise(uint8_t orientation);