APM:Libraries
|
#include <AP_InertialSensor_LSM9DS1.h>
Classes | |
struct | sensor_raw_data |
Public Member Functions | |
virtual | ~AP_InertialSensor_LSM9DS1 () |
void | start (void) override |
bool | update () override |
Public Member Functions inherited from AP_InertialSensor_Backend | |
AP_InertialSensor_Backend (AP_InertialSensor &imu) | |
AP_InertialSensor_Backend (const AP_InertialSensor_Backend &that)=delete | |
virtual | ~AP_InertialSensor_Backend (void) |
virtual void | accumulate () |
virtual AuxiliaryBus * | get_auxiliary_bus () |
int16_t | get_id () const |
void | notify_fifo_reset (void) |
Static Public Member Functions | |
static AP_InertialSensor_Backend * | probe (AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::SPIDevice > dev, enum Rotation rotation=ROTATION_NONE) |
Private Types | |
enum | accel_scale { A_SCALE_2G = 0, A_SCALE_4G, A_SCALE_8G, A_SCALE_16G } |
Private Member Functions | |
AP_InertialSensor_LSM9DS1 (AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::SPIDevice > dev, int drdy_pin_num_xg, enum Rotation rotation) | |
void | _poll_data () |
void | _fifo_reset () |
bool | _init_sensor () |
bool | _hardware_init () |
void | _gyro_init () |
void | _accel_init () |
void | _set_gyro_scale () |
void | _set_accel_scale (accel_scale scale) |
uint8_t | _register_read (uint8_t reg) |
void | _register_write (uint8_t reg, uint8_t val, bool checked=false) |
void | _read_data_transaction_x (uint16_t samples) |
void | _read_data_transaction_g (uint16_t samples) |
Static Private Member Functions | |
static AP_InertialSensor_Backend * | detect (AP_InertialSensor &imu) |
Private Attributes | |
AP_HAL::OwnPtr< AP_HAL::SPIDevice > | _dev |
AP_HAL::Semaphore * | _spi_sem |
AP_HAL::DigitalSource * | _drdy_pin_xg |
float | _gyro_scale |
float | _accel_scale |
int | _drdy_pin_num_xg |
uint8_t | _gyro_instance |
uint8_t | _accel_instance |
enum Rotation | _rotation |
Additional Inherited Members | |
Public Types inherited from AP_InertialSensor_Backend | |
enum | DevTypes { DEVTYPE_BMI160 = 0x09, DEVTYPE_L3G4200D = 0x10, DEVTYPE_ACC_LSM303D = 0x11, DEVTYPE_ACC_BMA180 = 0x12, DEVTYPE_ACC_MPU6000 = 0x13, DEVTYPE_ACC_MPU9250 = 0x16, DEVTYPE_ACC_IIS328DQ = 0x17, DEVTYPE_ACC_LSM9DS1 = 0x18, DEVTYPE_GYR_MPU6000 = 0x21, DEVTYPE_GYR_L3GD20 = 0x22, DEVTYPE_GYR_MPU9250 = 0x24, DEVTYPE_GYR_I3G4250D = 0x25, DEVTYPE_GYR_LSM9DS1 = 0x26, DEVTYPE_INS_ICM20789 = 0x27, DEVTYPE_INS_ICM20689 = 0x28 } |
Protected Member Functions inherited from AP_InertialSensor_Backend | |
void | _rotate_and_correct_accel (uint8_t instance, Vector3f &accel) |
void | _rotate_and_correct_gyro (uint8_t instance, Vector3f &gyro) |
void | _publish_gyro (uint8_t instance, const Vector3f &gyro) |
void | _notify_new_gyro_raw_sample (uint8_t instance, const Vector3f &accel, uint64_t sample_us=0) |
void | _publish_accel (uint8_t instance, const Vector3f &accel) |
void | _notify_new_accel_raw_sample (uint8_t instance, const Vector3f &accel, uint64_t sample_us=0, bool fsync_set=false) |
void | _set_accel_oversampling (uint8_t instance, uint8_t n) |
void | _set_gyro_oversampling (uint8_t instance, uint8_t n) |
void | _set_accel_sensor_rate_sampling_enabled (uint8_t instance, bool value) |
void | _set_gyro_sensor_rate_sampling_enabled (uint8_t instance, bool value) |
void | _set_raw_sample_accel_multiplier (uint8_t instance, uint16_t mul) |
void | _set_raw_sampl_gyro_multiplier (uint8_t instance, uint16_t mul) |
void | _update_sensor_rate (uint16_t &count, uint32_t &start_us, float &rate_hz) const |
void | _set_accel_max_abs_offset (uint8_t instance, float offset) |
uint32_t | _accel_raw_sample_rate (uint8_t instance) const |
void | _set_accel_raw_sample_rate (uint8_t instance, uint16_t rate_hz) |
uint32_t | _gyro_raw_sample_rate (uint8_t instance) const |
void | _set_gyro_raw_sample_rate (uint8_t instance, uint16_t rate_hz) |
void | _publish_temperature (uint8_t instance, float temperature) |
void | _set_accel_error_count (uint8_t instance, uint32_t error_count) |
void | _set_gyro_error_count (uint8_t instance, uint32_t error_count) |
void | _inc_accel_error_count (uint8_t instance) |
void | _inc_gyro_error_count (uint8_t instance) |
uint8_t | _accel_filter_cutoff (void) const |
uint8_t | _gyro_filter_cutoff (void) const |
uint16_t | get_sample_rate_hz (void) const |
void | update_gyro (uint8_t instance) |
void | update_accel (uint8_t instance) |
void | set_gyro_orientation (uint8_t instance, enum Rotation rotation) |
void | set_accel_orientation (uint8_t instance, enum Rotation rotation) |
void | increment_clip_count (uint8_t instance) |
bool | enable_fast_sampling (uint8_t instance) |
void | _notify_new_accel_sensor_rate_sample (uint8_t instance, const Vector3f &accel) |
void | _notify_new_gyro_sensor_rate_sample (uint8_t instance, const Vector3f &gyro) |
void | notify_accel_fifo_reset (uint8_t instance) |
void | notify_gyro_fifo_reset (uint8_t instance) |
Protected Attributes inherited from AP_InertialSensor_Backend | |
AP_InertialSensor & | _imu |
AP_HAL::Semaphore * | _sem |
int16_t | _id = -1 |
int8_t | _last_accel_filter_hz [INS_MAX_INSTANCES] |
int8_t | _last_gyro_filter_hz [INS_MAX_INSTANCES] |
Definition at line 12 of file AP_InertialSensor_LSM9DS1.h.
|
private |
Enumerator | |
---|---|
A_SCALE_2G | |
A_SCALE_4G | |
A_SCALE_8G | |
A_SCALE_16G |
Definition at line 36 of file AP_InertialSensor_LSM9DS1.h.
|
inlinevirtual |
Definition at line 15 of file AP_InertialSensor_LSM9DS1.h.
|
private |
Definition at line 196 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by probe(), and ~AP_InertialSensor_LSM9DS1().
|
private |
Definition at line 373 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _hardware_init().
|
private |
Definition at line 302 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _hardware_init(), and _poll_data().
|
private |
Definition at line 360 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _hardware_init().
|
private |
Definition at line 247 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _init_sensor().
|
private |
Definition at line 227 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by probe().
|
private |
Timer process to poll for new data from the LSM9DS1.
Definition at line 415 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by start().
|
private |
Definition at line 473 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _poll_data().
|
private |
Definition at line 436 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _poll_data().
|
private |
Definition at line 347 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _fifo_reset(), _hardware_init(), _poll_data(), and update().
|
private |
Definition at line 355 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _accel_init(), and _gyro_init().
|
private |
Definition at line 396 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _accel_init().
|
private |
Definition at line 386 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by _gyro_init().
|
staticprivate |
|
static |
Definition at line 208 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by AP_InertialSensor::detect_backends(), and ~AP_InertialSensor_LSM9DS1().
|
overridevirtual |
Reimplemented from AP_InertialSensor_Backend.
Definition at line 333 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by ~AP_InertialSensor_LSM9DS1().
|
overridevirtual |
Implements AP_InertialSensor_Backend.
Definition at line 506 of file AP_InertialSensor_LSM9DS1.cpp.
Referenced by ~AP_InertialSensor_LSM9DS1().
|
private |
Definition at line 72 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _fifo_reset(), _poll_data(), _read_data_transaction_x(), start(), and update().
|
private |
Definition at line 69 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _read_data_transaction_x(), and _set_accel_scale().
|
private |
Definition at line 65 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _fifo_reset(), _hardware_init(), _init_sensor(), _poll_data(), _read_data_transaction_g(), _read_data_transaction_x(), _register_read(), _register_write(), and start().
|
private |
Definition at line 70 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _init_sensor().
|
private |
Definition at line 67 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _init_sensor().
|
private |
Definition at line 71 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _fifo_reset(), _read_data_transaction_g(), start(), and update().
|
private |
Definition at line 68 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _read_data_transaction_g(), and _set_gyro_scale().
|
private |
Definition at line 73 of file AP_InertialSensor_LSM9DS1.h.
Referenced by start().
|
private |
Definition at line 66 of file AP_InertialSensor_LSM9DS1.h.
Referenced by _hardware_init(), and _init_sensor().