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:
190:3132b7dfad82
Parent:
182:8832d03a2a29
Child:
193:74f80834d59d
--- a/RA8875_Regs.h	Thu Sep 19 21:45:18 2019 +0000
+++ b/RA8875_Regs.h	Sat Sep 21 17:30:00 2019 +0000
@@ -7,36 +7,36 @@
 
     // Touch Panel public macros
     #define RESISTIVE_TOUCH_POINTS 1
-    
+
     /* Touch Panel Enable/Disable Reg TPCR0[7] */
     #define TP_ENABLE   ((uint8_t)(1<<7))
     #define TP_DISABLE  ((uint8_t)(0<<7))
-    
+
     /* Touch Panel operating mode Reg TPCR1[6] */
-    #define TP_MODE_AUTO    ((uint8_t)(0<<6))   
+    #define TP_MODE_AUTO    ((uint8_t)(0<<6))
     #define TP_MODE_MANUAL  ((uint8_t)(1<<6))
-    
+
     /* Touch Panel debounce Reg TPCR1[2]    */
     #define TP_DEBOUNCE_OFF ((uint8_t)(0<<2))
     #define TP_DEBOUNCE_ON  ((uint8_t)(1<<2))
-    
+
     /* Touch Panel manual modes Reg TPCR1[1:0]  */
     #define TP_MANUAL_IDLE      0
     #define TP_MANUAL_WAIT      1
     #define TP_MANUAL_LATCH_X   2
     #define TP_MANUAL_LATCH_Y   3
-    
+
     /* Touch Panel ADC Clock modes Reg TPCR0[2:0] */
     #define TP_ADC_CLKDIV_1            0
-    #define TP_ADC_CLKDIV_2            1        
-    #define TP_ADC_CLKDIV_4            2        
-    #define TP_ADC_CLKDIV_8            3      
-    #define TP_ADC_CLKDIV_16           4        
-    #define TP_ADC_CLKDIV_32           5        
-    #define TP_ADC_CLKDIV_64           6        
+    #define TP_ADC_CLKDIV_2            1
+    #define TP_ADC_CLKDIV_4            2
+    #define TP_ADC_CLKDIV_8            3
+    #define TP_ADC_CLKDIV_16           4
+    #define TP_ADC_CLKDIV_32           5
+    #define TP_ADC_CLKDIV_64           6
     #define TP_ADC_CLKDIV_128          7
-            
-    
+
+
     /* Touch Panel Sample Time Reg TPCR0[6:4] */
     #define TP_ADC_SAMPLE_512_CLKS     ((uint8_t)(0<<4))
     #define TP_ADC_SAMPLE_1024_CLKS    ((uint8_t)(1<<4))
@@ -46,7 +46,7 @@
     #define TP_ADC_SAMPLE_16384_CLKS   ((uint8_t)(5<<4))
     #define TP_ADC_SAMPLE_32768_CLKS   ((uint8_t)(6<<4))
     #define TP_ADC_SAMPLE_65536_CLKS   ((uint8_t)(7<<4))
-    
+
     /* RA8875 interrupt enable/flag/clear masks */
     #define RA8875_INT_KEYSCAN          ((uint8_t)(1<<4))    /**< KEYSCAN interrupts  */
     #define RA8875_INT_DMA              ((uint8_t)(1<<3))    /**< DMA interrupts  */
@@ -61,7 +61,7 @@
     // the RA8875 PDF documentation.
     //
     // Missing registered that are used herein have been added
-    
+
     // Command/Data pins for SPI
     //#define RA8875_DATAWRITE            0x00
     //#define RA8875_DATAREAD             0x40
@@ -75,17 +75,17 @@
     #define RA8875_PWRR_SLEEP             0x02
     #define RA8875_PWRR_NORMAL            0x00
     #define RA8875_PWRR_SOFTRESET         0x01
-                                          
+
     #define RA8875_MRWC                   0x02
-                                          
+
     #define RA8875_GPIOX                  0xC7
-                                          
+
     #define RA8875_SYSR                   0x10
     #define RA8875_SYSR_8BPP              0x00
     #define RA8875_SYSR_16BPP             0x0C
     #define RA8875_SYSR_MCU8              0x00
     #define RA8875_SYSR_MCU16             0x03
-                                          
+
     #define RA8875_PCSR                   0x04
     #define RA8875_PCSR_PDATR             0x00
     #define RA8875_PCSR_PDATL             0x80
@@ -93,19 +93,19 @@
     #define RA8875_PCSR_2CLK              0x01
     #define RA8875_PCSR_4CLK              0x02
     #define RA8875_PCSR_8CLK              0x03
-                                          
+
     #define RA8875_HDWR                   0x14
-                                          
+
     #define RA8875_HNDFTR                 0x15
     #define RA8875_HNDFTR_DE_HIGH         0x00
     #define RA8875_HNDFTR_DE_LOW          0x80
-                                          
+
     #define RA8875_HNDR                   0x16
     #define RA8875_HSTR                   0x17
     #define RA8875_HPWR                   0x18
     #define RA8875_HPWR_LOW               0x00
     #define RA8875_HPWR_HIGH              0x80
-                                          
+
     #define RA8875_VDHR0                  0x19
     #define RA8875_VDHR1                  0x1A
     #define RA8875_VNDR0                  0x1B
@@ -115,7 +115,7 @@
     #define RA8875_VPWR                   0x1F
     #define RA8875_VPWR_LOW               0x00
     #define RA8875_VPWR_HIGH              0x80
-                                          
+
     #define RA8875_DPCR                   0x20
     #define RA8875_FNCR0                  0x21
     #define RA8875_FNCR1                  0x22
@@ -124,7 +124,7 @@
     #define RA8875_HOFS1                  0x25
     #define RA8875_VOFS0                  0x26
     #define RA8875_VOFS1                  0x27
-    
+
     #define RA8875_FLDR                   0x29
     #define RA8875_FCURXL                 0x2A
     #define RA8875_FCURXH                 0x2B
@@ -132,25 +132,25 @@
     #define RA8875_FCURYH                 0x2D
     #define RA8875_FWTYPSR                0x2E
     #define RA8875_SFROMS                 0x2F
-        
+
     #define RA8875_HSAW0                  0x30
     #define RA8875_HSAW1                  0x31
     #define RA8875_VSAW0                  0x32
     #define RA8875_VSAW1                  0x33
-                                          
+
     #define RA8875_HEAW0                  0x34
     #define RA8875_HEAW1                  0x35
     #define RA8875_VEAW0                  0x36
     #define RA8875_VEAW1                  0x37
-                                          
+
     #define RA8875_MWCR0                  0x40
     #define RA8875_MWCR0_GFXMODE          0x00
     #define RA8875_MWCR0_TXTMODE          0x80
-                                          
+
     #define RA8875_MWCR1                  0x41
     #define RA8875_MWCR1_GFXCURDIS        0x00
     #define RA8875_MWCR1_GFXCURENA        0x80
-                                          
+
     #define RA8875_BTCR                   0x44
     #define RA8875_MRCD                   0x45
     #define RA8875_CURH0                  0x46
@@ -164,7 +164,7 @@
     #define RA8875_RCURV1                 0x4D
     #define RA8875_CURHS                  0x4E
     #define RA8875_CURVS                  0x4F
-                                          
+
     #define RA8875_BECR0                  0x50
     #define RA8875_BECR1                  0x51
 
@@ -183,10 +183,10 @@
     #define RA8875_BEWR1                  0x5D
     #define RA8875_BEHR0                  0x5E
     #define RA8875_BEHR1                  0x5F
-    
-    
-    
-    
+
+
+
+
     #define RA8875_TPCR0                  0x70
     #define RA8875_TPCR0_ENABLE           0x80
     #define RA8875_TPCR0_DISABLE          0x00
@@ -220,7 +220,7 @@
     #define RA8875_TPCR1_WAIT             0x01
     #define RA8875_TPCR1_LATCHX           0x02
     #define RA8875_TPCR1_LATCHY           0x03
-                                          
+
     #define RA8875_TPXH                   0x72
     #define RA8875_TPYH                   0x73
     #define RA8875_TPXYL                  0x74
@@ -251,15 +251,15 @@
     #define RA8875_P1CR_DISABLE           0x00
     #define RA8875_P1CR_CLKOUT            0x10
     #define RA8875_P1CR_PWMOUT            0x00
-                                          
+
     #define RA8875_P1DCR                  0x8B
-                                          
+
     #define RA8875_P2CR                   0x8C
     #define RA8875_P2CR_ENABLE            0x80
     #define RA8875_P2CR_DISABLE           0x00
     #define RA8875_P2CR_CLKOUT            0x10
     #define RA8875_P2CR_PWMOUT            0x00
-                                          
+
     #define RA8875_PWM_CLK_DIV1           0x00
     #define RA8875_PWM_CLK_DIV2           0x01
     #define RA8875_PWM_CLK_DIV4           0x02
@@ -306,10 +306,10 @@
     #define RA8875_DCVR1                  0x9C
 
     #define RA8875_DCRR                   0x9D
-                                          
+
     #define RA8875_ELLIPSE                0xA0
     #define RA8875_ELLIPSE_STATUS         0x80
-    
+
     #define RA8875_ELLA0                  0xA1
     #define RA8875_ELLA1                  0xA2
     #define RA8875_ELLB0                  0xA3
@@ -323,22 +323,22 @@
     #define RA8875_DTPH1                  0xAA
     #define RA8875_DTPV0                  0xAB
     #define RA8875_DTPV1                  0xAC
-    
+
     #define RA8875_KSCR1                  0xC0
     #define RA8875_KSCR2                  0xC1
-                                          
+
     #define RA8875_INTC1                  0xF0
     #define RA8875_INTC1_KEY              0x10
     #define RA8875_INTC1_DMA              0x08
     #define RA8875_INTC1_TP               0x04
     #define RA8875_INTC1_BTE              0x02
-                                          
+
     #define RA8875_INTC2                  0xF1
     #define RA8875_INTC2_KEY              0x10
     #define RA8875_INTC2_DMA              0x08
     #define RA8875_INTC2_TP               0x04
     #define RA8875_INTC2_BTE              0x02
 
-    
-    
-#endif // RA8875_REGS_H
\ No newline at end of file
+
+
+#endif // RA8875_REGS_H