STMPE610 touch sensor driver library

Dependents:   TS_Eyes Tokei testUniGraphic_150217 AfficheurTFTAdafruit ... more

Revision:
8:e4b4cf8cf7d6
Parent:
7:a012c1710119
Child:
10:dc5912872d41
Child:
12:e85335a28f54
--- a/SPI_STMPE610.cpp	Sat Aug 08 12:24:34 2015 +0000
+++ b/SPI_STMPE610.cpp	Thu Nov 19 13:06:54 2015 +0000
@@ -138,7 +138,8 @@
     m_cs = 0 ;
     _mode = 0 ;
     m_spi.frequency(1000000) ;
-    m_spi.format(8, 0) ;
+    m_spi.format(8, 0) ; /* works with freescale FRDMs */
+//    m_spi.format(8, 1) ; /* works with st nucleo F411RE */
     write8(REG_SYS_CTRL1, REG_SYS_CTRL1_RESET) ;
     wait(0.1) ;
     write8(REG_SYS_CTRL2, 0x00) ; // turn on clocks
@@ -209,6 +210,11 @@
     return( value ) ;
 }
 
+void SPI_STMPE610::spi_format(int bits, int mode)
+{
+    m_spi.format(bits, mode) ;
+}
+
 int SPI_STMPE610::getRAWPoint(uint16_t *x, uint16_t *y, uint16_t *z)
 {
     uint8_t data[8], touched = 0 ;