40 #ifndef MMA8X5X_I2C_ADDRESS 41 #define MMA8X5X_I2C_ADDRESS 0x1D
void mma8x5x_set_active(const mma8x5x_t *dev)
Set active mode, this enables periodic measurements.
uint8_t addr
I2C bus address of the device.
6.25 Hz Ouput Data Rate in WAKE mode
Configuration parameters.
new data ready to be read
void mma8x5x_set_standby(const mma8x5x_t *dev)
Set standby mode.
int16_t y
acceleration in Y direction
void mma8x5x_set_motiondetect(const mma8x5x_t *dev, uint8_t int_pin, uint8_t threshold)
Configure motion detection interrupt.
1.56 Hz Ouput Data Rate in WAKE mode
no MMA8X5X device found on the bus
I2C communication failed.
800 Hz Ouput Data Rate in WAKE mode
unsigned int i2c_t
Default i2c_t type definition.
100 Hz Ouput Data Rate in WAKE mode
mma8x5x_params_t params
device configuration parameters
void mma8x5x_set_user_offset(const mma8x5x_t *dev, int8_t x, int8_t y, int8_t z)
Set user offset correction.
12.5 Hz Ouput Data Rate in WAKE mode
int mma8x5x_init(mma8x5x_t *dev, const mma8x5x_params_t *params)
Initialize the MMA8x5x accelerometer driver.
200 Hz Ouput Data Rate in WAKE mode
Data type for the result data.
i2c_t i2c
I2C bus the device is connected to.
Device descriptor for MMA8x5x accelerometers.
void mma8x5x_read(const mma8x5x_t *dev, mma8x5x_data_t *data)
Read accelerometer's data.
int16_t z
acceleration in Z direction
int16_t x
acceleration in X direction
400 Hz Ouput Data Rate in WAKE mode
uint8_t rate
sampling rate to use
int mma8x5x_is_ready(const mma8x5x_t *dev)
Check for new set of measurement data.
50 Hz Ouput Data Rate in WAKE mode
void mma8x5x_ack_int(const mma8x5x_t *dev)
Acknowledge motion detection interrupt.
uint8_t range
scale range to use
Low-level I2C peripheral driver interface definition.