ChibiOS 21.11.4

Detailed Description

Collaboration diagram for LSM6DSL:

LSM6DSL data structures and types.

enum  lsm6dsl_sad_t { LSM6DSL_SAD_GND = 0x6A , LSM6DSL_SAD_VCC = 0x6B }
 Accelerometer and Gyroscope Slave Address. More...
enum  lsm6dsl_acc_fs_t { LSM6DSL_ACC_FS_2G = 0x00 , LSM6DSL_ACC_FS_4G = 0x40 , LSM6DSL_ACC_FS_8G = 0x80 , LSM6DSL_ACC_FS_16G = 0xC0 }
 LSM6DSL accelerometer subsystem full scale. More...
enum  lsm6dsl_acc_odr_t {
  LSM6DSL_ACC_ODR_PD = 0x00 , LSM6DSL_ACC_ODR_1P6HZ = 0xB0 , LSM6DSL_ACC_ODR_12P5HZ = 0x10 , LSM6DSL_ACC_ODR_26HZ = 0x20 ,
  LSM6DSL_ACC_ODR_52HZ = 0x30 , LSM6DSL_ACC_ODR_104HZ = 0x40 , LSM6DSL_ACC_ODR_208HZ = 0x50 , LSM6DSL_ACC_ODR_416HZ = 0x60 ,
  LSM6DSL_ACC_ODR_833HZ = 0x70 , LSM6DSL_ACC_ODR_1P66HZ = 0x80 , LSM6DSL_ACC_ODR_3P33HZ = 0x90 , LSM6DSL_ACC_ODR_6P66HZ = 0xA0
}
 LSM6DSL accelerometer subsystem output data rate. More...
enum  lsm6dsl_acc_lp_t { LSM6DSL_ACC_LP_DISABLED = 0x00 , LSM6DSL_ACC_LP_ENABLED = 0x10 }
 LSM6DSL accelerometer subsystem output data rate. More...
enum  lsm6dsl_gyro_fs_t {
  LSM6DSL_GYRO_FS_125DPS = 0x02 , LSM6DSL_GYRO_FS_250DPS = 0x00 , LSM6DSL_GYRO_FS_500DPS = 0x04 , LSM6DSL_GYRO_FS_1000DPS = 0x08 ,
  LSM6DSL_GYRO_FS_2000DPS = 0x0C
}
 LSM6DSL gyroscope subsystem full scale. More...
enum  lsm6dsl_gyro_odr_t {
  LSM6DSL_GYRO_ODR_PD = 0x00 , LSM6DSL_GYRO_ODR_12P5HZ = 0x10 , LSM6DSL_GYRO_ODR_26HZ = 0x20 , LSM6DSL_GYRO_ODR_52HZ = 0x30 ,
  LSM6DSL_GYRO_ODR_104HZ = 0x40 , LSM6DSL_GYRO_ODR_208HZ = 0x50 , LSM6DSL_GYRO_ODR_416HZ = 0x60 , LSM6DSL_GYRO_ODR_833HZ = 0x70 ,
  LSM6DSL_GYRO_ODR_1P66KHZ = 0x80 , LSM6DSL_GYRO_ODR_3P33KHZ = 0x90 , LSM6DSL_GYRO_ODR_6P66KHZ = 0xA0
}
 LSM6DSL gyroscope subsystem output data rate. More...
enum  lsm6dsl_gyro_lp_t { LSM6DSL_GYRO_LP_DISABLED = 0x00 , LSM6DSL_GYRO_LP_ENABLED = 0x80 }
 LSM6DSL gyroscope subsystem low mode configuration. More...
enum  lsm6dsl_gyro_lpf_t {
  LSM6DSL_GYRO_LPF_DISABLED = -1 , LSM6DSL_GYRO_LPF_FTYPE0 = 0x00 , LSM6DSL_GYRO_LPF_FTYPE1 = 0x01 , LSM6DSL_GYRO_LPF_FTYPE2 = 0x10 ,
  LSM6DSL_GYRO_LPF_FTYPE3 = 0x11
}
 LSM6DSL gyroscope subsystem output selection. More...
enum  lsm6dsl_bdu_t { LSM6DSL_BDU_CONTINUOUS = 0x00 , LSM6DSL_BDU_BLOCKED = 0x40 }
 LSM6DSL block data update. More...
enum  lsm6dsl_end_t { LSM6DSL_END_LITTLE = 0x00 , LSM6DSL_END_BIG = 0x20 }
 LSM6DSL endianness. More...
enum  lsm6dsl_state_t { LSM6DSL_UNINIT = 0 , LSM6DSL_STOP = 1 , LSM6DSL_READY = 2 }
 Driver state machine possible states. More...
typedef struct LSM6DSLDriver LSM6DSLDriver
 Structure representing a LSM6DSL driver.
#define _lsm6dsl_methods_alone
 LSM6DSL specific methods.
#define _lsm6dsl_methods
 LSM6DSL specific methods with inherited ones.
#define _lsm6dsl_data
 LSM6DSLDriver specific data.

Version identification

#define EX_LSM6DSL_VERSION   "1.0.2"
 LSM6DSL driver version string.
#define EX_LSM6DSL_MAJOR   1
 LSM6DSL driver version major number.
#define EX_LSM6DSL_MINOR   0
 LSM6DSL driver version minor number.
#define EX_LSM6DSL_PATCH   2
 LSM6DSL driver version patch number.
#define LSM6DSL_ACC_NUMBER_OF_AXES   3U
 LSM6DSL accelerometer subsystem characteristics.
#define LSM6DSL_ACC_2G   2.0f
#define LSM6DSL_ACC_4G   4.0f
#define LSM6DSL_ACC_8G   8.0f
#define LSM6DSL_ACC_16G   16.0f
#define LSM6DSL_ACC_SENS_2G   0.061f
#define LSM6DSL_ACC_SENS_4G   0.122f
#define LSM6DSL_ACC_SENS_8G   0.244f
#define LSM6DSL_ACC_SENS_16G   0.488f
#define LSM6DSL_ACC_BIAS   0.0f
#define LSM6DSL_GYRO_NUMBER_OF_AXES   3U
 L3GD20 gyroscope system characteristics.
#define LSM6DSL_GYRO_125DPS   125.0f
#define LSM6DSL_GYRO_250DPS   250.0f
#define LSM6DSL_GYRO_500DPS   500.0f
#define LSM6DSL_GYRO_1000DPS   1000.0f
#define LSM6DSL_GYRO_2000DPS   2000.0f
#define LSM6DSL_GYRO_SENS_125DPS   0.004375f
#define LSM6DSL_GYRO_SENS_250DPS   0.008750f
#define LSM6DSL_GYRO_SENS_500DPS   0.017500f
#define LSM6DSL_GYRO_SENS_1000DPS   0.035000f
#define LSM6DSL_GYRO_SENS_2000DPS   0.070000f
#define LSM6DSL_GYRO_BIAS   0.0f

LSM6DSL communication interfaces related bit masks

#define LSM6DSL_DI_MASK   0xFF
#define LSM6DSL_DI(n)
#define LSM6DSL_AD_MASK   0x7F
#define LSM6DSL_AD(n)
#define LSM6DSL_MS   (1 << 7)

LSM6DSL register addresses

#define LSM6DSL_AD_FUNC_CFG_ACCESS   0x01
#define LSM6DSL_AD_SENSOR_SYNC_TIME_FRAME   0x04
#define LSM6DSL_AD_SENSOR_SYNC_RES_RATIO   0x05
#define LSM6DSL_AD_FIFO_CTRL1   0x06
#define LSM6DSL_AD_FIFO_CTRL2   0x07
#define LSM6DSL_AD_FIFO_CTRL3   0x08
#define LSM6DSL_AD_FIFO_CTRL4   0x09
#define LSM6DSL_AD_FIFO_CTRL5   0x0A
#define LSM6DSL_AD_DRDY_PULSE_CFG_G   0x0B
#define LSM6DSL_AD_INT1_CTRL   0x0D
#define LSM6DSL_AD_INT2_CTRL   0x0E
#define LSM6DSL_AD_WHO_AM_I   0x0F
#define LSM6DSL_AD_CTRL1_XL   0x10
#define LSM6DSL_AD_CTRL2_G   0x11
#define LSM6DSL_AD_CTRL3_C   0x12
#define LSM6DSL_AD_CTRL4_C   0x13
#define LSM6DSL_AD_CTRL5_C   0x14
#define LSM6DSL_AD_CTRL6_C   0x15
#define LSM6DSL_AD_CTRL7_G   0x16
#define LSM6DSL_AD_CTRL8_XL   0x17
#define LSM6DSL_AD_CTRL9_XL   0x18
#define LSM6DSL_AD_CTRL10_C   0x19
#define LSM6DSL_AD_MASTER_CONFIG   0x1A
#define LSM6DSL_AD_WAKE_UP_SRC   0x1B
#define LSM6DSL_AD_TAP_SRC   0x1C
#define LSM6DSL_AD_D6D_SRC   0x1D
#define LSM6DSL_AD_STATUS_REG   0x1E
#define LSM6DSL_AD_OUT_TEMP_L   0x20
#define LSM6DSL_AD_OUT_TEMP_H   0x21
#define LSM6DSL_AD_OUTX_L_G   0x22
#define LSM6DSL_AD_OUTX_H_G   0x23
#define LSM6DSL_AD_OUTY_L_G   0x24
#define LSM6DSL_AD_OUTY_H_G   0x25
#define LSM6DSL_AD_OUTZ_L_G   0x26
#define LSM6DSL_AD_OUTZ_H_G   0x27
#define LSM6DSL_AD_OUTX_L_XL   0x28
#define LSM6DSL_AD_OUTX_H_XL   0x29
#define LSM6DSL_AD_OUTY_L_XL   0x2A
#define LSM6DSL_AD_OUTY_H_XL   0x2B
#define LSM6DSL_AD_OUTZ_L_XL   0x2C
#define LSM6DSL_AD_OUTZ_H_XL   0x2D
#define LSM6DSL_AD_SENSORHUB1_REG   0x2E
#define LSM6DSL_AD_SENSORHUB2_REG   0x2F
#define LSM6DSL_AD_SENSORHUB3_REG   0x30
#define LSM6DSL_AD_SENSORHUB4_REG   0x31
#define LSM6DSL_AD_SENSORHUB5_REG   0x32
#define LSM6DSL_AD_SENSORHUB6_REG   0x33
#define LSM6DSL_AD_SENSORHUB7_REG   0x34
#define LSM6DSL_AD_SENSORHUB8_REG   0x35
#define LSM6DSL_AD_SENSORHUB9_REG   0x36
#define LSM6DSL_AD_SENSORHUB10_REG   0x37
#define LSM6DSL_AD_SENSORHUB11_REG   0x38
#define LSM6DSL_AD_SENSORHUB12_REG   0x39
#define LSM6DSL_AD_FIFO_STATUS1   0x3A
#define LSM6DSL_AD_FIFO_STATUS2   0x3B
#define LSM6DSL_AD_FIFO_STATUS3   0x3C
#define LSM6DSL_AD_FIFO_STATUS4   0x3D
#define LSM6DSL_AD_FIFO_DATA_OUT_L   0x3E
#define LSM6DSL_AD_FIFO_DATA_OUT_H   0x3F
#define LSM6DSL_AD_TIMESTAMP0_REG   0x40
#define LSM6DSL_AD_TIMESTAMP1_REG   0x41
#define LSM6DSL_AD_TIMESTAMP2_REG   0x42
#define LSM6DSL_AD_STEP_TIMESTAMP_L   0x49
#define LSM6DSL_AD_STEP_TIMESTAMP_H   0x4A
#define LSM6DSL_AD_STEP_COUNTER_L   0x4B
#define LSM6DSL_AD_STEP_COUNTER_H   0x4C
#define LSM6DSL_AD_SENSORHUB13_REG   0x4D
#define LSM6DSL_AD_SENSORHUB14_REG   0x4E
#define LSM6DSL_AD_SENSORHUB15_REG   0x4F
#define LSM6DSL_AD_SENSORHUB16_REG   0x50
#define LSM6DSL_AD_SENSORHUB17_REG   0x51
#define LSM6DSL_AD_SENSORHUB18_REG   0x52
#define LSM6DSL_AD_FUNC_SRC1   0x53
#define LSM6DSL_AD_FUNC_SRC2   0x54
#define LSM6DSL_AD_WRIST_TILT_IA   0x55
#define LSM6DSL_AD_TAP_CFG   0x58
#define LSM6DSL_AD_TAP_THS_6D   0x59
#define LSM6DSL_AD_INT_DUR2   0x5A
#define LSM6DSL_AD_WAKE_UP_THS   0x5B
#define LSM6DSL_AD_WAKE_UP_DUR   0x5C
#define LSM6DSL_AD_FREE_FALL   0x5D
#define LSM6DSL_AD_MD1_CFG   0x5E
#define LSM6DSL_AD_MD2_CFG   0x5F
#define LSM6DSL_AD_MASTER_CMD_CODE   0x60
#define LSM6DSL_AD_SENS_SYNC_SPI_ERROR_CODE   0x61
#define LSM6DSL_AD_OUT_MAG_RAW_X_L   0x66
#define LSM6DSL_AD_OUT_MAG_RAW_X_H   0x67
#define LSM6DSL_AD_OUT_MAG_RAW_Y_L   0x68
#define LSM6DSL_AD_OUT_MAG_RAW_Y_H   0x69
#define LSM6DSL_AD_OUT_MAG_RAW_Z_L   0x6A
#define LSM6DSL_AD_OUT_MAG_RAW_Z_H   0x6B
#define LSM6DSL_AD_X_OFS_USR   0x73
#define LSM6DSL_AD_Y_OFS_USR   0x74
#define LSM6DSL_AD_Z_OFS_USR   0x75

LSM6DSL_AD_CTRL1_XL register bits definitions

#define LSMDSL_CTRL1_XL_BW0_XL   (1 << 0)
#define LSMDSL_CTRL1_XL_LPF1_BW_SEL   (1 << 1)
#define LSMDSL_CTRL1_XL_FS_MASK   0x0C
#define LSMDSL_CTRL1_XL_FS_XL0   (1 << 2)
#define LSMDSL_CTRL1_XL_FS_XL1   (1 << 3)
#define LSMDSL_CTRL1_XL_ODR_XL0   (1 << 4)
#define LSMDSL_CTRL1_XL_ODR_XL1   (1 << 5)
#define LSMDSL_CTRL1_XL_ODR_XL2   (1 << 6)
#define LSMDSL_CTRL1_XL_ODR_XL3   (1 << 7)

LSM6DSL_AD_CTRL2_G register bits definitions

#define LSMDSL_CTRL2_G_FS_MASK   0x0E
#define LSMDSL_CTRL2_G_FS_125   (1 << 1)
#define LSMDSL_CTRL2_G_FS_G0   (1 << 2)
#define LSMDSL_CTRL2_G_FS_G1   (1 << 3)
#define LSMDSL_CTRL2_G_ODR_G0   (1 << 4)
#define LSMDSL_CTRL2_G_ODR_G1   (1 << 5)
#define LSMDSL_CTRL2_G_ODR_G2   (1 << 6)
#define LSMDSL_CTRL2_G_ODR_G3   (1 << 7)

LSM6DSL_AD_CTRL3_C register bits definitions

#define LSMDSL_CTRL3_C_SW_RESET   (1 << 0)
#define LSMDSL_CTRL3_C_BLE   (1 << 1)
#define LSMDSL_CTRL3_C_IF_INC   (1 << 2)
#define LSMDSL_CTRL3_C_SIM   (1 << 3)
#define LSMDSL_CTRL3_C_PP_OD   (1 << 4)
#define LSMDSL_CTRL3_C_H_LACTIVE   (1 << 5)
#define LSMDSL_CTRL3_C_BDU   (1 << 6)
#define LSMDSL_CTRL3_C_BOOT   (1 << 7)

LSM6DSL_AD_CTRL4_C register bits definitions

#define LSMDSL_CTRL4_C_NOT_USED_01   (1 << 0)
#define LSMDSL_CTRL4_C_LPF1_SEL_G   (1 << 1)
#define LSMDSL_CTRL4_C_I2C_DISABLE   (1 << 2)
#define LSMDSL_CTRL4_C_DRDY_MASK   (1 << 3)
#define LSMDSL_CTRL4_C_DEN_DRDY_IN   (1 << 4)
#define LSMDSL_CTRL4_C_INT2_ON_INT   (1 << 5)
#define LSMDSL_CTRL4_C_SLEEP   (1 << 6)
#define LSMDSL_CTRL4_C_DEN_XL_EN   (1 << 7)

LSM6DSL_AD_CTRL5_C register bits definitions

#define LSMDSL_CTRL5_C_ST0_XL   (1 << 0)
#define LSMDSL_CTRL5_C_ST1_XL   (1 << 1)
#define LSMDSL_CTRL5_C_ST0_G   (1 << 2)
#define LSMDSL_CTRL5_C_ST1_G   (1 << 3)
#define LSMDSL_CTRL5_C_DEN_LH   (1 << 4)
#define LSMDSL_CTRL5_C_ROUNDING0   (1 << 5)
#define LSMDSL_CTRL5_C_ROUNDING1   (1 << 6)
#define LSMDSL_CTRL5_C_ROUNDING2   (1 << 7)

LSM6DSL_AD_CTRL6_C register bits definitions

#define LSMDSL_CTRL6_C_FTYPE_0   (1 << 0)
#define LSMDSL_CTRL6_C_FTYPE_1   (1 << 1)
#define LSMDSL_CTRL6_C_USR_OFF_W   (1 << 3)
#define LSMDSL_CTRL6_C_XL_HM_MODE   (1 << 4)
#define LSMDSL_CTRL6_C_LVL2_EN   (1 << 5)
#define LSMDSL_CTRL6_C_LVL_EN   (1 << 6)
#define LSMDSL_CTRL6_C_TRIG_EN   (1 << 7)

LSM6DSL_AD_CTRL7_G register bits definitions

#define LSMDSL_CTRL7_G_ROUNDING_ST   (1 << 2)
#define LSMDSL_CTRL7_G_HPM0_G   (1 << 4)
#define LSMDSL_CTRL7_G_HPM1_G   (1 << 5)
#define LSMDSL_CTRL7_G_HP_EN_G   (1 << 6)
#define LSMDSL_CTRL7_G_G_HM_MODE   (1 << 7)

LSM6DSL_AD_CTRL8_XL register bits definitions

#define LSMDSL_CTRL8_XL_LOW_PASS_ON   (1 << 0)
#define LSMDSL_CTRL8_XL_HP_SLOPE_XL   (1 << 2)
#define LSMDSL_CTRL8_XL_INPUT_COMPO   (1 << 3)
#define LSMDSL_CTRL8_XL_HP_REF_MODE   (1 << 4)
#define LSMDSL_CTRL8_XL_HPCF_XL0   (1 << 5)
#define LSMDSL_CTRL8_XL_HPCF_XL1   (1 << 6)
#define LSMDSL_CTRL8_XL_LPF2_XL_EN   (1 << 7)

LSM6DSL_AD_CTRL9_XL register bits definitions

#define LSMDSL_CTRL9_XL_SOFT_EN   (1 << 2)
#define LSMDSL_CTRL9_XL_DEN_XL_G   (1 << 4)
#define LSMDSL_CTRL9_XL_DEN_Z   (1 << 5)
#define LSMDSL_CTRL9_XL_DEN_Y   (1 << 6)
#define LSMDSL_CTRL9_XL_DEN_X   (1 << 7)

LSM6DSL_AD_CTRL10_C register bits definitions

#define LSMDSL_CTRL10_C_SIGN_MOTION   (1 << 0)
#define LSMDSL_CTRL10_C_PEDO_RST_ST   (1 << 1)
#define LSMDSL_CTRL10_C_FUNC_EN   (1 << 2)
#define LSMDSL_CTRL10_C_TILT_EN   (1 << 3)
#define LSMDSL_CTRL10_C_PEDO_EN   (1 << 4)
#define LSMDSL_CTRL10_C_TIMER_EN   (1 << 5)
#define LSMDSL_CTRL10_C_WRIST_TILT   (1 << 7)

Configuration options

#define LSM6DSL_USE_SPI   FALSE
 LSM6DSL SPI interface switch.
#define LSM6DSL_SHARED_SPI   FALSE
 LSM6DSL shared SPI switch.
#define LSM6DSL_USE_I2C   TRUE
 LSM6DSL I2C interface switch.
#define LSM6DSL_SHARED_I2C   FALSE
 LSM6DSL shared I2C switch.
#define LSM6DSL_USE_ADVANCED   FALSE
 LSM6DSL advanced configurations switch.
#define LSM6DSL_GYRO_BIAS_ACQ_TIMES   50
 Number of acquisitions for gyroscope bias removal.
#define LSM6DSL_GYRO_BIAS_SETTLING_US   5000
 Settling time for gyroscope bias removal.

Data Structures

struct  LSM6DSLConfig
 LSM6DSL configuration structure. More...
struct  LSM6DSLVMT
 LSM6DSL virtual methods table. More...
struct  LSM6DSLDriver
 LSM6DSL 6-axis accelerometer/gyroscope class. More...

Macros

#define lsm6dslI2CWriteRegister(i2cp, sad, txbuf, n)
 Writes a value into a register using I2C.
#define lsm6dslAccelerometerGetAxesNumber(devp)
 Return the number of axes of the BaseAccelerometer.
#define lsm6dslAccelerometerReadRaw(devp, axes)
 Retrieves raw data from the BaseAccelerometer.
#define lsm6dslAccelerometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseAccelerometer.
#define lsm6dslAccelerometerSetBias(devp, bp)
 Set bias values for the BaseAccelerometer.
#define lsm6dslAccelerometerResetBias(devp)
 Reset bias values for the BaseAccelerometer.
#define lsm6dslAccelerometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseAccelerometer.
#define lsm6dslAccelerometerResetSensitivity(devp)
 Reset sensitivity values for the BaseAccelerometer.
#define lsm6dslAccelerometerSetFullScale(devp, fs)
 Changes the LSM6DSLDriver accelerometer fullscale value.
#define lsm6dslGyroscopeGetAxesNumber(devp)
 Return the number of axes of the BaseGyroscope.
#define lsm6dslGyroscopeReadRaw(devp, axes)
 Retrieves raw data from the BaseGyroscope.
#define lsm6dslGyroscopeReadCooked(devp, axes)
 Retrieves cooked data from the BaseGyroscope.
#define lsm6dslGyroscopeSampleBias(devp)
 Samples bias values for the BaseGyroscope.
#define lsm6dslGyroscopeSetBias(devp, bp)
 Set bias values for the BaseGyroscope.
#define lsm6dslGyroscopeResetBias(devp)
 Reset bias values for the BaseGyroscope.
#define lsm6dslGyroscopeSetSensitivity(devp, sp)
 Set sensitivity values for the BaseGyroscope.
#define lsm6dslGyroscopeResetSensitivity(devp)
 Reset sensitivity values for the BaseGyroscope.
#define lsm6dslGyroscopeSetFullScale(devp, fs)
 Changes the LSM6DSLDriver gyroscope fullscale value.

Functions

msg_t lsm6dslI2CReadRegister (I2CDriver *i2cp, lsm6dsl_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
 Reads registers value using I2C.
static size_t acc_get_axes_number (void *ip)
 Return the number of axes of the BaseAccelerometer.
static msg_t acc_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseAccelerometer.
static msg_t acc_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseAccelerometer.
static msg_t acc_set_bias (void *ip, float *bp)
 Set bias values for the BaseAccelerometer.
static msg_t acc_reset_bias (void *ip)
 Reset bias values for the BaseAccelerometer.
static msg_t acc_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseAccelerometer.
static msg_t acc_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseAccelerometer.
static msg_t acc_set_full_scale (LSM6DSLDriver *devp, lsm6dsl_acc_fs_t fs)
 Changes the LSM6DSLDriver accelerometer fullscale value.
static size_t gyro_get_axes_number (void *ip)
 Return the number of axes of the BaseGyroscope.
static msg_t gyro_read_raw (void *ip, int32_t axes[LSM6DSL_GYRO_NUMBER_OF_AXES])
 Retrieves raw data from the BaseGyroscope.
static msg_t gyro_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseGyroscope.
static msg_t gyro_sample_bias (void *ip)
 Samples bias values for the BaseGyroscope.
static msg_t gyro_set_bias (void *ip, float *bp)
 Set bias values for the BaseGyroscope.
static msg_t gyro_reset_bias (void *ip)
 Reset bias values for the BaseGyroscope.
static msg_t gyro_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseGyroscope.
static msg_t gyro_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseGyroscope.
static msg_t gyro_set_full_scale (LSM6DSLDriver *devp, lsm6dsl_gyro_fs_t fs)
 Changes the LSM6DSLDriver gyroscope fullscale value.
void lsm6dslObjectInit (LSM6DSLDriver *devp)
 Initializes an instance.
void lsm6dslStart (LSM6DSLDriver *devp, const LSM6DSLConfig *config)
 Configures and activates LSM6DSL Complex Driver peripheral.
void lsm6dslStop (LSM6DSLDriver *devp)
 Deactivates the LSM6DSL Complex Driver peripheral.

Variables

static const struct LSM6DSLVMT vmt_device
static const struct BaseAccelerometerVMT vmt_accelerometer
static const struct BaseGyroscopeVMT vmt_gyroscope

Macro Definition Documentation

◆ lsm6dslI2CWriteRegister

#define lsm6dslI2CWriteRegister ( i2cp,
sad,
txbuf,
n )
Value:
i2cMasterTransmitTimeout(i2cp, sad, txbuf, n + 1, NULL, 0, \
msg_t i2cMasterTransmitTimeout(I2CDriver *i2cp, i2caddr_t addr, const uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, sysinterval_t timeout)
Sends data via the I2C bus.
Definition hal_i2c.c:187
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
Definition chtime.h:55

Writes a value into a register using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Parameters
[in]i2cppointer to the I2C interface
[in]sadslave address without R bit
[in]txbufbuffer containing sub-address value in first position and values to write
[in]nsize of txbuf less one (not considering the first element)
Returns
the operation status.
Function Class:
Not an API, this function is for internal use only.

Definition at line 83 of file lsm6dsl.c.

Referenced by acc_set_full_scale(), gyro_set_full_scale(), lsm6dslStart(), and lsm6dslStop().

◆ EX_LSM6DSL_VERSION

#define EX_LSM6DSL_VERSION   "1.0.2"

LSM6DSL driver version string.

Definition at line 46 of file lsm6dsl.h.

◆ EX_LSM6DSL_MAJOR

#define EX_LSM6DSL_MAJOR   1

LSM6DSL driver version major number.

Definition at line 51 of file lsm6dsl.h.

◆ EX_LSM6DSL_MINOR

#define EX_LSM6DSL_MINOR   0

LSM6DSL driver version minor number.

Definition at line 56 of file lsm6dsl.h.

◆ EX_LSM6DSL_PATCH

#define EX_LSM6DSL_PATCH   2

LSM6DSL driver version patch number.

Definition at line 61 of file lsm6dsl.h.

◆ LSM6DSL_ACC_NUMBER_OF_AXES

#define LSM6DSL_ACC_NUMBER_OF_AXES   3U

LSM6DSL accelerometer subsystem characteristics.

Note
Sensitivity is expressed as milli-G/LSB whereas 1 milli-G = 0.00980665 m/s^2.
Bias is expressed as milli-G.

Definition at line 72 of file lsm6dsl.h.

Referenced by acc_get_axes_number(), acc_read_cooked(), acc_read_raw(), acc_reset_bias(), acc_reset_sensivity(), acc_set_bias(), acc_set_full_scale(), acc_set_sensivity(), lsm6dslObjectInit(), and lsm6dslStart().

◆ LSM6DSL_ACC_2G

#define LSM6DSL_ACC_2G   2.0f

Definition at line 74 of file lsm6dsl.h.

Referenced by acc_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_ACC_4G

#define LSM6DSL_ACC_4G   4.0f

Definition at line 75 of file lsm6dsl.h.

Referenced by acc_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_ACC_8G

#define LSM6DSL_ACC_8G   8.0f

Definition at line 76 of file lsm6dsl.h.

Referenced by acc_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_ACC_16G

#define LSM6DSL_ACC_16G   16.0f

Definition at line 77 of file lsm6dsl.h.

Referenced by acc_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_ACC_SENS_2G

#define LSM6DSL_ACC_SENS_2G   0.061f

Definition at line 79 of file lsm6dsl.h.

Referenced by acc_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_ACC_SENS_4G

#define LSM6DSL_ACC_SENS_4G   0.122f

Definition at line 80 of file lsm6dsl.h.

Referenced by acc_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_ACC_SENS_8G

#define LSM6DSL_ACC_SENS_8G   0.244f

Definition at line 81 of file lsm6dsl.h.

Referenced by acc_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_ACC_SENS_16G

#define LSM6DSL_ACC_SENS_16G   0.488f

Definition at line 82 of file lsm6dsl.h.

Referenced by acc_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_ACC_BIAS

#define LSM6DSL_ACC_BIAS   0.0f

Definition at line 84 of file lsm6dsl.h.

Referenced by acc_reset_bias(), and lsm6dslStart().

◆ LSM6DSL_GYRO_NUMBER_OF_AXES

#define LSM6DSL_GYRO_NUMBER_OF_AXES   3U

L3GD20 gyroscope system characteristics.

Note
Sensitivity is expressed as DPS/LSB whereas DPS stand for Degree per second [�/s].
Bias is expressed as DPS.

Definition at line 95 of file lsm6dsl.h.

Referenced by gyro_get_axes_number(), gyro_read_cooked(), gyro_read_raw(), gyro_reset_bias(), gyro_reset_sensivity(), gyro_sample_bias(), gyro_set_bias(), gyro_set_full_scale(), gyro_set_sensivity(), lsm6dslObjectInit(), and lsm6dslStart().

◆ LSM6DSL_GYRO_125DPS

#define LSM6DSL_GYRO_125DPS   125.0f

Definition at line 97 of file lsm6dsl.h.

Referenced by gyro_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_GYRO_250DPS

#define LSM6DSL_GYRO_250DPS   250.0f

Definition at line 98 of file lsm6dsl.h.

Referenced by gyro_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_GYRO_500DPS

#define LSM6DSL_GYRO_500DPS   500.0f

Definition at line 99 of file lsm6dsl.h.

Referenced by gyro_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_GYRO_1000DPS

#define LSM6DSL_GYRO_1000DPS   1000.0f

Definition at line 100 of file lsm6dsl.h.

Referenced by gyro_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_GYRO_2000DPS

#define LSM6DSL_GYRO_2000DPS   2000.0f

Definition at line 101 of file lsm6dsl.h.

Referenced by gyro_set_full_scale(), and lsm6dslStart().

◆ LSM6DSL_GYRO_SENS_125DPS

#define LSM6DSL_GYRO_SENS_125DPS   0.004375f

Definition at line 103 of file lsm6dsl.h.

Referenced by gyro_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_GYRO_SENS_250DPS

#define LSM6DSL_GYRO_SENS_250DPS   0.008750f

Definition at line 104 of file lsm6dsl.h.

Referenced by gyro_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_GYRO_SENS_500DPS

#define LSM6DSL_GYRO_SENS_500DPS   0.017500f

Definition at line 105 of file lsm6dsl.h.

Referenced by gyro_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_GYRO_SENS_1000DPS

#define LSM6DSL_GYRO_SENS_1000DPS   0.035000f

Definition at line 106 of file lsm6dsl.h.

Referenced by gyro_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_GYRO_SENS_2000DPS

#define LSM6DSL_GYRO_SENS_2000DPS   0.070000f

Definition at line 107 of file lsm6dsl.h.

Referenced by gyro_reset_sensivity(), and lsm6dslStart().

◆ LSM6DSL_GYRO_BIAS

#define LSM6DSL_GYRO_BIAS   0.0f

Definition at line 109 of file lsm6dsl.h.

Referenced by gyro_reset_bias(), and lsm6dslStart().

◆ LSM6DSL_DI_MASK

#define LSM6DSL_DI_MASK   0xFF

Definition at line 116 of file lsm6dsl.h.

◆ LSM6DSL_DI

#define LSM6DSL_DI ( n)
Value:
(1 << n)

Definition at line 117 of file lsm6dsl.h.

◆ LSM6DSL_AD_MASK

#define LSM6DSL_AD_MASK   0x7F

Definition at line 118 of file lsm6dsl.h.

◆ LSM6DSL_AD

#define LSM6DSL_AD ( n)
Value:
(1 << n)

Definition at line 119 of file lsm6dsl.h.

◆ LSM6DSL_MS

#define LSM6DSL_MS   (1 << 7)

Definition at line 120 of file lsm6dsl.h.

◆ LSM6DSL_AD_FUNC_CFG_ACCESS

#define LSM6DSL_AD_FUNC_CFG_ACCESS   0x01

Definition at line 127 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSOR_SYNC_TIME_FRAME

#define LSM6DSL_AD_SENSOR_SYNC_TIME_FRAME   0x04

Definition at line 128 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSOR_SYNC_RES_RATIO

#define LSM6DSL_AD_SENSOR_SYNC_RES_RATIO   0x05

Definition at line 129 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_CTRL1

#define LSM6DSL_AD_FIFO_CTRL1   0x06

Definition at line 130 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_CTRL2

#define LSM6DSL_AD_FIFO_CTRL2   0x07

Definition at line 131 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_CTRL3

#define LSM6DSL_AD_FIFO_CTRL3   0x08

Definition at line 132 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_CTRL4

#define LSM6DSL_AD_FIFO_CTRL4   0x09

Definition at line 133 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_CTRL5

#define LSM6DSL_AD_FIFO_CTRL5   0x0A

Definition at line 134 of file lsm6dsl.h.

◆ LSM6DSL_AD_DRDY_PULSE_CFG_G

#define LSM6DSL_AD_DRDY_PULSE_CFG_G   0x0B

Definition at line 135 of file lsm6dsl.h.

◆ LSM6DSL_AD_INT1_CTRL

#define LSM6DSL_AD_INT1_CTRL   0x0D

Definition at line 136 of file lsm6dsl.h.

◆ LSM6DSL_AD_INT2_CTRL

#define LSM6DSL_AD_INT2_CTRL   0x0E

Definition at line 137 of file lsm6dsl.h.

◆ LSM6DSL_AD_WHO_AM_I

#define LSM6DSL_AD_WHO_AM_I   0x0F

Definition at line 138 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL1_XL

#define LSM6DSL_AD_CTRL1_XL   0x10

Definition at line 139 of file lsm6dsl.h.

Referenced by acc_set_full_scale(), lsm6dslStart(), and lsm6dslStop().

◆ LSM6DSL_AD_CTRL2_G

#define LSM6DSL_AD_CTRL2_G   0x11

Definition at line 140 of file lsm6dsl.h.

Referenced by gyro_set_full_scale().

◆ LSM6DSL_AD_CTRL3_C

#define LSM6DSL_AD_CTRL3_C   0x12

Definition at line 141 of file lsm6dsl.h.

Referenced by lsm6dslStart().

◆ LSM6DSL_AD_CTRL4_C

#define LSM6DSL_AD_CTRL4_C   0x13

Definition at line 142 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL5_C

#define LSM6DSL_AD_CTRL5_C   0x14

Definition at line 143 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL6_C

#define LSM6DSL_AD_CTRL6_C   0x15

Definition at line 144 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL7_G

#define LSM6DSL_AD_CTRL7_G   0x16

Definition at line 145 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL8_XL

#define LSM6DSL_AD_CTRL8_XL   0x17

Definition at line 146 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL9_XL

#define LSM6DSL_AD_CTRL9_XL   0x18

Definition at line 147 of file lsm6dsl.h.

◆ LSM6DSL_AD_CTRL10_C

#define LSM6DSL_AD_CTRL10_C   0x19

Definition at line 148 of file lsm6dsl.h.

◆ LSM6DSL_AD_MASTER_CONFIG

#define LSM6DSL_AD_MASTER_CONFIG   0x1A

Definition at line 149 of file lsm6dsl.h.

◆ LSM6DSL_AD_WAKE_UP_SRC

#define LSM6DSL_AD_WAKE_UP_SRC   0x1B

Definition at line 150 of file lsm6dsl.h.

◆ LSM6DSL_AD_TAP_SRC

#define LSM6DSL_AD_TAP_SRC   0x1C

Definition at line 151 of file lsm6dsl.h.

◆ LSM6DSL_AD_D6D_SRC

#define LSM6DSL_AD_D6D_SRC   0x1D

Definition at line 152 of file lsm6dsl.h.

◆ LSM6DSL_AD_STATUS_REG

#define LSM6DSL_AD_STATUS_REG   0x1E

Definition at line 153 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_TEMP_L

#define LSM6DSL_AD_OUT_TEMP_L   0x20

Definition at line 154 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_TEMP_H

#define LSM6DSL_AD_OUT_TEMP_H   0x21

Definition at line 155 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTX_L_G

#define LSM6DSL_AD_OUTX_L_G   0x22

Definition at line 156 of file lsm6dsl.h.

Referenced by gyro_read_raw().

◆ LSM6DSL_AD_OUTX_H_G

#define LSM6DSL_AD_OUTX_H_G   0x23

Definition at line 157 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTY_L_G

#define LSM6DSL_AD_OUTY_L_G   0x24

Definition at line 158 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTY_H_G

#define LSM6DSL_AD_OUTY_H_G   0x25

Definition at line 159 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTZ_L_G

#define LSM6DSL_AD_OUTZ_L_G   0x26

Definition at line 160 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTZ_H_G

#define LSM6DSL_AD_OUTZ_H_G   0x27

Definition at line 161 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTX_L_XL

#define LSM6DSL_AD_OUTX_L_XL   0x28

Definition at line 162 of file lsm6dsl.h.

Referenced by acc_read_raw().

◆ LSM6DSL_AD_OUTX_H_XL

#define LSM6DSL_AD_OUTX_H_XL   0x29

Definition at line 163 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTY_L_XL

#define LSM6DSL_AD_OUTY_L_XL   0x2A

Definition at line 164 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTY_H_XL

#define LSM6DSL_AD_OUTY_H_XL   0x2B

Definition at line 165 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTZ_L_XL

#define LSM6DSL_AD_OUTZ_L_XL   0x2C

Definition at line 166 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUTZ_H_XL

#define LSM6DSL_AD_OUTZ_H_XL   0x2D

Definition at line 167 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB1_REG

#define LSM6DSL_AD_SENSORHUB1_REG   0x2E

Definition at line 168 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB2_REG

#define LSM6DSL_AD_SENSORHUB2_REG   0x2F

Definition at line 169 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB3_REG

#define LSM6DSL_AD_SENSORHUB3_REG   0x30

Definition at line 170 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB4_REG

#define LSM6DSL_AD_SENSORHUB4_REG   0x31

Definition at line 171 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB5_REG

#define LSM6DSL_AD_SENSORHUB5_REG   0x32

Definition at line 172 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB6_REG

#define LSM6DSL_AD_SENSORHUB6_REG   0x33

Definition at line 173 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB7_REG

#define LSM6DSL_AD_SENSORHUB7_REG   0x34

Definition at line 174 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB8_REG

#define LSM6DSL_AD_SENSORHUB8_REG   0x35

Definition at line 175 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB9_REG

#define LSM6DSL_AD_SENSORHUB9_REG   0x36

Definition at line 176 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB10_REG

#define LSM6DSL_AD_SENSORHUB10_REG   0x37

Definition at line 177 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB11_REG

#define LSM6DSL_AD_SENSORHUB11_REG   0x38

Definition at line 178 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB12_REG

#define LSM6DSL_AD_SENSORHUB12_REG   0x39

Definition at line 179 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_STATUS1

#define LSM6DSL_AD_FIFO_STATUS1   0x3A

Definition at line 180 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_STATUS2

#define LSM6DSL_AD_FIFO_STATUS2   0x3B

Definition at line 181 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_STATUS3

#define LSM6DSL_AD_FIFO_STATUS3   0x3C

Definition at line 182 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_STATUS4

#define LSM6DSL_AD_FIFO_STATUS4   0x3D

Definition at line 183 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_DATA_OUT_L

#define LSM6DSL_AD_FIFO_DATA_OUT_L   0x3E

Definition at line 184 of file lsm6dsl.h.

◆ LSM6DSL_AD_FIFO_DATA_OUT_H

#define LSM6DSL_AD_FIFO_DATA_OUT_H   0x3F

Definition at line 185 of file lsm6dsl.h.

◆ LSM6DSL_AD_TIMESTAMP0_REG

#define LSM6DSL_AD_TIMESTAMP0_REG   0x40

Definition at line 186 of file lsm6dsl.h.

◆ LSM6DSL_AD_TIMESTAMP1_REG

#define LSM6DSL_AD_TIMESTAMP1_REG   0x41

Definition at line 187 of file lsm6dsl.h.

◆ LSM6DSL_AD_TIMESTAMP2_REG

#define LSM6DSL_AD_TIMESTAMP2_REG   0x42

Definition at line 188 of file lsm6dsl.h.

◆ LSM6DSL_AD_STEP_TIMESTAMP_L

#define LSM6DSL_AD_STEP_TIMESTAMP_L   0x49

Definition at line 189 of file lsm6dsl.h.

◆ LSM6DSL_AD_STEP_TIMESTAMP_H

#define LSM6DSL_AD_STEP_TIMESTAMP_H   0x4A

Definition at line 190 of file lsm6dsl.h.

◆ LSM6DSL_AD_STEP_COUNTER_L

#define LSM6DSL_AD_STEP_COUNTER_L   0x4B

Definition at line 191 of file lsm6dsl.h.

◆ LSM6DSL_AD_STEP_COUNTER_H

#define LSM6DSL_AD_STEP_COUNTER_H   0x4C

Definition at line 192 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB13_REG

#define LSM6DSL_AD_SENSORHUB13_REG   0x4D

Definition at line 193 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB14_REG

#define LSM6DSL_AD_SENSORHUB14_REG   0x4E

Definition at line 194 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB15_REG

#define LSM6DSL_AD_SENSORHUB15_REG   0x4F

Definition at line 195 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB16_REG

#define LSM6DSL_AD_SENSORHUB16_REG   0x50

Definition at line 196 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB17_REG

#define LSM6DSL_AD_SENSORHUB17_REG   0x51

Definition at line 197 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENSORHUB18_REG

#define LSM6DSL_AD_SENSORHUB18_REG   0x52

Definition at line 198 of file lsm6dsl.h.

◆ LSM6DSL_AD_FUNC_SRC1

#define LSM6DSL_AD_FUNC_SRC1   0x53

Definition at line 199 of file lsm6dsl.h.

◆ LSM6DSL_AD_FUNC_SRC2

#define LSM6DSL_AD_FUNC_SRC2   0x54

Definition at line 200 of file lsm6dsl.h.

◆ LSM6DSL_AD_WRIST_TILT_IA

#define LSM6DSL_AD_WRIST_TILT_IA   0x55

Definition at line 201 of file lsm6dsl.h.

◆ LSM6DSL_AD_TAP_CFG

#define LSM6DSL_AD_TAP_CFG   0x58

Definition at line 202 of file lsm6dsl.h.

◆ LSM6DSL_AD_TAP_THS_6D

#define LSM6DSL_AD_TAP_THS_6D   0x59

Definition at line 203 of file lsm6dsl.h.

◆ LSM6DSL_AD_INT_DUR2

#define LSM6DSL_AD_INT_DUR2   0x5A

Definition at line 204 of file lsm6dsl.h.

◆ LSM6DSL_AD_WAKE_UP_THS

#define LSM6DSL_AD_WAKE_UP_THS   0x5B

Definition at line 205 of file lsm6dsl.h.

◆ LSM6DSL_AD_WAKE_UP_DUR

#define LSM6DSL_AD_WAKE_UP_DUR   0x5C

Definition at line 206 of file lsm6dsl.h.

◆ LSM6DSL_AD_FREE_FALL

#define LSM6DSL_AD_FREE_FALL   0x5D

Definition at line 207 of file lsm6dsl.h.

◆ LSM6DSL_AD_MD1_CFG

#define LSM6DSL_AD_MD1_CFG   0x5E

Definition at line 208 of file lsm6dsl.h.

◆ LSM6DSL_AD_MD2_CFG

#define LSM6DSL_AD_MD2_CFG   0x5F

Definition at line 209 of file lsm6dsl.h.

◆ LSM6DSL_AD_MASTER_CMD_CODE

#define LSM6DSL_AD_MASTER_CMD_CODE   0x60

Definition at line 210 of file lsm6dsl.h.

◆ LSM6DSL_AD_SENS_SYNC_SPI_ERROR_CODE

#define LSM6DSL_AD_SENS_SYNC_SPI_ERROR_CODE   0x61

Definition at line 211 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_MAG_RAW_X_L

#define LSM6DSL_AD_OUT_MAG_RAW_X_L   0x66

Definition at line 212 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_MAG_RAW_X_H

#define LSM6DSL_AD_OUT_MAG_RAW_X_H   0x67

Definition at line 213 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_MAG_RAW_Y_L

#define LSM6DSL_AD_OUT_MAG_RAW_Y_L   0x68

Definition at line 214 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_MAG_RAW_Y_H

#define LSM6DSL_AD_OUT_MAG_RAW_Y_H   0x69

Definition at line 215 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_MAG_RAW_Z_L

#define LSM6DSL_AD_OUT_MAG_RAW_Z_L   0x6A

Definition at line 216 of file lsm6dsl.h.

◆ LSM6DSL_AD_OUT_MAG_RAW_Z_H

#define LSM6DSL_AD_OUT_MAG_RAW_Z_H   0x6B

Definition at line 217 of file lsm6dsl.h.

◆ LSM6DSL_AD_X_OFS_USR

#define LSM6DSL_AD_X_OFS_USR   0x73

Definition at line 218 of file lsm6dsl.h.

◆ LSM6DSL_AD_Y_OFS_USR

#define LSM6DSL_AD_Y_OFS_USR   0x74

Definition at line 219 of file lsm6dsl.h.

◆ LSM6DSL_AD_Z_OFS_USR

#define LSM6DSL_AD_Z_OFS_USR   0x75

Definition at line 220 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_BW0_XL

#define LSMDSL_CTRL1_XL_BW0_XL   (1 << 0)

Definition at line 227 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_LPF1_BW_SEL

#define LSMDSL_CTRL1_XL_LPF1_BW_SEL   (1 << 1)

Definition at line 228 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_FS_MASK

#define LSMDSL_CTRL1_XL_FS_MASK   0x0C

Definition at line 229 of file lsm6dsl.h.

Referenced by acc_set_full_scale().

◆ LSMDSL_CTRL1_XL_FS_XL0

#define LSMDSL_CTRL1_XL_FS_XL0   (1 << 2)

Definition at line 230 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_FS_XL1

#define LSMDSL_CTRL1_XL_FS_XL1   (1 << 3)

Definition at line 231 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_ODR_XL0

#define LSMDSL_CTRL1_XL_ODR_XL0   (1 << 4)

Definition at line 232 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_ODR_XL1

#define LSMDSL_CTRL1_XL_ODR_XL1   (1 << 5)

Definition at line 233 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_ODR_XL2

#define LSMDSL_CTRL1_XL_ODR_XL2   (1 << 6)

Definition at line 234 of file lsm6dsl.h.

◆ LSMDSL_CTRL1_XL_ODR_XL3

#define LSMDSL_CTRL1_XL_ODR_XL3   (1 << 7)

Definition at line 235 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_FS_MASK

#define LSMDSL_CTRL2_G_FS_MASK   0x0E

Definition at line 242 of file lsm6dsl.h.

Referenced by gyro_set_full_scale().

◆ LSMDSL_CTRL2_G_FS_125

#define LSMDSL_CTRL2_G_FS_125   (1 << 1)

Definition at line 243 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_FS_G0

#define LSMDSL_CTRL2_G_FS_G0   (1 << 2)

Definition at line 244 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_FS_G1

#define LSMDSL_CTRL2_G_FS_G1   (1 << 3)

Definition at line 245 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_ODR_G0

#define LSMDSL_CTRL2_G_ODR_G0   (1 << 4)

Definition at line 246 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_ODR_G1

#define LSMDSL_CTRL2_G_ODR_G1   (1 << 5)

Definition at line 247 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_ODR_G2

#define LSMDSL_CTRL2_G_ODR_G2   (1 << 6)

Definition at line 248 of file lsm6dsl.h.

◆ LSMDSL_CTRL2_G_ODR_G3

#define LSMDSL_CTRL2_G_ODR_G3   (1 << 7)

Definition at line 249 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_SW_RESET

#define LSMDSL_CTRL3_C_SW_RESET   (1 << 0)

Definition at line 256 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_BLE

#define LSMDSL_CTRL3_C_BLE   (1 << 1)

Definition at line 257 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_IF_INC

#define LSMDSL_CTRL3_C_IF_INC   (1 << 2)

Definition at line 258 of file lsm6dsl.h.

Referenced by lsm6dslStart().

◆ LSMDSL_CTRL3_C_SIM

#define LSMDSL_CTRL3_C_SIM   (1 << 3)

Definition at line 259 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_PP_OD

#define LSMDSL_CTRL3_C_PP_OD   (1 << 4)

Definition at line 260 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_H_LACTIVE

#define LSMDSL_CTRL3_C_H_LACTIVE   (1 << 5)

Definition at line 261 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_BDU

#define LSMDSL_CTRL3_C_BDU   (1 << 6)

Definition at line 262 of file lsm6dsl.h.

◆ LSMDSL_CTRL3_C_BOOT

#define LSMDSL_CTRL3_C_BOOT   (1 << 7)

Definition at line 263 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_NOT_USED_01

#define LSMDSL_CTRL4_C_NOT_USED_01   (1 << 0)

Definition at line 270 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_LPF1_SEL_G

#define LSMDSL_CTRL4_C_LPF1_SEL_G   (1 << 1)

Definition at line 271 of file lsm6dsl.h.

Referenced by lsm6dslStart().

◆ LSMDSL_CTRL4_C_I2C_DISABLE

#define LSMDSL_CTRL4_C_I2C_DISABLE   (1 << 2)

Definition at line 272 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_DRDY_MASK

#define LSMDSL_CTRL4_C_DRDY_MASK   (1 << 3)

Definition at line 273 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_DEN_DRDY_IN

#define LSMDSL_CTRL4_C_DEN_DRDY_IN   (1 << 4)

Definition at line 274 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_INT2_ON_INT

#define LSMDSL_CTRL4_C_INT2_ON_INT   (1 << 5)

Definition at line 275 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_SLEEP

#define LSMDSL_CTRL4_C_SLEEP   (1 << 6)

Definition at line 276 of file lsm6dsl.h.

◆ LSMDSL_CTRL4_C_DEN_XL_EN

#define LSMDSL_CTRL4_C_DEN_XL_EN   (1 << 7)

Definition at line 277 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ST0_XL

#define LSMDSL_CTRL5_C_ST0_XL   (1 << 0)

Definition at line 284 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ST1_XL

#define LSMDSL_CTRL5_C_ST1_XL   (1 << 1)

Definition at line 285 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ST0_G

#define LSMDSL_CTRL5_C_ST0_G   (1 << 2)

Definition at line 286 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ST1_G

#define LSMDSL_CTRL5_C_ST1_G   (1 << 3)

Definition at line 287 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_DEN_LH

#define LSMDSL_CTRL5_C_DEN_LH   (1 << 4)

Definition at line 288 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ROUNDING0

#define LSMDSL_CTRL5_C_ROUNDING0   (1 << 5)

Definition at line 289 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ROUNDING1

#define LSMDSL_CTRL5_C_ROUNDING1   (1 << 6)

Definition at line 290 of file lsm6dsl.h.

◆ LSMDSL_CTRL5_C_ROUNDING2

#define LSMDSL_CTRL5_C_ROUNDING2   (1 << 7)

Definition at line 291 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_FTYPE_0

#define LSMDSL_CTRL6_C_FTYPE_0   (1 << 0)

Definition at line 298 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_FTYPE_1

#define LSMDSL_CTRL6_C_FTYPE_1   (1 << 1)

Definition at line 299 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_USR_OFF_W

#define LSMDSL_CTRL6_C_USR_OFF_W   (1 << 3)

Definition at line 300 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_XL_HM_MODE

#define LSMDSL_CTRL6_C_XL_HM_MODE   (1 << 4)

Definition at line 301 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_LVL2_EN

#define LSMDSL_CTRL6_C_LVL2_EN   (1 << 5)

Definition at line 302 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_LVL_EN

#define LSMDSL_CTRL6_C_LVL_EN   (1 << 6)

Definition at line 303 of file lsm6dsl.h.

◆ LSMDSL_CTRL6_C_TRIG_EN

#define LSMDSL_CTRL6_C_TRIG_EN   (1 << 7)

Definition at line 304 of file lsm6dsl.h.

◆ LSMDSL_CTRL7_G_ROUNDING_ST

#define LSMDSL_CTRL7_G_ROUNDING_ST   (1 << 2)

Definition at line 311 of file lsm6dsl.h.

◆ LSMDSL_CTRL7_G_HPM0_G

#define LSMDSL_CTRL7_G_HPM0_G   (1 << 4)

Definition at line 312 of file lsm6dsl.h.

◆ LSMDSL_CTRL7_G_HPM1_G

#define LSMDSL_CTRL7_G_HPM1_G   (1 << 5)

Definition at line 313 of file lsm6dsl.h.

◆ LSMDSL_CTRL7_G_HP_EN_G

#define LSMDSL_CTRL7_G_HP_EN_G   (1 << 6)

Definition at line 314 of file lsm6dsl.h.

◆ LSMDSL_CTRL7_G_G_HM_MODE

#define LSMDSL_CTRL7_G_G_HM_MODE   (1 << 7)

Definition at line 315 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_LOW_PASS_ON

#define LSMDSL_CTRL8_XL_LOW_PASS_ON   (1 << 0)

Definition at line 322 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_HP_SLOPE_XL

#define LSMDSL_CTRL8_XL_HP_SLOPE_XL   (1 << 2)

Definition at line 323 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_INPUT_COMPO

#define LSMDSL_CTRL8_XL_INPUT_COMPO   (1 << 3)

Definition at line 324 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_HP_REF_MODE

#define LSMDSL_CTRL8_XL_HP_REF_MODE   (1 << 4)

Definition at line 325 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_HPCF_XL0

#define LSMDSL_CTRL8_XL_HPCF_XL0   (1 << 5)

Definition at line 326 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_HPCF_XL1

#define LSMDSL_CTRL8_XL_HPCF_XL1   (1 << 6)

Definition at line 327 of file lsm6dsl.h.

◆ LSMDSL_CTRL8_XL_LPF2_XL_EN

#define LSMDSL_CTRL8_XL_LPF2_XL_EN   (1 << 7)

Definition at line 328 of file lsm6dsl.h.

◆ LSMDSL_CTRL9_XL_SOFT_EN

#define LSMDSL_CTRL9_XL_SOFT_EN   (1 << 2)

Definition at line 335 of file lsm6dsl.h.

◆ LSMDSL_CTRL9_XL_DEN_XL_G

#define LSMDSL_CTRL9_XL_DEN_XL_G   (1 << 4)

Definition at line 336 of file lsm6dsl.h.

◆ LSMDSL_CTRL9_XL_DEN_Z

#define LSMDSL_CTRL9_XL_DEN_Z   (1 << 5)

Definition at line 337 of file lsm6dsl.h.

◆ LSMDSL_CTRL9_XL_DEN_Y

#define LSMDSL_CTRL9_XL_DEN_Y   (1 << 6)

Definition at line 338 of file lsm6dsl.h.

◆ LSMDSL_CTRL9_XL_DEN_X

#define LSMDSL_CTRL9_XL_DEN_X   (1 << 7)

Definition at line 339 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_SIGN_MOTION

#define LSMDSL_CTRL10_C_SIGN_MOTION   (1 << 0)

Definition at line 346 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_PEDO_RST_ST

#define LSMDSL_CTRL10_C_PEDO_RST_ST   (1 << 1)

Definition at line 347 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_FUNC_EN

#define LSMDSL_CTRL10_C_FUNC_EN   (1 << 2)

Definition at line 348 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_TILT_EN

#define LSMDSL_CTRL10_C_TILT_EN   (1 << 3)

Definition at line 349 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_PEDO_EN

#define LSMDSL_CTRL10_C_PEDO_EN   (1 << 4)

Definition at line 350 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_TIMER_EN

#define LSMDSL_CTRL10_C_TIMER_EN   (1 << 5)

Definition at line 351 of file lsm6dsl.h.

◆ LSMDSL_CTRL10_C_WRIST_TILT

#define LSMDSL_CTRL10_C_WRIST_TILT   (1 << 7)

Definition at line 352 of file lsm6dsl.h.

◆ LSM6DSL_USE_SPI

#define LSM6DSL_USE_SPI   FALSE

LSM6DSL SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is FALSE.

Definition at line 369 of file lsm6dsl.h.

◆ LSM6DSL_SHARED_SPI

#define LSM6DSL_SHARED_SPI   FALSE

LSM6DSL shared SPI switch.

If set to TRUE the device acquires SPI bus ownership on each transaction.

Note
The default is FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.

Definition at line 379 of file lsm6dsl.h.

◆ LSM6DSL_USE_I2C

#define LSM6DSL_USE_I2C   TRUE

LSM6DSL I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is TRUE.

Definition at line 388 of file lsm6dsl.h.

◆ LSM6DSL_SHARED_I2C

#define LSM6DSL_SHARED_I2C   FALSE

LSM6DSL shared I2C switch.

If set to TRUE the device acquires I2C bus ownership on each transaction.

Note
The default is FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.

Definition at line 398 of file lsm6dsl.h.

◆ LSM6DSL_USE_ADVANCED

#define LSM6DSL_USE_ADVANCED   FALSE

LSM6DSL advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 407 of file lsm6dsl.h.

◆ LSM6DSL_GYRO_BIAS_ACQ_TIMES

#define LSM6DSL_GYRO_BIAS_ACQ_TIMES   50

Number of acquisitions for gyroscope bias removal.

This is the number of acquisitions performed to compute the bias. A repetition is required in order to remove noise.

Definition at line 416 of file lsm6dsl.h.

Referenced by gyro_sample_bias().

◆ LSM6DSL_GYRO_BIAS_SETTLING_US

#define LSM6DSL_GYRO_BIAS_SETTLING_US   5000

Settling time for gyroscope bias removal.

This is the time between each bias acquisition.

Definition at line 424 of file lsm6dsl.h.

Referenced by gyro_sample_bias().

◆ _lsm6dsl_methods_alone

#define _lsm6dsl_methods_alone
Value:
/* Change full scale value of LSM6DSL accelerometer subsystem .*/ \
/* Change full scale value of LSM6DSL gyroscope subsystem .*/ \
static msg_t acc_set_full_scale(ADXL355Driver *devp, adxl355_acc_fs_t fs)
Changes the ADXL355Driver accelerometer fullscale value.
Definition adxl355.c:301
static msg_t gyro_set_full_scale(L3GD20Driver *devp, l3gd20_fs_t fs)
Changes the L3GD20Driver gyroscope fullscale value.
Definition l3gd20.c:378
lsm6dsl_gyro_fs_t
LSM6DSL gyroscope subsystem full scale.
Definition lsm6dsl.h:519
lsm6dsl_acc_fs_t
LSM6DSL accelerometer subsystem full scale.
Definition lsm6dsl.h:483
LSM6DSL 6-axis accelerometer/gyroscope class.
Definition lsm6dsl.h:730

LSM6DSL specific methods.

Definition at line 679 of file lsm6dsl.h.

◆ _lsm6dsl_methods

#define _lsm6dsl_methods
Value:
_base_object_methods \
_lsm6dsl_methods_alone

LSM6DSL specific methods with inherited ones.

Definition at line 688 of file lsm6dsl.h.

◆ _lsm6dsl_data

#define _lsm6dsl_data
Value:
/* Driver state.*/ \
lsm6dsl_state_t state; \
/* Current configuration data.*/ \
const LSM6DSLConfig *config; \
/* Accelerometer subsystem axes number.*/ \
size_t accaxes; \
/* Accelerometer subsystem current sensitivity.*/ \
float accsensitivity[LSM6DSL_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current bias .*/ \
float accbias[LSM6DSL_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current full scale value.*/ \
float accfullscale; \
/* Gyroscope subsystem axes number.*/ \
size_t gyroaxes; \
/* Gyroscope subsystem current sensitivity.*/ \
float gyrosensitivity[LSM6DSL_GYRO_NUMBER_OF_AXES]; \
/* Gyroscope subsystem current Bias.*/ \
float gyrobias[LSM6DSL_GYRO_NUMBER_OF_AXES]; \
/* Gyroscope subsystem current full scale value.*/ \
float gyrofullscale;
#define _base_sensor_data
BaseSensor specific data.
Definition ex_sensors.h:74
#define LSM6DSL_ACC_NUMBER_OF_AXES
LSM6DSL accelerometer subsystem characteristics.
Definition lsm6dsl.h:72
lsm6dsl_state_t
Driver state machine possible states.
Definition lsm6dsl.h:582
#define LSM6DSL_GYRO_NUMBER_OF_AXES
L3GD20 gyroscope system characteristics.
Definition lsm6dsl.h:95
LSM6DSL configuration structure.
Definition lsm6dsl.h:591

LSM6DSLDriver specific data.

Definition at line 704 of file lsm6dsl.h.

◆ lsm6dslAccelerometerGetAxesNumber

#define lsm6dslAccelerometerGetAxesNumber ( devp)
Value:
accelerometerGetAxesNumber(&((devp)->acc_if))
#define accelerometerGetAxesNumber(ip)
Accelerometer get axes number.

Return the number of axes of the BaseAccelerometer.

Parameters
[in]devppointer to LSM6DSLDriver.
Returns
the number of axes.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 754 of file lsm6dsl.h.

◆ lsm6dslAccelerometerReadRaw

#define lsm6dslAccelerometerReadRaw ( devp,
axes )
Value:
accelerometerReadRaw(&((devp)->acc_if), axes)
#define accelerometerReadRaw(ip, dp)
Accelerometer read raw data.

Retrieves raw data from the BaseAccelerometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 775 of file lsm6dsl.h.

◆ lsm6dslAccelerometerReadCooked

#define lsm6dslAccelerometerReadCooked ( devp,
axes )
Value:
accelerometerReadCooked(&((devp)->acc_if), axes)
#define accelerometerReadCooked(ip, dp)
Accelerometer read cooked data.

Retrieves cooked data from the BaseAccelerometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as milli-G.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 797 of file lsm6dsl.h.

◆ lsm6dslAccelerometerSetBias

#define lsm6dslAccelerometerSetBias ( devp,
bp )
Value:
accelerometerSetBias(&((devp)->acc_if), bp)
#define accelerometerSetBias(ip, bp)
Updates accelerometer bias data from received buffer.

Set bias values for the BaseAccelerometer.

Note
Bias must be expressed as milli-G.
The bias buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 814 of file lsm6dsl.h.

◆ lsm6dslAccelerometerResetBias

#define lsm6dslAccelerometerResetBias ( devp)
Value:
accelerometerResetBias(&((devp)->acc_if))
#define accelerometerResetBias(ip)
Reset accelerometer bias data restoring it to zero.

Reset bias values for the BaseAccelerometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LSM6DSLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 829 of file lsm6dsl.h.

◆ lsm6dslAccelerometerSetSensitivity

#define lsm6dslAccelerometerSetSensitivity ( devp,
sp )
Value:
accelerometerSetSensitivity(&((devp)->acc_if), sp)
#define accelerometerSetSensitivity(ip, sp)
Updates accelerometer sensitivity data from received buffer.

Set sensitivity values for the BaseAccelerometer.

Note
Sensitivity must be expressed as milli-G/LSB.
The sensitivity buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 846 of file lsm6dsl.h.

◆ lsm6dslAccelerometerResetSensitivity

#define lsm6dslAccelerometerResetSensitivity ( devp)
Value:
accelerometerResetSensitivity(&((devp)->acc_if))
#define accelerometerResetSensitivity(ip)
Reset accelerometer sensitivity data restoring it to its typical value.

Reset sensitivity values for the BaseAccelerometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LSM6DSLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 861 of file lsm6dsl.h.

◆ lsm6dslAccelerometerSetFullScale

#define lsm6dslAccelerometerSetFullScale ( devp,
fs )
Value:
(devp)->vmt->acc_set_full_scale(devp, fs)
static const struct EFlashDriverVMT vmt
Definition hal_efl.c:71

Changes the LSM6DSLDriver accelerometer fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM6DSLDriver.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 879 of file lsm6dsl.h.

◆ lsm6dslGyroscopeGetAxesNumber

#define lsm6dslGyroscopeGetAxesNumber ( devp)
Value:
gyroscopeGetAxesNumber(&((devp)->gyro_if))
#define gyroscopeGetAxesNumber(ip)
Gyroscope get axes number.

Return the number of axes of the BaseGyroscope.

Parameters
[in]devppointer to LSM6DSLDriver.
Returns
the number of axes.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 891 of file lsm6dsl.h.

◆ lsm6dslGyroscopeReadRaw

#define lsm6dslGyroscopeReadRaw ( devp,
axes )
Value:
gyroscopeReadRaw(&((devp)->gyro_if), axes)
#define gyroscopeReadRaw(ip, dp)
Gyroscope read raw data.

Retrieves raw data from the BaseGyroscope.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 912 of file lsm6dsl.h.

◆ lsm6dslGyroscopeReadCooked

#define lsm6dslGyroscopeReadCooked ( devp,
axes )
Value:
gyroscopeReadCooked(&((devp)->gyro_if), axes)
#define gyroscopeReadCooked(ip, dp)
Gyroscope read cooked data.

Retrieves cooked data from the BaseGyroscope.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as DPS.
The axes array must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 934 of file lsm6dsl.h.

◆ lsm6dslGyroscopeSampleBias

#define lsm6dslGyroscopeSampleBias ( devp)
Value:
gyroscopeSampleBias(&((devp)->gyro_if))
#define gyroscopeSampleBias(ip)
Gyroscope bias sampling procedure.

Samples bias values for the BaseGyroscope.

Note
The LSM6DSL shall not be moved during the whole procedure.
After this function internal bias is automatically updated.
The behavior of this function depends on LSM6DSL_BIAS_ACQ_TIMES and LSM6DSL_BIAS_SETTLING_US.
Parameters
[in]devppointer to LSM6DSLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 954 of file lsm6dsl.h.

◆ lsm6dslGyroscopeSetBias

#define lsm6dslGyroscopeSetBias ( devp,
bp )
Value:
gyroscopeSetBias(&((devp)->gyro_if), bp)
#define gyroscopeSetBias(ip, bp)
Updates gyroscope bias data from received buffer.

Set bias values for the BaseGyroscope.

Note
Bias must be expressed as DPS.
The bias buffer must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 971 of file lsm6dsl.h.

◆ lsm6dslGyroscopeResetBias

#define lsm6dslGyroscopeResetBias ( devp)
Value:
gyroscopeResetBias(&((devp)->gyro_if))
#define gyroscopeResetBias(ip)
Reset gyroscope bias data restoring it to zero.

Reset bias values for the BaseGyroscope.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LSM6DSLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 986 of file lsm6dsl.h.

◆ lsm6dslGyroscopeSetSensitivity

#define lsm6dslGyroscopeSetSensitivity ( devp,
sp )
Value:
gyroscopeSetSensitivity(&((devp)->gyro_if), sp)
#define gyroscopeSetSensitivity(ip, sp)
Updates gyroscope sensitivity data from received buffer.

Set sensitivity values for the BaseGyroscope.

Note
Sensitivity must be expressed as DPS/LSB.
The sensitivity buffer must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]devppointer to LSM6DSLDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1003 of file lsm6dsl.h.

◆ lsm6dslGyroscopeResetSensitivity

#define lsm6dslGyroscopeResetSensitivity ( devp)
Value:
gyroscopeResetSensitivity(&((devp)->gyro_if))
#define gyroscopeResetSensitivity(ip)
Reset gyroscope sensitivity data restoring it to its typical value.

Reset sensitivity values for the BaseGyroscope.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LSM6DSLDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1018 of file lsm6dsl.h.

◆ lsm6dslGyroscopeSetFullScale

#define lsm6dslGyroscopeSetFullScale ( devp,
fs )
Value:
(devp)->vmt->acc_set_full_scale(devp, fs)

Changes the LSM6DSLDriver gyroscope fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM6DSLDriver.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1036 of file lsm6dsl.h.

Typedef Documentation

◆ LSM6DSLDriver

typedef struct LSM6DSLDriver LSM6DSLDriver

Structure representing a LSM6DSL driver.

Definition at line 470 of file lsm6dsl.h.

Enumeration Type Documentation

◆ lsm6dsl_sad_t

Accelerometer and Gyroscope Slave Address.

Enumerator
LSM6DSL_SAD_GND 

SAD pin connected to GND.

LSM6DSL_SAD_VCC 

SAD pin connected to VCC.

Definition at line 475 of file lsm6dsl.h.

◆ lsm6dsl_acc_fs_t

LSM6DSL accelerometer subsystem full scale.

Enumerator
LSM6DSL_ACC_FS_2G 

Full scale �2g.

LSM6DSL_ACC_FS_4G 

Full scale �4g.

LSM6DSL_ACC_FS_8G 

Full scale �8g.

LSM6DSL_ACC_FS_16G 

Full scale �16g.

Definition at line 483 of file lsm6dsl.h.

◆ lsm6dsl_acc_odr_t

LSM6DSL accelerometer subsystem output data rate.

Enumerator
LSM6DSL_ACC_ODR_PD 

Power down

LSM6DSL_ACC_ODR_1P6HZ 

ODR 1.6 Hz (Low Power only)

LSM6DSL_ACC_ODR_12P5HZ 

ODR 12.5 Hz

LSM6DSL_ACC_ODR_26HZ 

ODR 26 Hz

LSM6DSL_ACC_ODR_52HZ 

ODR 52 Hz

LSM6DSL_ACC_ODR_104HZ 

ODR 104 Hz

LSM6DSL_ACC_ODR_208HZ 

ODR 208 Hz

LSM6DSL_ACC_ODR_416HZ 

ODR 416 Hz

LSM6DSL_ACC_ODR_833HZ 

ODR 833 Hz

LSM6DSL_ACC_ODR_1P66HZ 

ODR 1.66 kHz

LSM6DSL_ACC_ODR_3P33HZ 

ODR 3.33 kHz

LSM6DSL_ACC_ODR_6P66HZ 

ODR 6.66 kHz

Definition at line 493 of file lsm6dsl.h.

◆ lsm6dsl_acc_lp_t

LSM6DSL accelerometer subsystem output data rate.

Enumerator
LSM6DSL_ACC_LP_DISABLED 

Low power disabled

LSM6DSL_ACC_LP_ENABLED 

Low power enabled

Definition at line 511 of file lsm6dsl.h.

◆ lsm6dsl_gyro_fs_t

LSM6DSL gyroscope subsystem full scale.

Enumerator
LSM6DSL_GYRO_FS_125DPS 

Full scale �125 degree per second

LSM6DSL_GYRO_FS_250DPS 

Full scale �250 degree per second

LSM6DSL_GYRO_FS_500DPS 

Full scale �500 degree per second

LSM6DSL_GYRO_FS_1000DPS 

Full scale �1000 degree per second

LSM6DSL_GYRO_FS_2000DPS 

Full scale �2000 degree per second

Definition at line 519 of file lsm6dsl.h.

◆ lsm6dsl_gyro_odr_t

LSM6DSL gyroscope subsystem output data rate.

Enumerator
LSM6DSL_GYRO_ODR_PD 

Power down

LSM6DSL_GYRO_ODR_12P5HZ 

ODR 12.5 HZ

LSM6DSL_GYRO_ODR_26HZ 

ODR 26 Hz

LSM6DSL_GYRO_ODR_52HZ 

ODR 52 Hz

LSM6DSL_GYRO_ODR_104HZ 

ODR 104 Hz

LSM6DSL_GYRO_ODR_208HZ 

ODR 208 Hz

LSM6DSL_GYRO_ODR_416HZ 

ODR 416 Hz

LSM6DSL_GYRO_ODR_833HZ 

ODR 833 Hz

LSM6DSL_GYRO_ODR_1P66KHZ 

ODR 1.66 kHz

LSM6DSL_GYRO_ODR_3P33KHZ 

ODR 3.33 kHz

LSM6DSL_GYRO_ODR_6P66KHZ 

ODR 6.66 kHz

Definition at line 530 of file lsm6dsl.h.

◆ lsm6dsl_gyro_lp_t

LSM6DSL gyroscope subsystem low mode configuration.

Enumerator
LSM6DSL_GYRO_LP_DISABLED 

Low power mode disabled.

LSM6DSL_GYRO_LP_ENABLED 

Low power mode enabled.

Definition at line 547 of file lsm6dsl.h.

◆ lsm6dsl_gyro_lpf_t

LSM6DSL gyroscope subsystem output selection.

Enumerator
LSM6DSL_GYRO_LPF_DISABLED 

Low pass filter disabled.

LSM6DSL_GYRO_LPF_FTYPE0 

Refer to table 68 of Datasheet.

LSM6DSL_GYRO_LPF_FTYPE1 

Refer to table 68 of Datasheet.

LSM6DSL_GYRO_LPF_FTYPE2 

Refer to table 68 of Datasheet.

LSM6DSL_GYRO_LPF_FTYPE3 

Refer to table 68 of Datasheet.

Definition at line 555 of file lsm6dsl.h.

◆ lsm6dsl_bdu_t

LSM6DSL block data update.

Enumerator
LSM6DSL_BDU_CONTINUOUS 

Block data continuously updated.

LSM6DSL_BDU_BLOCKED 

Block data updated after reading.

Definition at line 566 of file lsm6dsl.h.

◆ lsm6dsl_end_t

LSM6DSL endianness.

Enumerator
LSM6DSL_END_LITTLE 

Little endian.

LSM6DSL_END_BIG 

Big endian.

Definition at line 574 of file lsm6dsl.h.

◆ lsm6dsl_state_t

Driver state machine possible states.

Enumerator
LSM6DSL_UNINIT 

Not initialized.

LSM6DSL_STOP 

Stopped.

LSM6DSL_READY 

Ready.

Definition at line 582 of file lsm6dsl.h.

Function Documentation

◆ lsm6dslI2CReadRegister()

msg_t lsm6dslI2CReadRegister ( I2CDriver * i2cp,
lsm6dsl_sad_t sad,
uint8_t reg,
uint8_t * rxbuf,
size_t n )

Reads registers value using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Note
IF_ADD_INC bit must be 1 in CTRL_REG8
Parameters
[in]i2cppointer to the I2C interface
[in]sadslave address without R bit
[in]regfirst sub-register address
[out]rxbufpointer to an output buffer
[in]nnumber of consecutive register to read
Returns
the operation status.
Function Class:
Not an API, this function is for internal use only.

Definition at line 63 of file lsm6dsl.c.

References i2cMasterTransmitTimeout(), and TIME_INFINITE.

Referenced by acc_read_raw(), acc_set_full_scale(), gyro_read_raw(), and gyro_set_full_scale().

Here is the call graph for this function:

◆ acc_get_axes_number()

size_t acc_get_axes_number ( void * ip)
static

Return the number of axes of the BaseAccelerometer.

Parameters
[in]ippointer to BaseAccelerometer interface.
Returns
the number of axes.

Definition at line 95 of file lsm6dsl.c.

References LSM6DSL_ACC_NUMBER_OF_AXES.

◆ acc_read_raw()

msg_t acc_read_raw ( void * ip,
int32_t axes[] )
static

Retrieves raw data from the BaseAccelerometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 117 of file lsm6dsl.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_AD_OUTX_L_XL, LSM6DSL_READY, lsm6dslI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by acc_read_cooked().

Here is the call graph for this function:

◆ acc_read_cooked()

msg_t acc_read_cooked ( void * ip,
float axes[] )
static

Retrieves cooked data from the BaseAccelerometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as milli-G.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 173 of file lsm6dsl.c.

References acc_read_raw(), LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ acc_set_bias()

msg_t acc_set_bias ( void * ip,
float * bp )
static

Set bias values for the BaseAccelerometer.

Note
Bias must be expressed as milli-G.
The bias buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 206 of file lsm6dsl.c.

References LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_reset_bias()

msg_t acc_reset_bias ( void * ip)
static

Reset bias values for the BaseAccelerometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseAccelerometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 235 of file lsm6dsl.c.

References LSM6DSL_ACC_BIAS, LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_sensivity()

msg_t acc_set_sensivity ( void * ip,
float * sp )
static

Set sensitivity values for the BaseAccelerometer.

Note
Sensitivity must be expressed as milli-G/LSB.
The sensitivity buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 265 of file lsm6dsl.c.

References LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_reset_sensivity()

msg_t acc_reset_sensivity ( void * ip)
static

Reset sensitivity values for the BaseAccelerometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]ippointer to BaseAccelerometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 294 of file lsm6dsl.c.

References FALSE, LSM6DSL_ACC_FS_16G, LSM6DSL_ACC_FS_2G, LSM6DSL_ACC_FS_4G, LSM6DSL_ACC_FS_8G, LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_ACC_SENS_16G, LSM6DSL_ACC_SENS_2G, LSM6DSL_ACC_SENS_4G, LSM6DSL_ACC_SENS_8G, LSM6DSL_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_full_scale()

msg_t acc_set_full_scale ( LSM6DSLDriver * devp,
lsm6dsl_acc_fs_t fs )
static

Changes the LSM6DSLDriver accelerometer fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM6DSLDriver interface.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 339 of file lsm6dsl.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DSL_ACC_16G, LSM6DSL_ACC_2G, LSM6DSL_ACC_4G, LSM6DSL_ACC_8G, LSM6DSL_ACC_FS_16G, LSM6DSL_ACC_FS_2G, LSM6DSL_ACC_FS_4G, LSM6DSL_ACC_FS_8G, LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_AD_CTRL1_XL, LSM6DSL_READY, lsm6dslI2CReadRegister(), lsm6dslI2CWriteRegister, LSMDSL_CTRL1_XL_FS_MASK, MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ gyro_get_axes_number()

size_t gyro_get_axes_number ( void * ip)
static

Return the number of axes of the BaseGyroscope.

Parameters
[in]ippointer to BaseGyroscope interface.
Returns
the number of axes.

Definition at line 430 of file lsm6dsl.c.

References LSM6DSL_GYRO_NUMBER_OF_AXES.

◆ gyro_read_raw()

msg_t gyro_read_raw ( void * ip,
int32_t axes[LSM6DSL_GYRO_NUMBER_OF_AXES] )
static

Retrieves raw data from the BaseGyroscope.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]ippointer to BaseGyroscope interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 452 of file lsm6dsl.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DSL_AD_OUTX_L_G, LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, lsm6dslI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by gyro_read_cooked(), and gyro_sample_bias().

Here is the call graph for this function:

◆ gyro_read_cooked()

msg_t gyro_read_cooked ( void * ip,
float axes[] )
static

Retrieves cooked data from the BaseGyroscope.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as DPS.
The axes array must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]ippointer to BaseGyroscope interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 508 of file lsm6dsl.c.

References gyro_read_raw(), LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ gyro_sample_bias()

msg_t gyro_sample_bias ( void * ip)
static

Samples bias values for the BaseGyroscope.

Note
The LSM6DSL shall not be moved during the whole procedure.
After this function internal bias is automatically updated.
The behavior of this function depends on LSM6DSL_BIAS_ACQ_TIMES and LSM6DSL_BIAS_SETTLING_US.
Parameters
[in]ippointer to BaseGyroscope interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 541 of file lsm6dsl.c.

References gyro_read_raw(), I2C_READY, LSM6DSL_GYRO_BIAS_ACQ_TIMES, LSM6DSL_GYRO_BIAS_SETTLING_US, LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, osalDbgCheck, and osalThreadSleepMicroseconds.

Here is the call graph for this function:

◆ gyro_set_bias()

msg_t gyro_set_bias ( void * ip,
float * bp )
static

Set bias values for the BaseGyroscope.

Note
Bias must be expressed as DPS.
The bias buffer must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]ippointer to BaseGyroscope interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 589 of file lsm6dsl.c.

References LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ gyro_reset_bias()

msg_t gyro_reset_bias ( void * ip)
static

Reset bias values for the BaseGyroscope.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseGyroscope interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 618 of file lsm6dsl.c.

References LSM6DSL_GYRO_BIAS, LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ gyro_set_sensivity()

msg_t gyro_set_sensivity ( void * ip,
float * sp )
static

Set sensitivity values for the BaseGyroscope.

Note
Sensitivity must be expressed as DPS/LSB.
The sensitivity buffer must be at least the same size of the BaseGyroscope axes number.
Parameters
[in]ippointer to BaseGyroscope interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 648 of file lsm6dsl.c.

References LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ gyro_reset_sensivity()

msg_t gyro_reset_sensivity ( void * ip)
static

Reset sensitivity values for the BaseGyroscope.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]ippointer to BaseGyroscope interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 677 of file lsm6dsl.c.

References FALSE, LSM6DSL_GYRO_FS_1000DPS, LSM6DSL_GYRO_FS_125DPS, LSM6DSL_GYRO_FS_2000DPS, LSM6DSL_GYRO_FS_250DPS, LSM6DSL_GYRO_FS_500DPS, LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_GYRO_SENS_1000DPS, LSM6DSL_GYRO_SENS_125DPS, LSM6DSL_GYRO_SENS_2000DPS, LSM6DSL_GYRO_SENS_250DPS, LSM6DSL_GYRO_SENS_500DPS, LSM6DSL_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ gyro_set_full_scale()

msg_t gyro_set_full_scale ( LSM6DSLDriver * devp,
lsm6dsl_gyro_fs_t fs )
static

Changes the LSM6DSLDriver gyroscope fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to BaseGyroscope interface.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 724 of file lsm6dsl.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DSL_AD_CTRL2_G, LSM6DSL_GYRO_1000DPS, LSM6DSL_GYRO_125DPS, LSM6DSL_GYRO_2000DPS, LSM6DSL_GYRO_250DPS, LSM6DSL_GYRO_500DPS, LSM6DSL_GYRO_FS_1000DPS, LSM6DSL_GYRO_FS_125DPS, LSM6DSL_GYRO_FS_2000DPS, LSM6DSL_GYRO_FS_250DPS, LSM6DSL_GYRO_FS_500DPS, LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_READY, lsm6dslI2CReadRegister(), lsm6dslI2CWriteRegister, LSMDSL_CTRL2_G_FS_MASK, MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ lsm6dslObjectInit()

void lsm6dslObjectInit ( LSM6DSLDriver * devp)

Initializes an instance.

Parameters
[out]devppointer to the LSM6DSLDriver object
Function Class:
Object or module nitializer function.

Definition at line 835 of file lsm6dsl.c.

References LSM6DSLDriver::acc_if, LSM6DSLDriver::gyro_if, LSM6DSL_ACC_NUMBER_OF_AXES, LSM6DSL_GYRO_NUMBER_OF_AXES, LSM6DSL_STOP, BaseAccelerometer::vmt, BaseGyroscope::vmt, LSM6DSLDriver::vmt, vmt_accelerometer, vmt_device, and vmt_gyroscope.

◆ lsm6dslStart()

◆ lsm6dslStop()

void lsm6dslStop ( LSM6DSLDriver * devp)

Deactivates the LSM6DSL Complex Driver peripheral.

Parameters
[in]devppointer to the LSM6DSLDriver object
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1090 of file lsm6dsl.c.

References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LSM6DSL_ACC_ODR_PD, LSM6DSL_AD_CTRL1_XL, LSM6DSL_GYRO_ODR_PD, LSM6DSL_READY, LSM6DSL_STOP, lsm6dslI2CWriteRegister, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

const struct LSM6DSLVMT vmt_device
static
Initial value:

Definition at line 806 of file lsm6dsl.c.

◆ vmt_accelerometer

const struct BaseAccelerometerVMT vmt_accelerometer
static
Initial value:
= {
sizeof(struct LSM6DSLVMT*),
}
static size_t acc_get_axes_number(void *ip)
Return the number of axes of the BaseAccelerometer.
Definition adxl317.c:115
static msg_t acc_reset_sensivity(void *ip)
Reset sensitivity values for the BaseAccelerometer.
Definition adxl317.c:310
static msg_t acc_set_bias(void *ip, float *bp)
Set bias values for the BaseAccelerometer.
Definition adxl317.c:222
static msg_t acc_reset_bias(void *ip)
Reset bias values for the BaseAccelerometer.
Definition adxl317.c:251
static msg_t acc_set_sensivity(void *ip, float *sp)
Set sensitivity values for the BaseAccelerometer.
Definition adxl317.c:281
static msg_t acc_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseAccelerometer.
Definition adxl317.c:185
static msg_t acc_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseAccelerometer.
Definition adxl317.c:137
LSM6DSL virtual methods table.
Definition lsm6dsl.h:697

Definition at line 811 of file lsm6dsl.c.

◆ vmt_gyroscope

const struct BaseGyroscopeVMT vmt_gyroscope
static
Initial value:
= {
sizeof(struct LSM6DSLVMT*) + sizeof(BaseAccelerometer),
}
static msg_t gyro_set_sensivity(void *ip, float *sp)
Set sensitivity values for the BaseGyroscope.
Definition l3gd20.c:307
static size_t gyro_get_axes_number(void *ip)
Return the number of axes of the BaseGyroscope.
Definition l3gd20.c:96
static msg_t gyro_read_raw(void *ip, int32_t axes[L3GD20_GYRO_NUMBER_OF_AXES])
Retrieves raw data from the BaseGyroscope.
Definition l3gd20.c:115
static msg_t gyro_sample_bias(void *ip)
Samples bias values for the BaseGyroscope.
Definition l3gd20.c:200
static msg_t gyro_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseGyroscope.
Definition l3gd20.c:167
static msg_t gyro_set_bias(void *ip, float *bp)
Set bias values for the BaseGyroscope.
Definition l3gd20.c:248
static msg_t gyro_reset_sensivity(void *ip)
Reset sensitivity values for the BaseGyroscope.
Definition l3gd20.c:336
static msg_t gyro_reset_bias(void *ip)
Reset bias values for the BaseGyroscope.
Definition l3gd20.c:277
Base accelerometer class.

Definition at line 817 of file lsm6dsl.c.