28 #include <mraa/i2c.hpp> 30 #define ADDR 0x1D // device address 35 #define MMA7455_XOUTL 0x00 // Read only, Output Value X LSB 36 #define MMA7455_XOUTH 0x01 // Read only, Output Value X MSB 37 #define MMA7455_YOUTL 0x02 // Read only, Output Value Y LSB 38 #define MMA7455_YOUTH 0x03 // Read only, Output Value Y MSB 39 #define MMA7455_ZOUTL 0x04 // Read only, Output Value Z LSB 40 #define MMA7455_ZOUTH 0x05 // Read only, Output Value Z MSB 41 #define MMA7455_XOUT8 0x06 // Read only, Output Value X 8 bits 42 #define MMA7455_YOUT8 0x07 // Read only, Output Value Y 8 bits 43 #define MMA7455_ZOUT8 0x08 // Read only, Output Value Z 8 bits 44 #define MMA7455_STATUS 0x09 // Read only, Status Register 45 #define MMA7455_DETSRC 0x0A // Read only, Detection Source Register 46 #define MMA7455_TOUT 0x0B // Temperature Output Value (Optional) 47 #define MMA7455_RESERVED1 0x0C // Reserved 48 #define MMA7455_I2CAD 0x0D // Read/Write, I2C Device Address 49 #define MMA7455_USRINF 0x0E // Read only, User Information (Optional) 50 #define MMA7455_WHOAMI 0x0F // Read only, "Who am I" value (Optional) 51 #define MMA7455_XOFFL 0x10 // Read/Write, Offset Drift X LSB 52 #define MMA7455_XOFFH 0x11 // Read/Write, Offset Drift X MSB 53 #define MMA7455_YOFFL 0x12 // Read/Write, Offset Drift Y LSB 54 #define MMA7455_YOFFH 0x13 // Read/Write, Offset Drift Y MSB 55 #define MMA7455_ZOFFL 0x14 // Read/Write, Offset Drift Z LSB 56 #define MMA7455_ZOFFH 0x15 // Read/Write, Offset Drift Z MSB 57 #define MMA7455_MCTL 0x16 // Read/Write, Mode Control Register 58 #define MMA7455_INTRST 0x17 // Read/Write, Interrupt Latch Reset 59 #define MMA7455_CTL1 0x18 // Read/Write, Control 1 Register 60 #define MMA7455_CTL2 0x19 // Read/Write, Control 2 Register 61 #define MMA7455_LDTH 0x1A // Read/Write, Level Detection Threshold Limit Value 62 #define MMA7455_PDTH 0x1B // Read/Write, Pulse Detection Threshold Limit Value 63 #define MMA7455_PD 0x1C // Read/Write, Pulse Duration Value 64 #define MMA7455_LT 0x1D // Read/Write, Latency Time Value (between pulses) 65 #define MMA7455_TW 0x1E // Read/Write, Time Window for Second Pulse Value 66 #define MMA7455_RESERVED2 0x1F // Reserved 84 #define MMA7455_DRDY MMA7455_D0 85 #define MMA7455_DOVR MMA7455_D1 86 #define MMA7455_PERR MMA7455_D2 89 #define MMA7455_MODE0 MMA7455_D0 90 #define MMA7455_MODE1 MMA7455_D1 91 #define MMA7455_GLVL0 MMA7455_D2 92 #define MMA7455_GLVL1 MMA7455_D3 93 #define MMA7455_STON MMA7455_D4 94 #define MMA7455_SPI3W MMA7455_D5 95 #define MMA7455_DRPD MMA7455_D6 98 #define MMA7455_INTPIN MMA7455_D0 99 #define MMA7455_INTREG0 MMA7455_D1 100 #define MMA7455_INTREG1 MMA7455_D2 101 #define MMA7455_XDA MMA7455_D3 102 #define MMA7455_YDA MMA7455_D4 103 #define MMA7455_ZDA MMA7455_D5 104 #define MMA7455_THOPT MMA7455_D6 105 #define MMA7455_DFBW MMA7455_D7 108 #define MMA7455_LDPL MMA7455_D0 109 #define MMA7455_PDPL MMA7455_D1 110 #define MMA7455_DRVO MMA7455_D2 113 #define MMA7455_CLR_INT1 MMA7455_D0 114 #define MMA7455_CLR_INT2 MMA7455_D1 117 #define MMA7455_INT1 MMA7455_D0 118 #define MMA7455_INT2 MMA7455_D1 119 #define MMA7455_PDZ MMA7455_D2 120 #define MMA7455_PDY MMA7455_D3 121 #define MMA7455_PDX MMA7455_D4 122 #define MMA7455_LDZ MMA7455_D5 123 #define MMA7455_LDY MMA7455_D6 124 #define MMA7455_LDX MMA7455_D7 127 #define MMA7455_I2CDIS MMA7455_D7 151 #define BIT(n) (1<<n) 182 MMA7455 (
int bus=0,
int devAddr=0x1D);
210 mraa::Result
readData (
short * ptrX,
short * ptrY,
short * ptrZ);
226 int i2cReadReg (
unsigned char reg, uint8_t *buffer,
int len);
235 mraa::Result
i2cWriteReg (
unsigned char reg, uint8_t *buffer,
int len);
241 mraa::I2c m_i2ControlCtx;
mraa::Result calibrate()
Definition: mma7455.cxx:70
int i2cReadReg(unsigned char reg, uint8_t *buffer, int len)
Definition: mma7455.cxx:144
Definition: mma7455.hpp:134
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
MMA7455(int bus=0, int devAddr=0x1D)
Definition: mma7455.cxx:38
std::vector< short > readData()
Definition: mma7455.cxx:137
API for the MMA7455 Accelerometer.
Definition: mma7455.hpp:174
std::string name()
Definition: mma7455.hpp:189
mraa::Result i2cWriteReg(unsigned char reg, uint8_t *buffer, int len)
Definition: mma7455.cxx:155