ChibiOS 21.11.4
|
Version identification | |
#define | EX_LSM6DS0_VERSION "1.1.3" |
LSM6DS0 driver version string. | |
#define | EX_LSM6DS0_MAJOR 1 |
LSM6DS0 driver version major number. | |
#define | EX_LSM6DS0_MINOR 1 |
LSM6DS0 driver version minor number. | |
#define | EX_LSM6DS0_PATCH 3 |
LSM6DS0 driver version patch number. | |
#define | LSM6DS0_ACC_NUMBER_OF_AXES 3U |
LSM6DS0 accelerometer subsystem characteristics. | |
#define | LSM6DS0_ACC_2G 2.0f |
#define | LSM6DS0_ACC_4G 4.0f |
#define | LSM6DS0_ACC_8G 8.0f |
#define | LSM6DS0_ACC_16G 16.0f |
#define | LSM6DS0_ACC_SENS_2G 0.061f |
#define | LSM6DS0_ACC_SENS_4G 0.122f |
#define | LSM6DS0_ACC_SENS_8G 0.244f |
#define | LSM6DS0_ACC_SENS_16G 0.732f |
#define | LSM6DS0_ACC_BIAS 0.0f |
#define | LSM6DS0_GYRO_NUMBER_OF_AXES 3U |
L3GD20 gyroscope system characteristics. | |
#define | LSM6DS0_GYRO_245DPS 245.0f |
#define | LSM6DS0_GYRO_500DPS 500.0f |
#define | LSM6DS0_GYRO_2000DPS 2000.0f |
#define | LSM6DS0_GYRO_SENS_245DPS 0.00875f |
#define | LSM6DS0_GYRO_SENS_500DPS 0.01750f |
#define | LSM6DS0_GYRO_SENS_2000DPS 0.07000f |
#define | LSM6DS0_GYRO_BIAS 0.0f |
LSM6DS0 communication interfaces related bit masks | |
#define | LSM6DS0_DI_MASK 0xFF |
#define | LSM6DS0_DI(n) |
#define | LSM6DS0_AD_MASK 0x7F |
#define | LSM6DS0_AD(n) |
#define | LSM6DS0_MS (1 << 7) |
LSM6DS0_AD_CTRL_REG1_G register bits definitions | |
#define | LSM6DS0_CTRL_REG1_G 0xFA |
#define | LSM6DS0_CTRL_REG1_G_BW_G0 (1 << 0) |
#define | LSM6DS0_CTRL_REG1_G_BW_G1 (1 << 1) |
#define | LSM6DS0_CTRL_REG1_G_FS_MASK 0x1F |
#define | LSM6DS0_CTRL_REG1_G_FS_G0 (1 << 3) |
#define | LSM6DS0_CTRL_REG1_G_FS_G1 (1 << 4) |
#define | LSM6DS0_CTRL_REG1_G_ODR_G0 (1 << 5) |
#define | LSM6DS0_CTRL_REG1_G_ODR_G1 (1 << 6) |
#define | LSM6DS0_CTRL_REG1_G_ODR_G2 (1 << 7) |
LSM6DS0_AD_CTRL_REG2_G register bits definitions | |
#define | LSM6DS0_CTRL_REG2_G 0x0F |
#define | LSM6DS0_CTRL_REG2_G_OUT_SEL0 (1 << 0) |
#define | LSM6DS0_CTRL_REG2_G_OUT_SEL1 (1 << 1) |
#define | LSM6DS0_CTRL_REG2_G_INT_SEL0 (1 << 2) |
#define | LSM6DS0_CTRL_REG2_G_INT_SEL1 (1 << 3) |
LSM6DS0_AD_CTRL_REG3_G register bits definitions | |
#define | LSM6DS0_CTRL_REG3_G 0x64 |
#define | LSM6DS0_CTRL_REG3_G_HP_CF0_G (1 << 0) |
#define | LSM6DS0_CTRL_REG3_G_HP_CF1_G (1 << 1) |
#define | LSM6DS0_CTRL_REG3_G_HP_CF2_G (1 << 2) |
#define | LSM6DS0_CTRL_REG3_G_HP_CF3_G (1 << 3) |
#define | LSM6DS0_CTRL_REG3_G_HP_EN (1 << 6) |
#define | LSM6DS0_CTRL_REG3_G_LP_MODE (1 << 7) |
LSM6DS0_AD_CTRL_REG4 register bits definitions | |
#define | LSM6DS0_CTRL_REG4 0x3A |
#define | LSM6DS0_CTRL_REG4_4D_XL1 (1 << 0) |
#define | LSM6DS0_CTRL_REG4_LIR_XL1 (1 << 1) |
#define | LSM6DS0_CTRL_REG4_XEN_G (1 << 3) |
#define | LSM6DS0_CTRL_REG4_YEN_G (1 << 4) |
#define | LSM6DS0_CTRL_REG4_ZEN_G (1 << 5) |
LSM6DS0_AD_CTRL_REG5_XL register bits definitions | |
#define | LSM6DS0_CTRL_REG5_XL 0xF8 |
#define | LSM6DS0_CTRL_REG5_XL_XEN_XL (1 << 3) |
#define | LSM6DS0_CTRL_REG5_XL_YEN_XL (1 << 4) |
#define | LSM6DS0_CTRL_REG5_XL_ZEN_XL (1 << 5) |
#define | LSM6DS0_CTRL_REG5_XL_DEC0 (1 << 6) |
#define | LSM6DS0_CTRL_REG5_XL_DEC1 (1 << 7) |
LSM6DS0_AD_CTRL_REG6_XL register bits definitions | |
#define | LSM6DS0_CTRL_REG6_XL 0xFF |
#define | LSM6DS0_CTRL_REG6_XL_BW_XL0 (1 << 0) |
#define | LSM6DS0_CTRL_REG6_XL_BW_XL1 (1 << 1) |
#define | LSM6DS0_CTRL_REG6_XL_BW_SCAL_ODR (1 << 2) |
#define | LSM6DS0_CTRL_REG6_XL_FS_MASK 0x1F |
#define | LSM6DS0_CTRL_REG6_XL_FS0_XL (1 << 3) |
#define | LSM6DS0_CTRL_REG6_XL_FS1_XL (1 << 4) |
#define | LSM6DS0_CTRL_REG6_XL_ODR_XL0 (1 << 5) |
#define | LSM6DS0_CTRL_REG6_XL_ODR_XL1 (1 << 6) |
#define | LSM6DS0_CTRL_REG6_XL_ODR_XL2 (1 << 7) |
LSM6DS0_AD_CTRL_REG7_XL register bits definitions | |
#define | LSM6DS0_CTRL_REG7_XL 0xE5 |
#define | LSM6DS0_CTRL_REG7_XL_HPIS1 (1 << 0) |
#define | LSM6DS0_CTRL_REG7_XL_FDS (1 << 2) |
#define | LSM6DS0_CTRL_REG7_XL_DCF0 (1 << 5) |
#define | LSM6DS0_CTRL_REG7_XL_DCF1 (1 << 6) |
#define | LSM6DS0_CTRL_REG7_XL_HR (1 << 7) |
LSM6DS0_AD_CTRL_REG8 register bits definitions | |
#define | LSM6DS0_CTRL_REG8 0xFF |
#define | LSM6DS0_CTRL_REG8_SW_RESET (1 << 0) |
#define | LSM6DS0_CTRL_REG8_BLE (1 << 1) |
#define | LSM6DS0_CTRL_REG8_IF_ADD_INC (1 << 2) |
#define | LSM6DS0_CTRL_REG8_SIM (1 << 3) |
#define | LSM6DS0_CTRL_REG8_PP_OD (1 << 4) |
#define | LSM6DS0_CTRL_REG8_H_LACTIVE (1 << 5) |
#define | LSM6DS0_CTRL_REG8_BDU (1 << 6) |
#define | LSM6DS0_CTRL_REG8_BOOT (1 << 7) |
LSM6DS0_AD_CTRL_REG9 register bits definitions | |
#define | LSM6DS0_CTRL_REG9 0x5F |
#define | LSM6DS0_CTRL_REG9_STOP_ON_FTH (1 << 0) |
#define | LSM6DS0_CTRL_REG9_FIFO_EN (1 << 1) |
#define | LSM6DS0_CTRL_REG9_I2C_DISABLE (1 << 2) |
#define | LSM6DS0_CTRL_REG9_DRDY_MASK_BIT (1 << 3) |
#define | LSM6DS0_CTRL_REG9_FIFO_TEMP_EN (1 << 4) |
#define | LSM6DS0_CTRL_REG9_SLEEP_G (1 << 6) |
LSM6DS0_AD_CTRL_REG10 register bits definitions | |
#define | LSM6DS0_CTRL_REG10 0x05 |
#define | LSM6DS0_CTRL_REG10_ST_XL (1 << 0) |
#define | LSM6DS0_CTRL_REG10_ST_G (1 << 2) |
Configuration options | |
#define | LSM6DS0_USE_SPI FALSE |
LSM6DS0 SPI interface switch. | |
#define | LSM6DS0_SHARED_SPI FALSE |
LSM6DS0 shared SPI switch. | |
#define | LSM6DS0_USE_I2C TRUE |
LSM6DS0 I2C interface switch. | |
#define | LSM6DS0_SHARED_I2C FALSE |
LSM6DS0 shared I2C switch. | |
#define | LSM6DS0_USE_ADVANCED FALSE |
LSM6DS0 advanced configurations switch. | |
#define | LSM6DS0_GYRO_BIAS_ACQ_TIMES 50 |
Number of acquisitions for gyroscope bias removal. | |
#define | LSM6DS0_GYRO_BIAS_SETTLING_US 5000 |
Settling time for gyroscope bias removal. |
Data Structures | |
struct | LSM6DS0Config |
LSM6DS0 configuration structure. More... | |
struct | LSM6DS0VMT |
LSM6DS0 virtual methods table. More... | |
struct | LSM6DS0Driver |
LSM6DS0 6-axis accelerometer/gyroscope class. More... |
Macros | |
#define | lsm6ds0I2CWriteRegister(i2cp, sad, txbuf, n) |
Writes a value into a register using I2C. | |
#define | lsm6ds0AccelerometerGetAxesNumber(devp) |
Return the number of axes of the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerReadRaw(devp, axes) |
Retrieves raw data from the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerReadCooked(devp, axes) |
Retrieves cooked data from the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerSetBias(devp, bp) |
Set bias values for the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerResetBias(devp) |
Reset bias values for the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerSetSensitivity(devp, sp) |
Set sensitivity values for the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerResetSensitivity(devp) |
Reset sensitivity values for the BaseAccelerometer. | |
#define | lsm6ds0AccelerometerSetFullScale(devp, fs) |
Changes the LSM6DS0Driver accelerometer fullscale value. | |
#define | lsm6ds0GyroscopeGetAxesNumber(devp) |
Return the number of axes of the BaseGyroscope. | |
#define | lsm6ds0GyroscopeReadRaw(devp, axes) |
Retrieves raw data from the BaseGyroscope. | |
#define | lsm6ds0GyroscopeReadCooked(devp, axes) |
Retrieves cooked data from the BaseGyroscope. | |
#define | lsm6ds0GyroscopeSampleBias(devp) |
Samples bias values for the BaseGyroscope. | |
#define | lsm6ds0GyroscopeSetBias(devp, bp) |
Set bias values for the BaseGyroscope. | |
#define | lsm6ds0GyroscopeResetBias(devp) |
Reset bias values for the BaseGyroscope. | |
#define | lsm6ds0GyroscopeSetSensitivity(devp, sp) |
Set sensitivity values for the BaseGyroscope. | |
#define | lsm6ds0GyroscopeResetSensitivity(devp) |
Reset sensitivity values for the BaseGyroscope. | |
#define | lsm6ds0GyroscopeSetFullScale(devp, fs) |
Changes the LSM6DS0Driver gyroscope fullscale value. |
Functions | |
msg_t | lsm6ds0I2CReadRegister (I2CDriver *i2cp, lsm6ds0_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 (LSM6DS0Driver *devp, lsm6ds0_acc_fs_t fs) |
Changes the LSM6DS0Driver 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[LSM6DS0_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 (LSM6DS0Driver *devp, lsm6ds0_gyro_fs_t fs) |
Changes the LSM6DS0Driver gyroscope fullscale value. | |
void | lsm6ds0ObjectInit (LSM6DS0Driver *devp) |
Initializes an instance. | |
void | lsm6ds0Start (LSM6DS0Driver *devp, const LSM6DS0Config *config) |
Configures and activates LSM6DS0 Complex Driver peripheral. | |
void | lsm6ds0Stop (LSM6DS0Driver *devp) |
Deactivates the LSM6DS0 Complex Driver peripheral. |
Variables | |
static const struct LSM6DS0VMT | vmt_device |
static const struct BaseAccelerometerVMT | vmt_accelerometer |
static const struct BaseGyroscopeVMT | vmt_gyroscope |
#define lsm6ds0I2CWriteRegister | ( | i2cp, | |
sad, | |||
txbuf, | |||
n ) |
Writes a value into a register using I2C.
[in] | i2cp | pointer to the I2C interface |
[in] | sad | slave address without R bit |
[in] | txbuf | buffer containing sub-address value in first position and values to write |
[in] | n | size of txbuf less one (not considering the first element) |
Definition at line 83 of file lsm6ds0.c.
Referenced by acc_set_full_scale(), gyro_set_full_scale(), lsm6ds0Start(), and lsm6ds0Stop().
#define EX_LSM6DS0_VERSION "1.1.3" |
#define EX_LSM6DS0_MAJOR 1 |
#define EX_LSM6DS0_MINOR 1 |
#define EX_LSM6DS0_PATCH 3 |
#define LSM6DS0_ACC_NUMBER_OF_AXES 3U |
LSM6DS0 accelerometer subsystem characteristics.
Definition at line 72 of file lsm6ds0.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(), lsm6ds0ObjectInit(), and lsm6ds0Start().
#define LSM6DS0_ACC_2G 2.0f |
Definition at line 74 of file lsm6ds0.h.
Referenced by acc_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_ACC_4G 4.0f |
Definition at line 75 of file lsm6ds0.h.
Referenced by acc_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_ACC_8G 8.0f |
Definition at line 76 of file lsm6ds0.h.
Referenced by acc_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_ACC_16G 16.0f |
Definition at line 77 of file lsm6ds0.h.
Referenced by acc_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_ACC_SENS_2G 0.061f |
Definition at line 79 of file lsm6ds0.h.
Referenced by acc_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_ACC_SENS_4G 0.122f |
Definition at line 80 of file lsm6ds0.h.
Referenced by acc_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_ACC_SENS_8G 0.244f |
Definition at line 81 of file lsm6ds0.h.
Referenced by acc_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_ACC_SENS_16G 0.732f |
Definition at line 82 of file lsm6ds0.h.
Referenced by acc_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_ACC_BIAS 0.0f |
Definition at line 84 of file lsm6ds0.h.
Referenced by acc_reset_bias(), and lsm6ds0Start().
#define LSM6DS0_GYRO_NUMBER_OF_AXES 3U |
L3GD20 gyroscope system characteristics.
Definition at line 95 of file lsm6ds0.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(), lsm6ds0ObjectInit(), and lsm6ds0Start().
#define LSM6DS0_GYRO_245DPS 245.0f |
Definition at line 97 of file lsm6ds0.h.
Referenced by gyro_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_GYRO_500DPS 500.0f |
Definition at line 98 of file lsm6ds0.h.
Referenced by gyro_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_GYRO_2000DPS 2000.0f |
Definition at line 99 of file lsm6ds0.h.
Referenced by gyro_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_GYRO_SENS_245DPS 0.00875f |
Definition at line 101 of file lsm6ds0.h.
Referenced by gyro_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_GYRO_SENS_500DPS 0.01750f |
Definition at line 102 of file lsm6ds0.h.
Referenced by gyro_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_GYRO_SENS_2000DPS 0.07000f |
Definition at line 103 of file lsm6ds0.h.
Referenced by gyro_reset_sensivity(), and lsm6ds0Start().
#define LSM6DS0_GYRO_BIAS 0.0f |
Definition at line 105 of file lsm6ds0.h.
Referenced by gyro_reset_bias(), and lsm6ds0Start().
#define LSM6DS0_AD_CTRL_REG1_G 0x10 |
Definition at line 133 of file lsm6ds0.h.
Referenced by gyro_set_full_scale(), and lsm6ds0Start().
#define LSM6DS0_AD_OUT_X_L_G 0x18 |
Definition at line 141 of file lsm6ds0.h.
Referenced by gyro_read_raw().
#define LSM6DS0_AD_CTRL_REG5_XL 0x1F |
Definition at line 148 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_AD_CTRL_REG6_XL 0x20 |
Definition at line 149 of file lsm6ds0.h.
Referenced by acc_set_full_scale(), and lsm6ds0Stop().
#define LSM6DS0_AD_CTRL_REG8 0x22 |
Definition at line 151 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_AD_CTRL_REG9 0x23 |
Definition at line 152 of file lsm6ds0.h.
Referenced by lsm6ds0Start(), and lsm6ds0Stop().
#define LSM6DS0_AD_OUT_X_L_XL 0x28 |
Definition at line 156 of file lsm6ds0.h.
Referenced by acc_read_raw().
#define LSM6DS0_CTRL_REG1_G_FS_MASK 0x1F |
Definition at line 181 of file lsm6ds0.h.
Referenced by gyro_set_full_scale().
#define LSM6DS0_CTRL_REG4_XEN_G (1 << 3) |
Definition at line 220 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG4_YEN_G (1 << 4) |
Definition at line 221 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG4_ZEN_G (1 << 5) |
Definition at line 222 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG5_XL_XEN_XL (1 << 3) |
Definition at line 230 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG5_XL_YEN_XL (1 << 4) |
Definition at line 231 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG5_XL_ZEN_XL (1 << 5) |
Definition at line 232 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG6_XL_FS_MASK 0x1F |
Definition at line 245 of file lsm6ds0.h.
Referenced by acc_set_full_scale().
#define LSM6DS0_CTRL_REG8_IF_ADD_INC (1 << 2) |
Definition at line 272 of file lsm6ds0.h.
Referenced by lsm6ds0Start().
#define LSM6DS0_CTRL_REG9_SLEEP_G (1 << 6) |
Definition at line 290 of file lsm6ds0.h.
Referenced by lsm6ds0Stop().
#define LSM6DS0_USE_SPI FALSE |
#define LSM6DS0_SHARED_SPI FALSE |
#define LSM6DS0_USE_I2C TRUE |
#define LSM6DS0_SHARED_I2C FALSE |
#define LSM6DS0_USE_ADVANCED FALSE |
#define LSM6DS0_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 363 of file lsm6ds0.h.
Referenced by gyro_sample_bias().
#define LSM6DS0_GYRO_BIAS_SETTLING_US 5000 |
Settling time for gyroscope bias removal.
This is the time between each bias acquisition.
Definition at line 371 of file lsm6ds0.h.
Referenced by gyro_sample_bias().
#define _lsm6ds0_methods_alone |
LSM6DS0
specific methods.
#define _lsm6ds0_methods |
#define _lsm6ds0_data |
LSM6DS0Driver
specific data.
#define lsm6ds0AccelerometerGetAxesNumber | ( | devp | ) |
Return the number of axes of the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
#define lsm6ds0AccelerometerReadRaw | ( | devp, | |
axes ) |
Retrieves raw data from the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
#define lsm6ds0AccelerometerReadCooked | ( | devp, | |
axes ) |
Retrieves cooked data from the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
#define lsm6ds0AccelerometerSetBias | ( | devp, | |
bp ) |
Set bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
#define lsm6ds0AccelerometerResetBias | ( | devp | ) |
Reset bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
#define lsm6ds0AccelerometerSetSensitivity | ( | devp, | |
sp ) |
Set sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
#define lsm6ds0AccelerometerResetSensitivity | ( | devp | ) |
Reset sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
#define lsm6ds0AccelerometerSetFullScale | ( | devp, | |
fs ) |
Changes the LSM6DS0Driver accelerometer fullscale value.
[in] | devp | pointer to LSM6DS0Driver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
#define lsm6ds0GyroscopeGetAxesNumber | ( | devp | ) |
Return the number of axes of the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
#define lsm6ds0GyroscopeReadRaw | ( | devp, | |
axes ) |
Retrieves raw data from the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
#define lsm6ds0GyroscopeReadCooked | ( | devp, | |
axes ) |
Retrieves cooked data from the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
#define lsm6ds0GyroscopeSampleBias | ( | devp | ) |
Samples bias values for the BaseGyroscope.
LSM6DS0_BIAS_ACQ_TIMES
and LSM6DS0_BIAS_SETTLING_US
.[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
#define lsm6ds0GyroscopeSetBias | ( | devp, | |
bp ) |
Set bias values for the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
#define lsm6ds0GyroscopeResetBias | ( | devp | ) |
Reset bias values for the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
#define lsm6ds0GyroscopeSetSensitivity | ( | devp, | |
sp ) |
Set sensitivity values for the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
#define lsm6ds0GyroscopeResetSensitivity | ( | devp | ) |
Reset sensitivity values for the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
#define lsm6ds0GyroscopeSetFullScale | ( | devp, | |
fs ) |
Changes the LSM6DS0Driver gyroscope fullscale value.
[in] | devp | pointer to LSM6DS0Driver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
typedef struct LSM6DS0Driver LSM6DS0Driver |
enum lsm6ds0_sad_t |
enum lsm6ds0_acc_fs_t |
enum lsm6ds0_acc_odr_t |
enum lsm6ds0_acc_dec_t |
enum lsm6ds0_gyro_fs_t |
enum lsm6ds0_gyro_odr_t |
LSM6DS0 gyroscope subsystem output data rate.
enum lsm6ds0_gyro_lp_t |
enum lsm6ds0_gyro_hp_t |
enum lsm6ds0_gyro_hpcf_t |
enum lsm6ds0_bdu_t |
enum lsm6ds0_end_t |
enum lsm6ds0_state_t |
msg_t lsm6ds0I2CReadRegister | ( | I2CDriver * | i2cp, |
lsm6ds0_sad_t | sad, | ||
uint8_t | reg, | ||
uint8_t * | rxbuf, | ||
size_t | n ) |
Reads registers value using I2C.
[in] | i2cp | pointer to the I2C interface |
[in] | sad | slave address without R bit |
[in] | reg | first sub-register address |
[out] | rxbuf | pointer to an output buffer |
[in] | n | number of consecutive register to read |
Definition at line 63 of file lsm6ds0.c.
References i2cMasterTransmitTimeout(), and TIME_INFINITE.
Referenced by acc_read_raw(), acc_set_full_scale(), gyro_read_raw(), and gyro_set_full_scale().
|
static |
Return the number of axes of the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
Definition at line 95 of file lsm6ds0.c.
References LSM6DS0_ACC_NUMBER_OF_AXES.
|
static |
Retrieves raw data from the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 117 of file lsm6ds0.c.
References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_AD_OUT_X_L_XL, LSM6DS0_READY, lsm6ds0I2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by acc_read_cooked().
|
static |
Retrieves cooked data from the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 173 of file lsm6ds0.c.
References acc_read_raw(), LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set bias values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 206 of file lsm6ds0.c.
References LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset bias values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
MSG_OK | if the function succeeded. |
Definition at line 235 of file lsm6ds0.c.
References LSM6DS0_ACC_BIAS, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set sensitivity values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 265 of file lsm6ds0.c.
References LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset sensitivity values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 294 of file lsm6ds0.c.
References FALSE, LSM6DS0_ACC_FS_16G, LSM6DS0_ACC_FS_2G, LSM6DS0_ACC_FS_4G, LSM6DS0_ACC_FS_8G, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_ACC_SENS_16G, LSM6DS0_ACC_SENS_2G, LSM6DS0_ACC_SENS_4G, LSM6DS0_ACC_SENS_8G, LSM6DS0_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Changes the LSM6DS0Driver accelerometer fullscale value.
[in] | devp | pointer to LSM6DS0Driver interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 339 of file lsm6ds0.c.
References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_ACC_16G, LSM6DS0_ACC_2G, LSM6DS0_ACC_4G, LSM6DS0_ACC_8G, LSM6DS0_ACC_FS_16G, LSM6DS0_ACC_FS_2G, LSM6DS0_ACC_FS_4G, LSM6DS0_ACC_FS_8G, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_AD_CTRL_REG6_XL, LSM6DS0_CTRL_REG6_XL_FS_MASK, LSM6DS0_READY, lsm6ds0I2CReadRegister(), lsm6ds0I2CWriteRegister, MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.
|
static |
Return the number of axes of the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
Definition at line 430 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES.
|
static |
Retrieves raw data from the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 452 of file lsm6ds0.c.
References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_AD_OUT_X_L_G, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, lsm6ds0I2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_read_cooked(), and gyro_sample_bias().
|
static |
Retrieves cooked data from the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 508 of file lsm6ds0.c.
References gyro_read_raw(), LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Samples bias values for the BaseGyroscope.
LSM6DS0_BIAS_ACQ_TIMES
and LSM6DS0_BIAS_SETTLING_US
.[in] | ip | pointer to BaseGyroscope interface. |
MSG_OK | if the function succeeded. |
Definition at line 541 of file lsm6ds0.c.
References gyro_read_raw(), I2C_READY, LSM6DS0_GYRO_BIAS_ACQ_TIMES, LSM6DS0_GYRO_BIAS_SETTLING_US, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, osalDbgCheck, and osalThreadSleepMicroseconds.
|
static |
Set bias values for the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 589 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset bias values for the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
MSG_OK | if the function succeeded. |
Definition at line 618 of file lsm6ds0.c.
References LSM6DS0_GYRO_BIAS, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set sensitivity values for the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 648 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset sensitivity values for the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 677 of file lsm6ds0.c.
References FALSE, LSM6DS0_GYRO_FS_2000DPS, LSM6DS0_GYRO_FS_245DPS, LSM6DS0_GYRO_FS_500DPS, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_GYRO_SENS_2000DPS, LSM6DS0_GYRO_SENS_245DPS, LSM6DS0_GYRO_SENS_500DPS, LSM6DS0_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Changes the LSM6DS0Driver gyroscope fullscale value.
[in] | devp | pointer to BaseGyroscope interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 719 of file lsm6ds0.c.
References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_AD_CTRL_REG1_G, LSM6DS0_CTRL_REG1_G_FS_MASK, LSM6DS0_GYRO_2000DPS, LSM6DS0_GYRO_245DPS, LSM6DS0_GYRO_500DPS, LSM6DS0_GYRO_FS_2000DPS, LSM6DS0_GYRO_FS_245DPS, LSM6DS0_GYRO_FS_500DPS, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, lsm6ds0I2CReadRegister(), lsm6ds0I2CWriteRegister, MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.
void lsm6ds0ObjectInit | ( | LSM6DS0Driver * | devp | ) |
Initializes an instance.
[out] | devp | pointer to the LSM6DS0Driver object |
Definition at line 824 of file lsm6ds0.c.
References LSM6DS0Driver::acc_if, LSM6DS0Driver::gyro_if, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_STOP, BaseAccelerometer::vmt, BaseGyroscope::vmt, LSM6DS0Driver::vmt, vmt_accelerometer, vmt_device, and vmt_gyroscope.
void lsm6ds0Start | ( | LSM6DS0Driver * | devp, |
const LSM6DS0Config * | config ) |
Configures and activates LSM6DS0 Complex Driver peripheral.
[in] | devp | pointer to the LSM6DS0Driver object |
[in] | config | pointer to the LSM6DS0Config object |
Definition at line 845 of file lsm6ds0.c.
References FALSE, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_ACC_16G, LSM6DS0_ACC_2G, LSM6DS0_ACC_4G, LSM6DS0_ACC_8G, LSM6DS0_ACC_BIAS, LSM6DS0_ACC_FS_16G, LSM6DS0_ACC_FS_2G, LSM6DS0_ACC_FS_4G, LSM6DS0_ACC_FS_8G, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_ACC_SENS_16G, LSM6DS0_ACC_SENS_2G, LSM6DS0_ACC_SENS_4G, LSM6DS0_ACC_SENS_8G, LSM6DS0_AD_CTRL_REG1_G, LSM6DS0_AD_CTRL_REG5_XL, LSM6DS0_AD_CTRL_REG8, LSM6DS0_AD_CTRL_REG9, LSM6DS0_CTRL_REG4_XEN_G, LSM6DS0_CTRL_REG4_YEN_G, LSM6DS0_CTRL_REG4_ZEN_G, LSM6DS0_CTRL_REG5_XL_XEN_XL, LSM6DS0_CTRL_REG5_XL_YEN_XL, LSM6DS0_CTRL_REG5_XL_ZEN_XL, LSM6DS0_CTRL_REG8_IF_ADD_INC, LSM6DS0_GYRO_2000DPS, LSM6DS0_GYRO_245DPS, LSM6DS0_GYRO_500DPS, LSM6DS0_GYRO_BIAS, LSM6DS0_GYRO_FS_2000DPS, LSM6DS0_GYRO_FS_245DPS, LSM6DS0_GYRO_FS_500DPS, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_GYRO_SENS_2000DPS, LSM6DS0_GYRO_SENS_245DPS, LSM6DS0_GYRO_SENS_500DPS, LSM6DS0_READY, LSM6DS0_STOP, lsm6ds0I2CWriteRegister, osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.
void lsm6ds0Stop | ( | LSM6DS0Driver * | devp | ) |
Deactivates the LSM6DS0 Complex Driver peripheral.
[in] | devp | pointer to the LSM6DS0Driver object |
Definition at line 1077 of file lsm6ds0.c.
References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LSM6DS0_AD_CTRL_REG6_XL, LSM6DS0_AD_CTRL_REG9, LSM6DS0_CTRL_REG9_SLEEP_G, LSM6DS0_READY, LSM6DS0_STOP, lsm6ds0I2CWriteRegister, osalDbgAssert, and osalDbgCheck.
|
static |
|
static |
|
static |