Interface definition for the MMA8x5x accelerometer driver. More...

Detailed Description

Interface definition for the MMA8x5x accelerometer driver.

Author
Johann Fischer j.fis.nosp@m.cher.nosp@m.@phyt.nosp@m.ec.d.nosp@m.e
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file mma8x5x.h.

#include <stdint.h>
#include "periph/i2c.h"
+ Include dependency graph for mma8x5x.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mma8x5x_params_t
 Configuration parameters. More...
 
struct  mma8x5x_t
 Device descriptor for MMA8x5x accelerometers. More...
 
struct  mma8x5x_data_t
 Data type for the result data. More...
 

Macros

#define CONFIG_MMA8X5X_I2C_ADDRESS   0x1D
 Accelerometer Default Address. More...
 

Enumerations

enum  {
  MMA8X5X_TYPE_MMA8652 = 0x4a, MMA8X5X_TYPE_MMA8653 = 0x5a, MMA8X5X_TYPE_MMA8451 = 0x1a, MMA8X5X_TYPE_MMA8452 = 0x2a,
  MMA8X5X_TYPE_MMA8453 = 0x3a
}
 Devices supported by this driver. More...
 
enum  {
  MMA8X5X_RATE_800HZ = (0 << 3), MMA8X5X_RATE_400HZ = (1 << 3), MMA8X5X_RATE_200HZ = (2 << 3), MMA8X5X_RATE_100HZ = (3 << 3),
  MMA8X5X_RATE_50HZ = (4 << 3), MMA8X5X_RATE_1HZ25 = (5 << 3), MMA8X5X_RATE_6HZ25 = (6 << 3), MMA8X5X_RATE_1HZ56 = (7 << 3)
}
 Available sampling rates. More...
 
enum  { MMA8X5X_RANGE_2G = 0, MMA8X5X_RANGE_4G = 1, MMA8X5X_RANGE_8G = 2 }
 Available range options. More...
 
enum  {
  MMA8X5X_OK = 0, MMA8X5X_DATA_READY = 1, MMA8X5X_NOI2C = -1, MMA8X5X_NODEV = -2,
  MMA8X5X_NODATA = -3
}
 Named return values. More...
 

Functions

int mma8x5x_init (mma8x5x_t *dev, const mma8x5x_params_t *params)
 Initialize the MMA8x5x accelerometer driver. More...
 
void mma8x5x_set_user_offset (const mma8x5x_t *dev, int8_t x, int8_t y, int8_t z)
 Set user offset correction. More...
 
void mma8x5x_set_active (const mma8x5x_t *dev)
 Set active mode, this enables periodic measurements. More...
 
void mma8x5x_set_standby (const mma8x5x_t *dev)
 Set standby mode. More...
 
int mma8x5x_is_ready (const mma8x5x_t *dev)
 Check for new set of measurement data. More...
 
void mma8x5x_read (const mma8x5x_t *dev, mma8x5x_data_t *data)
 Read accelerometer's data. More...
 
void mma8x5x_set_motiondetect (const mma8x5x_t *dev, uint8_t int_pin, uint8_t threshold)
 Configure motion detection interrupt. More...
 
void mma8x5x_ack_int (const mma8x5x_t *dev)
 Acknowledge motion detection interrupt. More...