upm
0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
|
C++ API for MMA7455 chip (accelerometer) More...
This file defines the MMA7455 C++ interface for libmma7455
Public Member Functions | |
MMA7455 (int bus, int devAddr) | |
~MMA7455 () | |
std::string | name () |
mraa_result_t | calibrate () |
mraa_result_t | readData (short *ptrX, short *ptrY, short *ptrZ) |
int | ic2ReadReg (unsigned char reg, unsigned char *buf, unsigned char size) |
mraa_result_t | ic2WriteReg (unsigned char reg, unsigned char *buf, unsigned char size) |
MMA7455 | ( | int | bus, |
int | devAddr | ||
) |
Instanciates a MMA7455 object
bus | number of used bus |
devAddr | addres of used i2c device |
|
inline |
Return name of the component
mraa_result_t calibrate | ( | ) |
Calibrate the sensor
mraa_result_t readData | ( | short * | ptrX, |
short * | ptrY, | ||
short * | ptrZ | ||
) |
Read X, Y and Z acceleration data
ptrX | X axis |
ptrY | Y axis |
ptrZ | Z axis |
int ic2ReadReg | ( | unsigned char | reg, |
unsigned char * | buf, | ||
unsigned char | size | ||
) |
reg | register address |
buf | register data buffer |
size | buffer size |
mraa_result_t ic2WriteReg | ( | unsigned char | reg, |
unsigned char * | buf, | ||
unsigned char | size | ||
) |
reg | register address |
buf | register data buffer |
size | buffer size |