annotate examples/mpr121/I2C_MPR121.h @ 429:8533f7198644 prerelease

Re-added Doxygen
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 16 Jun 2016 19:21:46 +0100
parents dbeed520b014
children
rev   line source
andrewm@268 1 /*
andrewm@268 2 * MPR121 Bela demo
andrewm@268 3 *
andrewm@268 4 * Andrew McPherson
andrewm@268 5 * Based on Adafruit library by Limor Fried/Ladyada
andrewm@268 6 */
andrewm@268 7
andrewm@268 8 #ifndef I2CTK_H_
andrewm@268 9 #define I2CTK_H_
andrewm@268 10
andrewm@268 11 #include <I2c.h>
andrewm@268 12 #include "Utilities.h"
andrewm@268 13
andrewm@268 14 typedef bool boolean;
andrewm@268 15
andrewm@268 16 #define MPR121_I2CADDR_DEFAULT 0x5A
andrewm@268 17
andrewm@268 18 #define MPR121_TOUCHSTATUS_L 0x00
andrewm@268 19 #define MPR121_TOUCHSTATUS_H 0x01
andrewm@268 20 #define MPR121_FILTDATA_0L 0x04
andrewm@268 21 #define MPR121_FILTDATA_0H 0x05
andrewm@268 22 #define MPR121_BASELINE_0 0x1E
andrewm@268 23 #define MPR121_MHDR 0x2B
andrewm@268 24 #define MPR121_NHDR 0x2C
andrewm@268 25 #define MPR121_NCLR 0x2D
andrewm@268 26 #define MPR121_FDLR 0x2E
andrewm@268 27 #define MPR121_MHDF 0x2F
andrewm@268 28 #define MPR121_NHDF 0x30
andrewm@268 29 #define MPR121_NCLF 0x31
andrewm@268 30 #define MPR121_FDLF 0x32
andrewm@268 31 #define MPR121_NHDT 0x33
andrewm@268 32 #define MPR121_NCLT 0x34
andrewm@268 33 #define MPR121_FDLT 0x35
andrewm@268 34
andrewm@268 35 #define MPR121_TOUCHTH_0 0x41
andrewm@268 36 #define MPR121_RELEASETH_0 0x42
andrewm@268 37 #define MPR121_DEBOUNCE 0x5B
andrewm@268 38 #define MPR121_CONFIG1 0x5C
andrewm@268 39 #define MPR121_CONFIG2 0x5D
andrewm@268 40 #define MPR121_CHARGECURR_0 0x5F
andrewm@268 41 #define MPR121_CHARGETIME_1 0x6C
andrewm@268 42 #define MPR121_ECR 0x5E
andrewm@268 43 #define MPR121_AUTOCONFIG0 0x7B
andrewm@268 44 #define MPR121_AUTOCONFIG1 0x7C
andrewm@268 45 #define MPR121_UPLIMIT 0x7D
andrewm@268 46 #define MPR121_LOWLIMIT 0x7E
andrewm@268 47 #define MPR121_TARGETLIMIT 0x7F
andrewm@268 48
andrewm@268 49 #define MPR121_GPIODIR 0x76
andrewm@268 50 #define MPR121_GPIOEN 0x77
andrewm@268 51 #define MPR121_GPIOSET 0x78
andrewm@268 52 #define MPR121_GPIOCLR 0x79
andrewm@268 53 #define MPR121_GPIOTOGGLE 0x7A
andrewm@268 54
andrewm@268 55 #define MPR121_SOFTRESET 0x80
andrewm@268 56
andrewm@268 57 class I2C_MPR121 : public I2c
andrewm@268 58 {
andrewm@268 59 public:
andrewm@268 60 // Hardware I2C
andrewm@268 61 I2C_MPR121();
andrewm@268 62
andrewm@268 63 boolean begin(uint8_t bus = 1, uint8_t i2caddr = MPR121_I2CADDR_DEFAULT);
andrewm@268 64
andrewm@268 65 uint16_t filteredData(uint8_t t);
andrewm@268 66 uint16_t baselineData(uint8_t t);
andrewm@268 67
andrewm@268 68 uint8_t readRegister8(uint8_t reg);
andrewm@268 69 uint16_t readRegister16(uint8_t reg);
andrewm@268 70 void writeRegister(uint8_t reg, uint8_t value);
andrewm@268 71 uint16_t touched(void);
andrewm@268 72
andrewm@268 73 void setThresholds(uint8_t touch, uint8_t release);
andrewm@268 74
andrewm@268 75 int readI2C() { return 0; } // Unused
andrewm@268 76
andrewm@268 77 private:
andrewm@268 78 int _i2c_address;
andrewm@268 79 };
andrewm@268 80
andrewm@268 81
andrewm@268 82 #endif /* I2CTK_H_ */