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)

Revision:
53:86d24b9480b9
Parent:
50:2c4f474a2453
Child:
54:e117ad10fba6
Child:
63:ed787f5fcdc4
--- a/RA8875.h	Sat Mar 15 18:24:35 2014 +0000
+++ b/RA8875.h	Mon Mar 17 11:29:40 2014 +0000
@@ -37,14 +37,6 @@
 //namespace SW_graphics
 //{
 
-/// cursor type to be shown as the text cursor.
-typedef enum
-{
-    NOCURSOR,   ///< cursor is hidden
-    IBEAM,      ///< | cursor
-    UNDER,      ///< _ cursor
-    BLOCK       ///< Block cursor
-} cursor_t;
 
 /// This is a graphics library for the Raio RA8875 Display Controller chip
 /// attached to a 4-wire SPI interface.
@@ -72,6 +64,15 @@
 class RA8875 : public GraphicsDisplay
 {
 public:   
+    /// cursor type to be shown as the text cursor.
+    typedef enum
+    {
+        NOCURSOR,   ///< cursor is hidden
+        IBEAM,      ///< | cursor
+        UNDER,      ///< _ cursor
+        BLOCK       ///< Block cursor
+    } cursor_t;
+
     /// font type selection.
     typedef enum
     {
@@ -108,6 +109,18 @@
         ACTIVEWINDOW    ///< active window/region
     } Region_t;
     
+    /// Set the Layer 1/2 Display Mode
+    typedef enum
+    {
+        OnlyLayer1,         ///< Only layer 1 is visible
+        OnlyLayer2,         ///< Only layer 2 is visible
+        LightenOverlay,     ///< Lighten-overlay mode
+        TransparentMode,    ///< Transparent mode
+        BooleanOR,          ///< Boolean OR mode
+        BooleanAND,         ///< Boolean AND mode
+        FloatingWindow      ///< Floating Window mode
+    } LayerMode_T;
+    
     /// Constructor for a display based on the RAiO RA8875 
     /// display controller.
     ///
@@ -137,7 +150,7 @@
     ///
     /// @note The user manual refers to Layer 1 and Layer 2, however the
     ///     actual register values are value 0 and 1. This and other APIs
-    ///     use the values 0 and 1.
+    ///     that reference the layers use the values 0 and 1.
     ///
     /// @param layer selects the layer for subsequence commands, where
     ///     the values 0 and 1 represent layers 1 and 2 (as referred
@@ -155,8 +168,7 @@
     /// @param mode sets the mode in the Layer Transparency Register.
     /// @returns success/failure code. @see RetCode_t.
     ///
-    RetCode_t SetLayerMode(uint8_t mode);
-    
+    RetCode_t SetLayerMode(LayerMode_T mode);
     
     /// Set the layer transparency for each layer.
     ///
@@ -170,6 +182,17 @@
     /// 
     RetCode_t SetLayerTransparency(uint8_t layer1, uint8_t layer2);
     
+    /// Set the background color register used for transparency.
+    ///
+    /// This command sets the background color registers that are used
+    /// in the transparent color operations involving the layers.
+    /// 
+    /// @param color is optional and expressed in 16-bit format. If not
+    ///     supplied, a default of Black is used.
+    /// @returns success/failure code. @see RetCode_t.
+    ///
+    RetCode_t SetBackgroundTransparencyColor(color_t color = RGB(0,0,0));
+    
     /// Write a command to the display with a word of data.
     ///
     /// This is a high level command, and may invoke several primitives.