APM:Libraries
|
#include <AP_InertialSensor_BMI160.h>
Public Member Functions | |
void | start () override |
bool | update () override |
![]() | |
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) |
Private Member Functions | |
AP_InertialSensor_BMI160 (AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::Device > dev) | |
void | _check_err_reg () |
bool | _hardware_init () |
bool | _init () |
bool | _configure_accel () |
bool | _configure_gyro () |
bool | _configure_int1_pin () |
bool | _configure_fifo () |
void | _poll_data () |
void | _read_fifo () |
Private Attributes | |
AP_HAL::OwnPtr< AP_HAL::Device > | _dev |
uint8_t | _accel_instance |
float | _accel_scale |
uint8_t | _gyro_instance |
float | _gyro_scale |
AP_HAL::DigitalSource * | _int1_pin |
Additional Inherited Members | |
![]() | |
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 } |
![]() | |
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) |
![]() | |
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 26 of file AP_InertialSensor_BMI160.h.
|
private |
Definition at line 123 of file AP_InertialSensor_BMI160.cpp.
Referenced by probe().
|
private |
If the macro BMI160_DEBUG is defined, check if there are errors reported on the device's error register and panic if so. The implementation is empty if the BMI160_DEBUG isn't defined.
Definition at line 198 of file AP_InertialSensor_BMI160.cpp.
Referenced by _configure_accel(), _configure_fifo(), and _configure_gyro().
|
private |
Configure accelerometer sensor. The device semaphore must already be taken before calling this function.
Definition at line 214 of file AP_InertialSensor_BMI160.cpp.
Referenced by start().
|
private |
Configure FIFO.
Definition at line 303 of file AP_InertialSensor_BMI160.cpp.
Referenced by start().
|
private |
Configure gyroscope sensor. The device semaphore must already be taken before calling this function.
Definition at line 241 of file AP_InertialSensor_BMI160.cpp.
Referenced by start().
|
private |
Configure INT1 pin as watermark interrupt pin at the level of one sample if using fifo or data-ready pin otherwise.
Definition at line 267 of file AP_InertialSensor_BMI160.cpp.
Referenced by start().
|
private |
Try to perform initialization of the BMI160 device.
The device semaphore must be taken and released by the caller.
Definition at line 425 of file AP_InertialSensor_BMI160.cpp.
Referenced by _init().
|
private |
Try to initialize this driver.
Do sensor and other required initializations.
Definition at line 487 of file AP_InertialSensor_BMI160.cpp.
|
private |
Device periodic callback to read data from the sensors.
Definition at line 420 of file AP_InertialSensor_BMI160.cpp.
Referenced by start().
|
private |
Read samples from fifo.
Definition at line 335 of file AP_InertialSensor_BMI160.cpp.
Referenced by _poll_data().
|
static |
Definition at line 131 of file AP_InertialSensor_BMI160.cpp.
Referenced by AP_InertialSensor::detect_backends().
|
overridevirtual |
Configure the sensors and start reading routine.
Reimplemented from AP_InertialSensor_Backend.
Definition at line 151 of file AP_InertialSensor_BMI160.cpp.
|
overridevirtual |
Implements AP_InertialSensor_Backend.
Definition at line 191 of file AP_InertialSensor_BMI160.cpp.
|
private |
Definition at line 110 of file AP_InertialSensor_BMI160.h.
Referenced by _read_fifo(), start(), and update().
|
private |
Definition at line 111 of file AP_InertialSensor_BMI160.h.
Referenced by _configure_accel(), and _read_fifo().
|
private |
Definition at line 108 of file AP_InertialSensor_BMI160.h.
Referenced by _check_err_reg(), _configure_accel(), _configure_fifo(), _configure_gyro(), _configure_int1_pin(), _hardware_init(), _init(), _read_fifo(), and start().
|
private |
Definition at line 113 of file AP_InertialSensor_BMI160.h.
Referenced by _read_fifo(), start(), and update().
|
private |
Definition at line 114 of file AP_InertialSensor_BMI160.h.
Referenced by _configure_gyro(), and _read_fifo().
|
private |
Definition at line 116 of file AP_InertialSensor_BMI160.h.
Referenced by _configure_int1_pin(), and _read_fifo().