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!!
Diff: MPR121.h
- Revision:
- 5:3934358ec2b7
- Parent:
- 3:828260f21de6
--- a/MPR121.h Tue Aug 27 21:39:33 2013 +0000 +++ b/MPR121.h Fri Aug 15 23:00:13 2014 +0000 @@ -147,6 +147,12 @@ */ MPR121(I2C &i2c, InterruptIn &pin, MPR121_ADDR i2c_addr); + /** Create the MPR121 object + * @param i2c - A defined I2C object + * @param i2c_addr - Connection of the address line + */ + MPR121(I2C &i2c, MPR121_ADDR i2c_addr); + /** Clear state variables and initilize the dependant objects */ void init(void); @@ -176,6 +182,10 @@ */ void registerDump(Serial &obj) const; + /** print the register map and values to the console + */ + 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