Program to demonstrate the features of the DisplayModule DM-TFT24-104 display using the UniGraphics library.

Dependencies:   DmTouch_UniGraphic UniGraphic mbed

Fork of DisplayModule24_demo by Whitworth-EN173-2016

Revision:
1:083257298075
Parent:
0:2ccd65a72ab8
Child:
2:2b781c215ac0
--- a/main.cpp	Sat Feb 14 19:56:13 2015 +0000
+++ b/main.cpp	Mon Feb 16 01:04:34 2015 +0000
@@ -7,15 +7,17 @@
 #include "Arial43x48_numb.h"
 #include "pict.h"
 
-#include "IST3020.h"
+//#include "IST3020.h"
 //#include "UC1608.h"
 //#include "ILI9341.h"
+#include "ILI9486.h"
 
 Serial pc(USBTX, USBRX);
 
-IST3020 LCD(PAR_8, PortC, PC_8, PC_9, PA_0, PA_1, PA_4,"LCD"); // Parallel8bit, Port, CS, reset, A0, WR, RD for F302
-//UC1608 LCD(SPI_16, 10000000, D11, D12, D13, D10, D9, D8,"LCD"); // Spi16bit, 10MHz, mosi, miso, sclk, cs, reset, dc
-//ILI9341 LCD(SPI_16, 10000000, D11, D12, D13, D10, D9, D8,"LCD"); // Spi16bit, 10MHz, mosi, miso, sclk, cs, reset, dc
+//IST3020 LCD(PAR_8, PortC, PC_8, PC_9, PA_0, PA_1, PA_4,"LCD"); // Parallel 8bit, Port, CS, reset, A0, WR, RD for F302
+//UC1608 LCD(SPI_16, 10000000, D11, D12, D13, D10, D9, D8,"LCD"); // Spi 16bit, 10MHz, mosi, miso, sclk, cs, reset, dc
+//ILI9341 LCD(SPI_16, 10000000, D11, D12, D13, D10, D9, D8,"LCD"); // Spi 16bit, 10MHz, mosi, miso, sclk, cs, reset, dc
+ILI9486 LCD(PAR_16, PortC, PH_0, PH_1, PA_0, PA_1, PA_4,"LCD"); // Parallel 16bit, Port, CS, reset, A0, WR, RD for F401
 
 Timer t;
 
@@ -38,18 +40,29 @@
     LCD.background(backgroundcolor);    // set background to black
     LCD.foreground(foregroundcolor);    // set chars to white
     LCD.cls();                // clear the screen
+ //   LCD.set_font((unsigned char*) Terminal6x8);
     
     // mem write/read test
- /*   LCD.locate(0,0);
     unsigned short readback;
-    unsigned short colorstep = (0x10000/LCD.width())
-    for(unsigned short i=0; i<LCD.width(); i++) LCD.pixel(i,0,i*colorstep); // write line
+    unsigned short colorstep = (0x10000/LCD.width());
+    for(unsigned short i=0; i<LCD.width(); i++)
+    {
+        LCD.pixel(i,0,i*colorstep); // write line
+    }
+    bool readerror=false;
     for(unsigned short i=0; i<LCD.width(); i++) // verify line
     {
         readback = LCD.pixelread(i,0);
-        if(readback!=i*colorstep) pc.printf("pix %.4X readback %.4X\r\n", i*colorstep, readback);
+        if(readback!=i*colorstep)
+        {
+            readerror=true;
+            pc.printf("pix %.4X readback %.4X\r\n", i*colorstep, readback);
+        }
     }
-*/
+    LCD.locate(0,10);
+    LCD.printf("pixelread test %s\r\n", readerror ? "FAIL":"PASS");
+    wait(2);
+
     
     
     while(1)