ChibiOS
0.0.0
|
![]() |
Macros | |
#define | lsm6ds0I2CWriteRegister(i2cp, sad, txbuf, n) |
Writes a value into a register using I2C. More... | |
#define | lsm6ds0AccelerometerGetAxesNumber(devp) accelerometerGetAxesNumber(&((devp)->acc_if)) |
Return the number of axes of the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerReadRaw(devp, axes) accelerometerReadRaw(&((devp)->acc_if), axes) |
Retrieves raw data from the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerReadCooked(devp, axes) accelerometerReadCooked(&((devp)->acc_if), axes) |
Retrieves cooked data from the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerSetBias(devp, bp) accelerometerSetBias(&((devp)->acc_if), bp) |
Set bias values for the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerResetBias(devp) accelerometerResetBias(&((devp)->acc_if)) |
Reset bias values for the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerSetSensitivity(devp, sp) accelerometerSetSensitivity(&((devp)->acc_if), sp) |
Set sensitivity values for the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerResetSensitivity(devp) accelerometerResetSensitivity(&((devp)->acc_if)) |
Reset sensitivity values for the BaseAccelerometer. More... | |
#define | lsm6ds0AccelerometerSetFullScale(devp, fs) (devp)->vmt->acc_set_full_scale(devp, fs) |
Changes the LSM6DS0Driver accelerometer fullscale value. More... | |
#define | lsm6ds0GyroscopeGetAxesNumber(devp) gyroscopeGetAxesNumber(&((devp)->gyro_if)) |
Return the number of axes of the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeReadRaw(devp, axes) gyroscopeReadRaw(&((devp)->gyro_if), axes) |
Retrieves raw data from the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeReadCooked(devp, axes) gyroscopeReadCooked(&((devp)->gyro_if), axes) |
Retrieves cooked data from the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeSampleBias(devp) gyroscopeSampleBias(&((devp)->gyro_if)) |
Samples bias values for the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeSetBias(devp, bp) gyroscopeSetBias(&((devp)->gyro_if), bp) |
Set bias values for the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeResetBias(devp) gyroscopeResetBias(&((devp)->gyro_if)) |
Reset bias values for the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeSetSensitivity(devp, sp) gyroscopeSetSensitivity(&((devp)->gyro_if), sp) |
Set sensitivity values for the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeResetSensitivity(devp) gyroscopeResetSensitivity(&((devp)->gyro_if)) |
Reset sensitivity values for the BaseGyroscope. More... | |
#define | lsm6ds0GyroscopeSetFullScale(devp, fs) (devp)->vmt->acc_set_full_scale(devp, fs) |
Changes the LSM6DS0Driver gyroscope fullscale value. More... | |
Version identification | |
#define | EX_LSM6DS0_VERSION "1.1.1" |
LSM6DS0 driver version string. More... | |
#define | EX_LSM6DS0_MAJOR 1 |
LSM6DS0 driver version major number. More... | |
#define | EX_LSM6DS0_MINOR 1 |
LSM6DS0 driver version minor number. More... | |
#define | EX_LSM6DS0_PATCH 1 |
LSM6DS0 driver version patch number. More... | |
#define | LSM6DS0_ACC_NUMBER_OF_AXES 3U |
LSM6DS0 accelerometer subsystem characteristics. More... | |
#define | LSM6DS0_GYRO_NUMBER_OF_AXES 3U |
L3GD20 gyroscope system characteristics. More... | |
LSM6DS0 communication interfaces related bit masks | |
#define | LSM6DS0_DI_MASK 0xFF |
#define | LSM6DS0_DI(n) (1 << n) |
#define | LSM6DS0_AD_MASK 0x7F |
#define | LSM6DS0_AD(n) (1 << n) |
#define | LSM6DS0_MS (1 << 7) |
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. More... | |
#define | LSM6DS0_SHARED_SPI FALSE |
LSM6DS0 shared SPI switch. More... | |
#define | LSM6DS0_USE_I2C TRUE |
LSM6DS0 I2C interface switch. More... | |
#define | LSM6DS0_SHARED_I2C FALSE |
LSM6DS0 shared I2C switch. More... | |
#define | LSM6DS0_USE_ADVANCED FALSE |
LSM6DS0 advanced configurations switch. More... | |
#define | LSM6DS0_ACC_USE_ADVANCED FALSE |
LSM6DS0 accelerometer subsystem advanced configurations switch. More... | |
#define | LSM6DS0_GYRO_USE_ADVANCED FALSE |
LSM6DS0 gyroscope subsystem advanced configurations switch. More... | |
#define | LSM6DS0_GYRO_BIAS_ACQ_TIMES 50 |
Number of acquisitions for gyroscope bias removal. More... | |
#define | LSM6DS0_GYRO_BIAS_SETTLING_US 5000 |
Settling time for gyroscope bias removal. More... | |
LSM6DS0 data structures and types. | |
| |
typedef struct LSM6DS0Driver | LSM6DS0Driver |
Structure representing a LSM6DS0 driver. More... | |
#define | _lsm6ds0_methods_alone |
LSM6DS0 specific methods. More... | |
#define | _lsm6ds0_methods |
LSM6DS0 specific methods with inherited ones. More... | |
#define | _lsm6ds0_data |
LSM6DS0Driver specific data. More... | |
Data Structures | |
struct | LSM6DS0Config |
LSM6DS0 configuration structure. More... | |
struct | LSM6DS0VMT |
LSM6DS0 virtual methods table. More... | |
struct | LSM6DS0Driver |
LSM6DS0 6-axis accelerometer/gyroscope class. More... | |
Functions | |
msg_t | lsm6ds0I2CReadRegister (I2CDriver *i2cp, lsm6ds0_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n) |
Reads registers value using I2C. More... | |
static size_t | acc_get_axes_number (void *ip) |
Return the number of axes of the BaseAccelerometer. More... | |
static msg_t | acc_read_raw (void *ip, int32_t axes[]) |
Retrieves raw data from the BaseAccelerometer. More... | |
static msg_t | acc_read_cooked (void *ip, float axes[]) |
Retrieves cooked data from the BaseAccelerometer. More... | |
static msg_t | acc_set_bias (void *ip, float *bp) |
Set bias values for the BaseAccelerometer. More... | |
static msg_t | acc_reset_bias (void *ip) |
Reset bias values for the BaseAccelerometer. More... | |
static msg_t | acc_set_sensivity (void *ip, float *sp) |
Set sensitivity values for the BaseAccelerometer. More... | |
static msg_t | acc_reset_sensivity (void *ip) |
Reset sensitivity values for the BaseAccelerometer. More... | |
static msg_t | acc_set_full_scale (LSM6DS0Driver *devp, lsm6ds0_acc_fs_t fs) |
Changes the LSM6DS0Driver accelerometer fullscale value. More... | |
static size_t | gyro_get_axes_number (void *ip) |
Return the number of axes of the BaseGyroscope. More... | |
static msg_t | gyro_read_raw (void *ip, int32_t axes[LSM6DS0_GYRO_NUMBER_OF_AXES]) |
Retrieves raw data from the BaseGyroscope. More... | |
static msg_t | gyro_read_cooked (void *ip, float axes[]) |
Retrieves cooked data from the BaseGyroscope. More... | |
static msg_t | gyro_sample_bias (void *ip) |
Samples bias values for the BaseGyroscope. More... | |
static msg_t | gyro_set_bias (void *ip, float *bp) |
Set bias values for the BaseGyroscope. More... | |
static msg_t | gyro_reset_bias (void *ip) |
Reset bias values for the BaseGyroscope. More... | |
static msg_t | gyro_set_sensivity (void *ip, float *sp) |
Set sensitivity values for the BaseGyroscope. More... | |
static msg_t | gyro_reset_sensivity (void *ip) |
Reset sensitivity values for the BaseGyroscope. More... | |
static msg_t | gyro_set_full_scale (LSM6DS0Driver *devp, lsm6ds0_gyro_fs_t fs) |
Changes the LSM6DS0Driver gyroscope fullscale value. More... | |
void | lsm6ds0ObjectInit (LSM6DS0Driver *devp) |
Initializes an instance. More... | |
void | lsm6ds0Start (LSM6DS0Driver *devp, const LSM6DS0Config *config) |
Configures and activates LSM6DS0 Complex Driver peripheral. More... | |
void | lsm6ds0Stop (LSM6DS0Driver *devp) |
Deactivates the LSM6DS0 Complex Driver peripheral. More... | |
#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.1" |
#define EX_LSM6DS0_MAJOR 1 |
#define EX_LSM6DS0_MINOR 1 |
#define EX_LSM6DS0_PATCH 1 |
#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_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_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_ACC_USE_ADVANCED FALSE |
#define LSM6DS0_GYRO_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 383 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 391 of file lsm6ds0.h.
Referenced by gyro_sample_bias().
#define _lsm6ds0_methods_alone |
LSM6DS0
specific methods.
#define _lsm6ds0_methods |
LSM6DS0
specific methods with inherited ones.
#define _lsm6ds0_data |
LSM6DS0Driver
specific data.
#define lsm6ds0AccelerometerGetAxesNumber | ( | devp | ) | accelerometerGetAxesNumber(&((devp)->acc_if)) |
Return the number of axes of the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
#define lsm6ds0AccelerometerReadRaw | ( | devp, | |
axes | |||
) | accelerometerReadRaw(&((devp)->acc_if), 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 | |||
) | accelerometerReadCooked(&((devp)->acc_if), 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 | |||
) | accelerometerSetBias(&((devp)->acc_if), 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 | ) | accelerometerResetBias(&((devp)->acc_if)) |
Reset bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
#define lsm6ds0AccelerometerSetSensitivity | ( | devp, | |
sp | |||
) | accelerometerSetSensitivity(&((devp)->acc_if), 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 | ) | accelerometerResetSensitivity(&((devp)->acc_if)) |
Reset sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
#define lsm6ds0AccelerometerSetFullScale | ( | devp, | |
fs | |||
) | (devp)->vmt->acc_set_full_scale(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 | ) | gyroscopeGetAxesNumber(&((devp)->gyro_if)) |
Return the number of axes of the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
#define lsm6ds0GyroscopeReadRaw | ( | devp, | |
axes | |||
) | gyroscopeReadRaw(&((devp)->gyro_if), 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 | |||
) | gyroscopeReadCooked(&((devp)->gyro_if), 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 | ) | gyroscopeSampleBias(&((devp)->gyro_if)) |
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 | |||
) | gyroscopeSetBias(&((devp)->gyro_if), 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 | ) | gyroscopeResetBias(&((devp)->gyro_if)) |
Reset bias values for the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
#define lsm6ds0GyroscopeSetSensitivity | ( | devp, | |
sp | |||
) | gyroscopeSetSensitivity(&((devp)->gyro_if), 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 | ) | gyroscopeResetSensitivity(&((devp)->gyro_if)) |
Reset sensitivity values for the BaseGyroscope.
[in] | devp | pointer to LSM6DS0Driver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
#define lsm6ds0GyroscopeSetFullScale | ( | devp, | |
fs | |||
) | (devp)->vmt->acc_set_full_scale(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 |
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.
Referenced by gyro_set_full_scale().
|
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_READY, lsm6ds0I2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by acc_read_cooked(), and gyro_set_full_scale().
|
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.
Referenced by gyro_set_full_scale().
|
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.
Referenced by gyro_set_full_scale().
|
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_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
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.
Referenced by gyro_set_full_scale().
|
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_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
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_FS_16G, LSM6DS0_ACC_FS_2G, LSM6DS0_ACC_FS_4G, LSM6DS0_ACC_FS_8G, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_READY, lsm6ds0I2CReadRegister(), lsm6ds0I2CWriteRegister, MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
static |
Return the number of axes of the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
Definition at line 427 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES.
Referenced by gyro_set_full_scale().
|
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 449 of file lsm6ds0.c.
References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, lsm6ds0I2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_read_cooked(), gyro_sample_bias(), and gyro_set_full_scale().
|
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 505 of file lsm6ds0.c.
References gyro_read_raw(), LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
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 538 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.
Referenced by gyro_set_full_scale().
|
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 586 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
static |
Reset bias values for the BaseGyroscope.
[in] | ip | pointer to BaseGyroscope interface. |
MSG_OK | if the function succeeded. |
Definition at line 615 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
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 645 of file lsm6ds0.c.
References LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
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 674 of file lsm6ds0.c.
References FALSE, LSM6DS0_GYRO_FS_2000DPS, LSM6DS0_GYRO_FS_245DPS, LSM6DS0_GYRO_FS_500DPS, LSM6DS0_GYRO_NUMBER_OF_AXES, LSM6DS0_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by gyro_set_full_scale().
|
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 716 of file lsm6ds0.c.
References 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(), gyro_get_axes_number(), gyro_read_cooked(), gyro_read_raw(), gyro_reset_bias(), gyro_reset_sensivity(), gyro_sample_bias(), gyro_set_bias(), gyro_set_sensivity(), I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), 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 821 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, and LSM6DS0Driver::vmt.
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 842 of file lsm6ds0.c.
References FALSE, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM6DS0_ACC_FS_16G, LSM6DS0_ACC_FS_2G, LSM6DS0_ACC_FS_4G, LSM6DS0_ACC_FS_8G, LSM6DS0_ACC_NUMBER_OF_AXES, LSM6DS0_GYRO_FS_2000DPS, LSM6DS0_GYRO_FS_245DPS, LSM6DS0_GYRO_FS_500DPS, LSM6DS0_GYRO_NUMBER_OF_AXES, 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 1074 of file lsm6ds0.c.
References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LSM6DS0_READY, LSM6DS0_STOP, lsm6ds0I2CWriteRegister, osalDbgAssert, and osalDbgCheck.