Interface definition for the STM LIS2DH12 accelerometer. More...

Detailed Description

Interface definition for the STM LIS2DH12 accelerometer.

Hauke Petersen

Definition in file lis2dh12.h.

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

Go to the source code of this file.

Data Structures

struct  lis2dh12_params_t
 LIS2DH12 configuration parameters. More...
struct  lis2dh12_t
 LIS2DH12 device descriptor. More...


#define LIS2DH12_ADDR_DEFAULT   (0x19)
 Default I2C slave address for LIS2DH12 devices.


enum  lis2dh12_scale_t { LIS2DH12_SCALE_2G = 0x00, LIS2DH12_SCALE_4G = 0x10, LIS2DH12_SCALE_8G = 0x20, LIS2DH12_SCALE_16G = 0x30 }
 Available scale values. More...
enum  lis2dh12_rate_t {
  LIS2DH12_RATE_1HZ = 0x17, LIS2DH12_RATE_10HZ = 0x27, LIS2DH12_RATE_25HZ = 0x37, LIS2DH12_RATE_50HZ = 0x47,
  LIS2DH12_RATE_100HZ = 0x57, LIS2DH12_RATE_200HZ = 0x67, LIS2DH12_RATE_400HZ = 0x77
 Available sampling rates. More...
enum  { LIS2DH12_OK = 0, LIS2DH12_NOBUS = -1, LIS2DH12_NODEV = -2 }
 Status and error return codes. More...


int lis2dh12_init (lis2dh12_t *dev, const lis2dh12_params_t *params)
 Initialize the given LIS2DH12 sensor device. More...
int lis2dh12_read (const lis2dh12_t *dev, int16_t *data)
 Read acceleration data from the given device. More...
int lis2dh12_poweron (const lis2dh12_t *dev)
 Power on the given device. More...
int lis2dh12_poweroff (const lis2dh12_t *dev)
 Power off the given device. More...


const saul_driver_t lis2dh12_saul_driver
 Export the SAUL interface for this driver.