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:
115:c9862fd0c689
Parent:
114:dbfb996bfbf3
Child:
122:79e431f98fa9
--- a/GraphicsDisplay.h	Sun May 15 18:57:06 2016 +0000
+++ b/GraphicsDisplay.h	Mon May 16 02:05:37 2016 +0000
@@ -13,8 +13,10 @@
 
 #ifndef MBED_GRAPHICSDISPLAY_H
 #define MBED_GRAPHICSDISPLAY_H
+
 #include "Bitmap.h"
 #include "TextDisplay.h"
+#include "GraphicsDisplayJPEG.h"
 
 /// The GraphicsDisplay class 
 /// 
@@ -284,6 +286,16 @@
     ///
     RetCode_t RenderImageFile(loc_t x, loc_t y, const char *FileName);
 
+    /// This method reads a disk file that is in jpeg format and 
+    /// puts it on the screen.
+    ///
+    /// @param[in] x is the horizontal pixel coordinate
+    /// @param[in] y is the vertical pixel coordinate
+    /// @param[in] Name_JPG is the filename on the mounted file system.
+    /// @returns success or error code.
+    ///
+    RetCode_t RenderJpegFile(loc_t x, loc_t y, const char *Name_JPG);
+
     /// This method reads a disk file that is in bitmap format and 
     /// puts it on the screen.
     ///
@@ -420,6 +432,46 @@
     ///
     RetCode_t _RenderBitmap(loc_t x, loc_t y, uint32_t fileOffset, FILE * Image);
 
+private:
+    JRESULT jd_prepare(JDEC * jd, uint16_t(* infunc)(JDEC * jd, uint8_t * buffer, uint16_t bufsize), void * pool, uint16_t poolsize, void * filehandle);
+    
+    JRESULT jd_decomp(JDEC * jd, uint16_t(* outfunct)(JDEC * jd, void * stream, JRECT * rect), uint8_t scale);
+
+    uint16_t privInFunc(JDEC * jd, uint8_t * buff, uint16_t ndata);
+
+    uint16_t getJpegData(JDEC * jd, uint8_t *buff, uint16_t ndata);
+
+    uint16_t privOutFunc(JDEC * jd, void * bitmap, JRECT * rect);
+    
+    JRESULT mcu_output (
+        JDEC * jd,   /* Pointer to the decompressor object */
+        uint16_t (* outfunc)(JDEC * jd, void * stream, JRECT * rect),  /* RGB output function */
+        uint16_t x,     /* MCU position in the image (left of the MCU) */
+        uint16_t y      /* MCU position in the image (top of the MCU) */
+    );
+
+    int16_t bitext (    /* >=0: extracted data, <0: error code */
+        JDEC * jd,   /* Pointer to the decompressor object */
+        uint16_t nbit   /* Number of bits to extract (1 to 11) */
+    );
+
+    int16_t huffext (           /* >=0: decoded data, <0: error code */
+        JDEC * jd,           /* Pointer to the decompressor object */
+        const uint8_t * hbits,  /* Pointer to the bit distribution table */
+        const uint16_t * hcode,  /* Pointer to the code word table */
+        const uint8_t * hdata   /* Pointer to the data table */
+    );
+
+    JRESULT restart (
+        JDEC * jd,   /* Pointer to the decompressor object */
+        uint16_t rstn   /* Expected restert sequense number */
+    );
+
+    JRESULT mcu_load (
+        JDEC * jd        /* Pointer to the decompressor object */
+    );
+
+protected:
     /// Pure virtual method to write a boolean stream to the display.
     ///
     /// This takes a bit stream in memory and using the current color settings