41 #define BMI088_DEVICE_PATH_ACCEL "/dev/bmi088_accel" 42 #define BMI088_DEVICE_PATH_ACCEL_EXT "/dev/bmi088_accel_ext" 45 #define BMI088_ACC_CHIP_ID 0x00 47 #define BMI088_ACC_ERR_REG 0x02 48 #define BMI088_ACC_STATUS 0x03 49 #define BMI088_ACC_X_L 0x12 50 #define BMI088_ACC_X_H 0x13 51 #define BMI088_ACC_Y_L 0x14 52 #define BMI088_ACC_Y_H 0x15 53 #define BMI088_ACC_Z_L 0x16 54 #define BMI088_ACC_Z_H 0x17 55 #define BMI088_ACC_SENSORTIME_0 0x18 56 #define BMI088_ACC_SENSORTIME_1 0x19 57 #define BMI088_ACC_SENSORTIME_2 0x1A 58 #define BMI088_ACC_INT_STAT_1 0x1D 59 #define BMI088_ACC_TEMP_H 0x22 60 #define BMI088_ACC_TEMP_L 0x23 61 #define BMI088_ACC_CONF 0x40 62 #define BMI088_ACC_RANGE 0x41 63 #define BMI088_ACC_INT1_IO_CONF 0x53 64 #define BMI088_ACC_INT2_IO_CONF 0x54 65 #define BMI088_ACC_INT1_INT2_MAP_DATA 0x58 66 #define BMI088_ACC_SELF_TEST 0x6D 67 #define BMI088_ACC_PWR_CONF 0x7C 68 #define BMI088_ACC_PWR_CTRL 0x7D 69 #define BMI088_ACC_SOFTRESET 0x7E 72 #define BMI088_ACC_WHO_AM_I 0x1E 75 #define BMI088_ACC_ERR_REG_NO_ERROR (0x00<<2) 76 #define BMI088_ACC_ERR_REG_ERROR (0x01<<2) 78 #define BMI088_ACC_ERR_REG_FATAL_ERROR (0x01<<0) 81 #define BMI088_ACC_STATUS_DRDY (0x01<<7) 84 #define BMI088_ACC_INT_STAT_1_DRDY (0x01<<7) 87 #define BMI088_ACC_CONF_BWP_4 (0x08<<4) 88 #define BMI088_ACC_CONF_BWP_2 (0x09<<4) 89 #define BMI088_ACC_CONF_BWP_NORMAL (0x0A<<4) 91 #define BMI088_ACC_CONF_ODR_12_5 (0x05<<0) 92 #define BMI088_ACC_CONF_ODR_25 (0x06<<0) 93 #define BMI088_ACC_CONF_ODR_50 (0x07<<0) 94 #define BMI088_ACC_CONF_ODR_100 (0x08<<0) 95 #define BMI088_ACC_CONF_ODR_200 (0x09<<0) 96 #define BMI088_ACC_CONF_ODR_400 (0x0A<<0) 97 #define BMI088_ACC_CONF_ODR_800 (0x0B<<0) 98 #define BMI088_ACC_CONF_ODR_1600 (0x0C<<0) 101 #define BMI088_ACCEL_RANGE_3_G (0x00<<0) 102 #define BMI088_ACCEL_RANGE_6_G (0x01<<0) 103 #define BMI088_ACCEL_RANGE_12_G (0x02<<0) 104 #define BMI088_ACCEL_RANGE_24_G (0x03<<0) 107 #define BMI088_ACC_INT1_IO_CONF_INT1_IN (0x01<<4) 109 #define BMI088_ACC_INT1_IO_CONF_INT1_OUT (0x01<<3) 111 #define BMI088_ACC_INT1_IO_CONF_PP (0x00<<2) 112 #define BMI088_ACC_INT1_IO_CONF_OD (0x01<<2) 114 #define BMI088_ACC_INT1_IO_CONF_ACTIVE_LOW (0x00<<1) 115 #define BMI088_ACC_INT1_IO_CONF_ACTIVE_HIGH (0x01<<1) 118 #define BMI088_ACC_INT2_IO_CONF_INT1_IN (0x01<<4) 120 #define BMI088_ACC_INT2_IO_CONF_INT1_OUT (0x01<<3) 122 #define BMI088_ACC_INT2_IO_CONF_PP (0x00<<2) 123 #define BMI088_ACC_INT2_IO_CONF_OD (0x01<<2) 125 #define BMI088_ACC_INT2_IO_CONF_ACTIVE_LOW (0x00<<1) 126 #define BMI088_ACC_INT2_IO_CONF_ACTIVE_HIGH (0x01<<1) 129 #define BMI088_ACC_INT1_INT2_MAP_DATA_INT2_DRDY (0x01<<6) 130 #define BMI088_ACC_INT1_INT2_MAP_DATA_INT1_DRDY (0x01<<2) 133 #define BMI088_ACC_SELF_TEST_OFF (0x00<<0) 134 #define BMI088_ACC_SELF_TEST_POSITIVE (0x0D<<0) 135 #define BMI088_ACC_SELF_TEST_NEGATIVE (0x09<<0) 138 #define BMI088_ACC_PWR_CONF_SUSPEND (0x03<<0) 139 #define BMI088_ACC_PWR_CONF_ACTIVE (0x00<<0) 142 #define BMI088_ACC_PWR_CTRL_EN (0x04<<0) 150 #define BMI088_ACCEL_DEFAULT_RANGE_G 24 151 #define BMI088_ACCEL_DEFAULT_RATE 800 152 #define BMI088_ACCEL_MAX_RATE 800 153 #define BMI088_ACCEL_MAX_PUBLISH_RATE 800 155 #define BMI088_ACCEL_DEFAULT_DRIVER_FILTER_FREQ 50 169 virtual uint8_t
read_reg(
unsigned reg);
200 #define BMI088_ACCEL_NUM_CHECKED_REGISTERS 7 235 void modify_reg(
unsigned reg, uint8_t clearbits, uint8_t setbits);
void measure()
Fetch measurements from the sensor and update the report buffers.
virtual uint8_t read_reg(unsigned reg)
Read a register from the BMI088.
void print_info()
Diagnostics - print some basic information about the driver.
perf_counter_t _bad_registers
int accel_set_sample_rate(float desired_sample_rate_hz)
Set accel sample rate.
int set_accel_range(unsigned max_g)
Set the BMI088_accel measurement range.
Namespace encapsulating all device framework classes, functions and data.
BMI088_accel operator=(const BMI088_accel &)
perf_counter_t _duplicates
BMI088_accel(int bus, const char *path_accel, uint32_t device, enum Rotation rotation)
#define BMI088_ACCEL_NUM_CHECKED_REGISTERS
uint8_t _checked_bad[BMI088_ACCEL_NUM_CHECKED_REGISTERS]
Rotation
Enum for board and external compass rotations.
void write_checked_reg(unsigned reg, uint8_t value)
Write a register in the BMI088_accel, updating _checked_values.
perf_counter_t _sample_perf
perf_counter_t _bad_transfers
PX4Accelerometer _px4_accel
static const uint8_t _checked_registers[BMI088_ACCEL_NUM_CHECKED_REGISTERS]
void stop()
Stop automatic measurement.
void check_registers(void)
virtual uint16_t read_reg16(unsigned reg)
void modify_reg(unsigned reg, uint8_t clearbits, uint8_t setbits)
Modify a register in the BMI088_accel.
uint8_t _checked_values[BMI088_ACCEL_NUM_CHECKED_REGISTERS]