STMPE610 touch sensor driver library

Dependents:   TS_Eyes Tokei testUniGraphic_150217 AfficheurTFTAdafruit ... more

Files at this revision

API Documentation at this revision

Comitter:
Rhyme
Date:
Thu Nov 19 13:06:54 2015 +0000
Parent:
7:a012c1710119
Child:
9:21f92cef6dca
Commit message:
function spi_format added to support STMPE610 with Neucleo F411RE

Changed in this revision

SPI_STMPE610.cpp Show annotated file Show diff for this revision Revisions of this file
SPI_STMPE610.h Show annotated file Show diff for this revision Revisions of this file
--- 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 ;
--- a/SPI_STMPE610.h	Sat Aug 08 12:24:34 2015 +0000
+++ b/SPI_STMPE610.h	Thu Nov 19 13:06:54 2015 +0000
@@ -87,6 +87,7 @@
   void write8(int addr, uint8_t data) ;
   uint16_t read16(int addr) ;
   void write16(int addr, uint16_t data) ;
+  void spi_format(int bits, int mode) ;
   
   /**
    * get RAW value of x, y, z