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:
85:022bba13c5c4
Parent:
84:e102021864b5
Child:
86:e86b355940f4
--- a/RA8875.h	Mon Jan 12 01:10:35 2015 +0000
+++ b/RA8875.h	Tue Jan 13 12:31:44 2015 +0000
@@ -518,12 +518,12 @@
     ///     do {
     ///        point_t point = {0, 0};
     ///        if (display.TouchPanelReadable(&point)) {
-    ///            display.pixel(point.x, point.y, Red);
+    ///            display.pixel(point, Red);
     ///        }
     ///    } while (t.read_ms() < 30000);
     /// @endcode
     ///
-    /// @param[out] touch is the touch point, if a touch is registered.
+    /// @param[out] TouchPoint is the touch point, if a touch is registered.
     /// @returns a value indicating the state of the touch,
     ///         - no_cal:   no calibration matrix is available, touch coordinates are not returned.
     ///         - no_touch: no touch is detected, touch coordinates are not returned.
@@ -531,7 +531,37 @@
     ///         - held:     held after touch, touch coordinates are returned.
     ///         - release:  indicates a release, touch coordinates are returned.
     ///
-    TouchCode_t TouchPanelReadable(point_t * touch = NULL);
+    TouchCode_t TouchPanelReadable(point_t * TouchPoint = NULL);
+
+
+    /// Wait for a touch panel touch and return it.
+    /// 
+    /// This method is similar to Serial.getc() in that it will wait for a touch
+    /// and then return. In order to extract the coordinates of the touch, a
+    /// valid pointer to a point_t must be provided.
+    ///
+    /// @note There is no timeout on this function, so its use is not recommended.
+    ///
+    /// @code
+    ///     Timer t;
+    ///     t.start();
+    ///     do {
+    ///        point_t point = {0, 0};
+    ///        display.TouchPanelGet(&point);   // hangs here until touch
+    ///        display.pixel(point, Red);
+    ///    } while (t.read_ms() < 30000);
+    /// @endcode
+    ///
+    /// @param[out] TouchPoint is the touch point, if a touch is registered.
+    /// @returns a value indicating the state of the touch,
+    ///         - no_cal:   no calibration matrix is available, touch coordinates are not returned.
+    ///         - no_touch: no touch is detected, touch coordinates are not returned.
+    ///         - touch:    touch is detected, touch coordinates are returned.
+    ///         - held:     held after touch, touch coordinates are returned.
+    ///         - release:  indicates a release, touch coordinates are returned.
+    ///
+    TouchCode_t TouchPanelGet(point_t * TouchPoint);
+
 
     /// Calibrate the touch panel.
     ///
@@ -593,7 +623,7 @@
     ///             non-volatile memory to recover the calibration after a power fail.
     /// @returns success/failure code. @see RetCode_t.
     ///
-    RetCode_t TouchPanelCalibrate(tpMatrix_t * matrix);
+    RetCode_t TouchPanelCalibrate(tpMatrix_t * matrix = NULL);
 
     /// Perform the touch panel calibration process.
     ///
@@ -612,30 +642,6 @@
     ///
     RetCode_t TouchPanelCalibrate(const char * msg, tpMatrix_t * matrix = NULL);
 
-    /// Wait for a touch panel touch and return it.
-    /// 
-    /// This method is similar to Serial.getc() in that it will wait for a touch
-    /// and then return. In order to extract the coordinates of the touch, a
-    /// valid pointer to a point_t must be provided.
-    ///
-    /// @note There is no timeout on this function, so its use is not recommended.
-    ///
-    /// @code
-    ///     Timer t;
-    ///     t.start();
-    ///     do {
-    ///        point_t point = {0, 0};
-    ///        display.TouchPanelGet(&point);
-    ///        display.pixel(point.x, point.y, Red);
-    ///    } while (t.read_ms() < 30000);
-    /// @endcode
-    ///
-    /// @param[out] touch is the touch point, if a touch is registered.
-    /// @returns true if a touch was registered, and touch is updated.
-    /// @returns false if no touch was detected, or if the calibration matrix is not defined.
-    ///
-    bool TouchPanelGet(point_t * touch);
-
     /// Set the calibration matrix for the touch panel.
     ///
     /// This method is used to set the calibration matrix for the touch panel. After