Device driver for the LSM6DSXX 3D accelerometer/gyroscope. More...
Device driver for the LSM6DSXX 3D accelerometer/gyroscope.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
Files | |
file | lsm6dsxx.h |
Device driver interface for the LSM6DSXX 3D accelerometer/gyroscope. | |
file | lsm6dsxx_internal.h |
Internal configuration for LSM6DSXX devices. | |
file | lsm6dsxx_params.h |
Default configuration for LSM6DSXX devices. | |
Data Structures | |
struct | lsm6dsxx_params_t |
LSM6DSXX driver parameters. More... | |
struct | lsm6dsxx_t |
LSM6DSXX device descriptor. More... | |
struct | lsm6dsxx_3d_data_t |
3D output data More... | |
Enumerations | |
enum | { LSM6DSXX_DATA_RATE_POWER_DOWN = 0x0 , LSM6DSXX_DATA_RATE_1_6HZ = 0xB , LSM6DSXX_DATA_RATE_12_5HZ = 0x1 , LSM6DSXX_DATA_RATE_26HZ = 0x2 , LSM6DSXX_DATA_RATE_52HZ = 0x3 , LSM6DSXX_DATA_RATE_104HZ = 0x4 , LSM6DSXX_DATA_RATE_208HZ = 0x5 , LSM6DSXX_DATA_RATE_416HZ = 0x6 , LSM6DSXX_DATA_RATE_833HZ = 0x7 , LSM6DSXX_DATA_RATE_1_66KHZ = 0x8 , LSM6DSXX_DATA_RATE_3_33KHZ = 0x9 , LSM6DSXX_DATA_RATE_6_66KHZ = 0xa } |
Data rate settings. More... | |
enum | { LSM6DSXX_DECIMATION_NOT_IN_FIFO = 0 , LSM6DSXX_DECIMATION_NO , LSM6DSXX_DECIMATION_2 , LSM6DSXX_DECIMATION_3 , LSM6DSXX_DECIMATION_4 , LSM6DSXX_DECIMATION_8 , LSM6DSXX_DECIMATION_16 , LSM6DSXX_DECIMATION_32 } |
Decimation settings. More... | |
enum | { LSM6DSXX_ACC_FS_2G = 0 , LSM6DSXX_ACC_FS_16G , LSM6DSXX_ACC_FS_4G , LSM6DSXX_ACC_FS_8G , LSM6DSXX_ACC_FS_MAX } |
Accelerometer full scale. More... | |
enum | { LSM6DSXX_GYRO_FS_245DPS = 0 , LSM6DSXX_GYRO_FS_500DPS , LSM6DSXX_GYRO_FS_1000DPS , LSM6DSXX_GYRO_FS_2000DPS , LSM6DSXX_GYRO_FS_MAX } |
Gyroscope full scale. More... | |
enum | { LSM6DSXX_OK = 0 , LSM6DSXX_ERROR_BUS , LSM6DSXX_ERROR_CNF , LSM6DSXX_ERROR_DEV } |
Named return values. More... | |
Functions | |
int | lsm6dsxx_init (lsm6dsxx_t *dev, const lsm6dsxx_params_t *params) |
Initialize a LSM6DSXX device. | |
int | lsm6dsxx_read_acc (const lsm6dsxx_t *dev, lsm6dsxx_3d_data_t *data) |
Read accelerometer data. | |
int | lsm6dsxx_read_gyro (const lsm6dsxx_t *dev, lsm6dsxx_3d_data_t *data) |
Read gyroscope data. | |
int | lsm6dsxx_read_temp (const lsm6dsxx_t *dev, int16_t *data) |
Read temperature data. | |
int | lsm6dsxx_acc_power_down (const lsm6dsxx_t *dev) |
Power down accelerometer. | |
int | lsm6dsxx_gyro_power_down (const lsm6dsxx_t *dev) |
Power down gyroscope. | |
int | lsm6dsxx_acc_power_up (const lsm6dsxx_t *dev) |
Power up accelerometer. | |
int | lsm6dsxx_gyro_power_up (const lsm6dsxx_t *dev) |
Power up gyroscope. | |
anonymous enum |
Data rate settings.
Definition at line 39 of file lsm6dsxx.h.
anonymous enum |
Decimation settings.
Definition at line 57 of file lsm6dsxx.h.
anonymous enum |
Accelerometer full scale.
Definition at line 71 of file lsm6dsxx.h.
anonymous enum |
Gyroscope full scale.
Definition at line 82 of file lsm6dsxx.h.
anonymous enum |
Named return values.
Enumerator | |
---|---|
LSM6DSXX_OK | all good |
LSM6DSXX_ERROR_BUS | I2C bus error. |
LSM6DSXX_ERROR_CNF | Config error. |
LSM6DSXX_ERROR_DEV | device error |
Definition at line 124 of file lsm6dsxx.h.
int lsm6dsxx_acc_power_down | ( | const lsm6dsxx_t * | dev | ) |
Power down accelerometer.
[in] | dev | device to power down |
int lsm6dsxx_acc_power_up | ( | const lsm6dsxx_t * | dev | ) |
Power up accelerometer.
[in] | dev | device to power up |
int lsm6dsxx_gyro_power_down | ( | const lsm6dsxx_t * | dev | ) |
Power down gyroscope.
[in] | dev | device to power down |
int lsm6dsxx_gyro_power_up | ( | const lsm6dsxx_t * | dev | ) |
Power up gyroscope.
[in] | dev | device to power up |
int lsm6dsxx_init | ( | lsm6dsxx_t * | dev, |
const lsm6dsxx_params_t * | params | ||
) |
Initialize a LSM6DSXX device.
[out] | dev | device to initialize |
[in] | params | driver parameters |
int lsm6dsxx_read_acc | ( | const lsm6dsxx_t * | dev, |
lsm6dsxx_3d_data_t * | data | ||
) |
Read accelerometer data.
[in] | dev | device to read |
[out] | data | accelerometer values |
int lsm6dsxx_read_gyro | ( | const lsm6dsxx_t * | dev, |
lsm6dsxx_3d_data_t * | data | ||
) |
Read gyroscope data.
[in] | dev | device to read |
[out] | data | gyroscope values |
int lsm6dsxx_read_temp | ( | const lsm6dsxx_t * | dev, |
int16_t * | data | ||
) |
Read temperature data.
[in] | dev | device to read |
[out] | data | temperature value, in °C x 100 |