Library to control a Graphics TFT connected to 4-wire SPI - revised for the Raio RA8875 Display Controller.

Dependents:   FRDM_RA8875_mPaint RA8875_Demo RA8875_KeyPadDemo SignalGenerator ... more

Fork of SPI_TFT by Peter Drescher

See Components - RA8875 Based Display

Enhanced touch-screen support - where it previous supported both the Resistive Touch and Capacitive Touch based on the FT5206 Touch Controller, now it also has support for the GSL1680 Touch Controller.

Offline Help Manual (Windows chm)

/media/uploads/WiredHome/ra8875.zip.bin (download, rename to .zip and unzip)

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sun Jan 12 18:44:58 2014 +0000
Parent:
19:3f82c1161fd2
Child:
21:3c1efb192927
Commit message:
Triangle methods are now working - now does not perform unintended recursive call...

Changed in this revision

RA8875.cpp Show annotated file Show diff for this revision Revisions of this file
RA8875.h Show annotated file Show diff for this revision Revisions of this file
WebColors.h Show annotated file Show diff for this revision Revisions of this file
--- a/RA8875.cpp	Sun Jan 12 17:40:32 2014 +0000
+++ b/RA8875.cpp	Sun Jan 12 18:44:58 2014 +0000
@@ -7,6 +7,11 @@
 ///
 #include "RA8875.h"
 
+DigitalOut zz1(LED1);
+DigitalOut zz2(LED2);
+DigitalOut zz3(LED3);
+DigitalOut zz4(LED4);
+
 //#define DEBUG "RAIO"
 // ...
 // INFO("Stuff to show %d", var); // new-line is automatically appended
@@ -508,15 +513,21 @@
 RetCode_t RA8875::triangle(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, 
     unsigned int x3, unsigned int y3, color_t color, fill_t fillit)
 {
+    RetCode_t ret;
+    
     foreground(color);
-    return triangle(x1,y1,x2,y2,x3,y3,color,fillit);
+    ret = triangle(x1,y1,x2,y2,x3,y3,fillit);
+    return ret;
 }
 
 RetCode_t RA8875::filltriangle(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, 
     unsigned int x3, unsigned int y3, color_t color, fill_t fillit)
 {
+    RetCode_t ret;
+
     foreground(color);
-    return triangle(x1,y1,x2,y2,x3,y3,color,fillit);
+    ret = triangle(x1,y1,x2,y2,x3,y3,fillit);
+    return ret;
 }
 
 RetCode_t RA8875::triangle(unsigned int x1, unsigned int y1 ,unsigned int x2, unsigned int y2, 
--- a/RA8875.h	Sun Jan 12 17:40:32 2014 +0000
+++ b/RA8875.h	Sun Jan 12 18:44:58 2014 +0000
@@ -16,22 +16,24 @@
 #define RGB(r,g,b) ( ((r<<8)&0xF800) | ((g<<3)&0x07E0) | (b>>3) )
 
 /// DOS colors - slightly color enhanced
-#define Black RGB(0,0,0)
-#define Blue RGB(0,0,187)
-#define Green RGB(0,187,0)
-#define Cyan RGB(0,187,187)
-#define Red RGB(187,0,0)
-#define Magenta RGB(187,0,187)
-#define Brown RGB(187,187,0)
-#define Gray RGB(187,187,187)
-#define Charcoal RGB(85,85,85)
-#define BrightBlue RGB(85,85,255)
-#define BrightGreen RGB(85,255,85)
-#define BrightCyan RGB(85,255,255)
-#define Orange RGB(255,85,85)
-#define Pink RGB(255,85,255)
-#define Yellow RGB(255,255,85)
-#define White RGB(255,255,255)
+#define Black       (color_t)(RGB(0,0,0))
+#define Blue        (color_t)(RGB(0,0,187))
+#define Green       (color_t)(RGB(0,187,0))
+#define Cyan        (color_t)(RGB(0,187,187))
+#define Red         (color_t)(RGB(187,0,0))
+#define Magenta     (color_t)(RGB(187,0,187))
+#define Brown       (color_t)(RGB(187,187,0))
+#define Gray        (color_t)(RGB(187,187,187))
+#define Charcoal    (color_t)(RGB(85,85,85))
+#define BrightBlue  (color_t)(RGB(85,85,255))
+#define BrightGreen (color_t)(RGB(85,255,85))
+#define BrightCyan  (color_t)(RGB(85,255,255))
+#define Orange      (color_t)(RGB(255,85,85))
+#define Pink        (color_t)(RGB(255,85,255))
+#define Yellow      (color_t)(RGB(255,255,85))
+#define White       (color_t)(RGB(255,255,255))
+
+#define BrightRed   (color_t)(RGB(255,0,0))
 
 //namespace SW_graphics
 //{
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WebColors.h	Sun Jan 12 18:44:58 2014 +0000
@@ -0,0 +1,38 @@
+
+#ifndef WEBCOLORS_H
+#define WEBCOLORS_H
+
+#include "RA8875.h"
+
+color_t WebColors[256] =
+    {
+    0x000000, 0x000033, 0x000066, 0x000099, 0x0000CC, 0x0000FF, 0x003300, 0x003333, 
+    0x003366, 0x003399, 0x0033CC, 0x0033FF, 0x006600, 0x006633, 0x006666, 0x006699, 
+    0x0066CC, 0x0066FF, 0x009900, 0x009933, 0x009966, 0x009999, 0x0099CC, 0x0099FF, 
+    0x00CC00, 0x00CC33, 0x00CC66, 0x00CC99, 0x00CCCC, 0x00CCFF, 0x00FF00, 0x00FF33, 
+    0x00FF66, 0x00FF99, 0x00FFCC, 0x00FFFF, 0x330000, 0x330033, 0x330066, 0x330099, 
+    0x3300CC, 0x3300FF, 0x333300, 0x333333, 0x333366, 0x333399, 0x3333CC, 0x3333FF, 
+    0x336600, 0x336633, 0x336666, 0x336699, 0x3366CC, 0x3366FF, 0x339900, 0x339933, 
+    0x339966, 0x339999, 0x3399CC, 0x3399FF, 0x33CC00, 0x33CC33, 0x33CC66, 0x33CC99, 
+    0x33CCCC, 0x33CCFF, 0x33FF00, 0x33FF33, 0x33FF66, 0x33FF99, 0x33FFCC, 0x33FFFF, 
+    0x660000, 0x660033, 0x660066, 0x660099, 0x6600CC, 0x6600FF, 0x663300, 0x663333, 
+    0x663366, 0x663399, 0x6633CC, 0x6633FF, 0x666600, 0x666633, 0x666666, 0x666699, 
+    0x6666CC, 0x6666FF, 0x669900, 0x669933, 0x669966, 0x669999, 0x6699CC, 0x6699FF, 
+    0x66CC00, 0x66CC33, 0x66CC66, 0x66CC99, 0x66CCCC, 0x66CCFF, 0x66FF00, 0x66FF33, 
+    0x66FF66, 0x66FF99, 0x66FFCC, 0x66FFFF, 0x990000, 0x990033, 0x990066, 0x990099, 
+    0x9900CC, 0x9900FF, 0x993300, 0x993333, 0x993366, 0x993399, 0x9933CC, 0x9933FF, 
+    0x996600, 0x996633, 0x996666, 0x996699, 0x9966CC, 0x9966FF, 0x999900, 0x999933, 
+    0x999966, 0x999999, 0x9999CC, 0x9999FF, 0x99CC00, 0x99CC33, 0x99CC66, 0x99CC99, 
+    0x99CCCC, 0x99CCFF, 0x99FF00, 0x99FF33, 0x99FF66, 0x99FF99, 0x99FFCC, 0x99FFFF, 
+    0xCC0000, 0xCC0033, 0xCC0066, 0xCC0099, 0xCC00CC, 0xCC00FF, 0xCC3300, 0xCC3333, 
+    0xCC3366, 0xCC3399, 0xCC33CC, 0xCC33FF, 0xCC6600, 0xCC6633, 0xCC6666, 0xCC6699, 
+    0xCC66CC, 0xCC66FF, 0xCC9900, 0xCC9933, 0xCC9966, 0xCC9999, 0xCC99CC, 0xCC99FF, 
+    0xCCCC00, 0xCCCC33, 0xCCCC66, 0xCCCC99, 0xCCCCCC, 0xCCCCFF, 0xCCFF00, 0xCCFF33, 
+    0xCCFF66, 0xCCFF99, 0xCCFFCC, 0xCCFFFF, 0xFF0000, 0xFF0033, 0xFF0066, 0xFF0099, 
+    0xFF00CC, 0xFF00FF, 0xFF3300, 0xFF3333, 0xFF3366, 0xFF3399, 0xFF33CC, 0xFF33FF, 
+    0xFF6600, 0xFF6633, 0xFF6666, 0xFF6699, 0xFF66CC, 0xFF66FF, 0xFF9900, 0xFF9933, 
+    0xFF9966, 0xFF9999, 0xFF99CC, 0xFF99FF, 0xFFCC00, 0xFFCC33, 0xFFCC66, 0xFFCC99, 
+    0xFFCCCC, 0xFFCCFF, 0xFFFF00, 0xFFFF33, 0xFFFF66, 0xFFFF99, 0xFFFFCC, 0xFFFFFF
+    };
+
+#endif // WEBCOLORS_H