pyupm_mpr121 module

class pyupm_mpr121.MPR121(bus, address=90)[source]

Bases: object

API for the MPR121 I2C Touch Sensor.

ID: mpr121

Name: Digital Capacitive Touch Sensor Controller

Other Names: Grove I2C Touch Sensor

Category: touch

Manufacturer: seeed

Link:http://www.seeedstudio.com/wiki/Grove_-_I2C_Touch_Sensor

Connection: i2c

Kit: tsk UPM module for the MPR121 touch sensor

C++ includes: mpr121.hpp

configAN3944()[source]

bool configAN3944()

MPR121 destructor ~MPR121(); there is no need for the destructor Sets up a default configuration, based on Application Note 3944 (AN3944):http://cache.freescale.com/files/sensors/doc/app_note/AN3944.pdf

After configuration, the sensor is left in the run state.

True if configuration is successful

m_buttonStates
m_overCurrentFault
readButtons()[source]

void readButtons()

Reads button states in the m_buttonStates member variable. Also, sets the m_overCurrentFault variable if overcurrent is detected.

readBytes(reg, buffer, len)[source]

int readBytes(uint8_t reg, uint8_t *buffer, int len)

Reads value(s) from registers

reg: Register location to start reading from

buffer: Buffer for data storage

len: Number of bytes to read

writeBytes(reg, buffer, len)[source]

mraa::Result writeBytes(uint8_t reg, uint8_t *buffer, int len)

Writes value(s) into registers

reg: Register location to start writing into

buffer: Buffer for data storage

len: Number of bytes to write

mraa::Result