A device driver for the Freescale MPR121 capactive touch IC. Not optimized for any particular system, just a starting point to get the chip up in running in no time. Changes to registers init() method will tailor the library for end system use.

Dependents:   Seeed_Grove_I2C_Touch_Example MPR121_HelloWorld mbed_petbottle_holder_shikake test_DEV-10508 ... more

Datasheet:

http://cache.freescale.com/files/sensors/doc/data_sheet/MPR121.pdf

Information

Must add pull-ups to the I2C bus!!

Revision:
1:cee45334b36a
Parent:
0:42add775212a
Child:
2:4c0d4b90a3ed
diff -r 42add775212a -r cee45334b36a MPR121.h
--- a/MPR121.h	Thu Mar 07 19:25:08 2013 +0000
+++ b/MPR121.h	Thu Mar 07 23:57:27 2013 +0000
@@ -137,9 +137,9 @@
     };
     
     /** Create the MPR121 object
-     *  @param i2c A defined I2C object
-     *  @param pin A defined InterruptIn object
-     *  @param i2c_addr Connection of the address line
+     *  @param i2c - A defined I2C object
+     *  @param pin - A defined InterruptIn object
+     *  @param i2c_addr - Connection of the address line
      */    
     MPR121(I2C &i2c, InterruptIn &pin, MPR121_ADDR i2c_addr);
     
@@ -169,20 +169,20 @@
     
     /** print the register map and values to the console
      */
-    void registerDump(void);
+    void registerDump(void) const;
     
     /** Write to a register (exposed for debugging reasons)
      *  Note: most writes are only valid in stop mode
-     *  @param reg The register to be written
-     *  @param data The data to be written
+     *  @param reg - The register to be written
+     *  @param data - The data to be written
      */
-    void writeRegister(uint8_t reg, uint8_t data);
+    void writeRegister(uint8_t const reg, uint8_t const data) const;
     
     /** Read from a register (exposed for debugging reasons)
-     *  @param reg The register to read from
+     *  @param reg - The register to read from
      *  @return The register contents
      */
-    uint8_t readRegister(uint8_t reg);
+    uint8_t readRegister(uint8_t const reg) const;
     
 };