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:
Tue Feb 11 21:26:59 2020 +0000
Parent:
195:17e176dbd6eb
Child:
197:853d08e2fb53
Commit message:
Added puts w/point_t parameter.

Changed in this revision

Fonts/FontMods.h Show annotated file Show diff for this revision Revisions of this file
GraphicsDisplay.h Show annotated file Show diff for this revision Revisions of this file
GraphicsDisplayGIF.cpp Show annotated file Show diff for this revision Revisions of this file
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
RA8875_Touch.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Fonts/FontMods.h	Tue Feb 11 18:33:44 2020 +0000
+++ b/Fonts/FontMods.h	Tue Feb 11 21:26:59 2020 +0000
@@ -9,7 +9,7 @@
 #
 # Parse and Modify Mikroe Font File and make a few strategic changes
 #
-# Copyright (c) 2019 by Smartware Computing, all rights reserved.
+# @copyright Copyright © 2012-2020 by Smartware Computing, all rights reserved.
 #
 use strict;
 use warnings; 
--- a/GraphicsDisplay.h	Tue Feb 11 18:33:44 2020 +0000
+++ b/GraphicsDisplay.h	Tue Feb 11 21:26:59 2020 +0000
@@ -4,10 +4,14 @@
 /// @copyright © 2007-2009 sford
 /// Released under the MIT License: http://mbed.org/license/mit
 ///
-/// extensive changes in the support of the RA8875 display by
-/// Smartware Computing.
-/// @copyright © 2019 Smartware Computing.
+/// extensive changes in the support of the RA8875 display by Smartware Computing.
 ///
+/// @copyright Copyright © 2012-2020 by Smartware Computing, all rights reserved.
+///     This library is predominantly, that of Smartware Computing, however some
+///     portions are compiled from the work of others. Where the contribution of
+///     others was listed as copyright, that copyright is maintained, even as a
+///     derivative work may have been created for better integration in this library.
+///     See @ref Copyright_References.
 ///
 /// A library for providing a common base class for Graphics displays
 /// To port a new display, derive from this class and implement
--- a/GraphicsDisplayGIF.cpp	Tue Feb 11 18:33:44 2020 +0000
+++ b/GraphicsDisplayGIF.cpp	Tue Feb 11 21:26:59 2020 +0000
@@ -1,7 +1,3 @@
-
-
-
-// GIFRender.cpp : Defines the entry point for the console application.
 //
 // The code in this file was initially found online, in a tutorial.
 // It has been revised significantly in this derivative.
--- a/RA8875.cpp	Tue Feb 11 18:33:44 2020 +0000
+++ b/RA8875.cpp	Tue Feb 11 21:26:59 2020 +0000
@@ -1401,8 +1401,10 @@
 {
     unsigned char mwcr0;
 
-    mwcr0 = ReadCommand(RA8875_MWCR0);
-    WriteCommand(RA8875_MWCR0, mwcr0 & ~0x80);    // Graphics write mode
+    mwcr0 = ReadCommand(RA8875_MWCR0) & ~0x80;
+    mwcr0 |= 0x00;
+    INFO("mwcr0 %02X", mwcr0);
+    WriteCommand(RA8875_MWCR0, mwcr0);    // Graphics write mode
     WriteCommand(RA8875_MRWC);         // Prepare for streaming data
     return noerror;
 }
@@ -1421,6 +1423,12 @@
 }
 
 
+void RA8875::puts(point_t pt, const char * string)
+{
+    SetTextCursor(pt);
+    puts(string);
+}
+
 void RA8875::puts(loc_t x, loc_t y, const char * string)
 {
     SetTextCursor(x,y);
--- a/RA8875.h	Tue Feb 11 18:33:44 2020 +0000
+++ b/RA8875.h	Tue Feb 11 21:26:59 2020 +0000
@@ -58,19 +58,29 @@
 /// * @ref External_Resources
 /// * @ref Future_Plans
 ///
-/// @todo Add APIs for the 2nd RA8875 PWM channel. If the frequency can be independently
-///     controlled, it could be used as a simple beeper.
+/// @todo Move the global enums into the class (e.g. NOFILL becomes RA8875::NOFILL) to
+///     avoid namespace clashes.
+/// @todo Integrate the touch as a runtime linkable feature, which can then eliminate
+///     the huge memory footprint for the GSL1680 firmware when it is not needed.
+/// @todo Integrate installed font-rom.
 /// @todo Figure out how to "init()" in the constructor. I ran into some issues if
 ///     the display was instantiated before main(), and the code would not run,
 ///     thus the exposure and activation of the init() function. If the constructor
 ///     was within main(), then it seemed to work as expected.
+/// @todo Add Scroll support for text.
+/// @todo Add Hardware reset signal - but testing to date indicates it is not needed.
+/// @todo Add high level objects - x-y graph, meter, others... but these will
+///     probably be best served in another class, since they may not
+///     be needed for many uses.
+/// @todo Add APIs for the 2nd RA8875 PWM channel. If the frequency can be independently
+///     controlled, it could be used as a simple beeper.
 ///
 /// @note As the author of this library, let me state that I am not affiliated with
 ///     Raio (silicon provider of the RA8875), or with BuyDisplay.com (where a lot
 ///     of these displays can be purchased), I am simply a very satisfied customer
 ///     of the technology of the RA8875 chip.
 ///
-/// @copyright Copyright © 2012-2019 by Smartware Computing, all rights reserved.
+/// @copyright Copyright © 2012-2020 by Smartware Computing, all rights reserved.
 ///     This library is predominantly, that of Smartware Computing, however some
 ///     portions are compiled from the work of others. Where the contribution of
 ///     others was listed as copyright, that copyright is maintained, even as a
@@ -503,14 +513,6 @@
 /// }
 /// @endcode
 ///
-/// @todo Add Scroll support for text.
-/// @todo Add Hardware reset signal - but testing to date indicates it is not needed.
-/// @todo Add high level objects - x-y graph, meter, others... but these will
-///     probably be best served in another class, since they may not
-///     be needed for many uses.
-/// @todo Move the global enums into the class (e.g. NOFILL becomes RA8875::NOFILL) to
-///     avoid namespace clashes.
-///
 class RA8875 : public GraphicsDisplay
 {
 public:
@@ -1996,6 +1998,18 @@
     /// Write string of text to the display at the specified location.
     ///
     /// @code
+    ///     const point_t pt = {10, 25};
+    ///     lcd.puts(pt, "Test STring");
+    /// @endcode
+    ///
+    /// @param[in] pt is the x,y position as a point
+    /// @param[in] string is the null terminated string to send to the display.
+    ///
+    void puts(point_t pt, const char * string);
+
+    /// Write string of text to the display at the specified location.
+    ///
+    /// @code
     ///     lcd.puts(10,25, "Test STring");
     /// @endcode
     ///
--- a/RA8875_Touch.cpp	Tue Feb 11 18:33:44 2020 +0000
+++ b/RA8875_Touch.cpp	Tue Feb 11 21:26:59 2020 +0000
@@ -87,7 +87,6 @@
 {
     if (useTouchPanel == TP_GSL1680) {
         INFO("TouchPanelInit: TP_GSL1680");
-        /// @todo Added support for TP_GSL1680
     } else if (useTouchPanel == TP_FT5206) {
         INFO("TouchPanelInit: TP_FT5206");
         TouchPanelInit();