40 #define BMI055_DEVICE_PATH_ACCEL "/dev/bmi055_accel" 41 #define BMI055_DEVICE_PATH_ACCEL_EXT "/dev/bmi055_accel_ext" 44 #define BMI055_ACC_CHIP_ID 0x00 45 #define BMI055_ACC_X_L 0x02 46 #define BMI055_ACC_X_H 0x03 47 #define BMI055_ACC_Y_L 0x04 48 #define BMI055_ACC_Y_H 0x05 49 #define BMI055_ACC_Z_L 0x06 50 #define BMI055_ACC_Z_H 0x07 51 #define BMI055_ACC_TEMP 0x08 52 #define BMI055_ACC_INT_STATUS_0 0x09 53 #define BMI055_ACC_INT_STATUS_1 0x0A 54 #define BMI055_ACC_INT_STATUS_2 0x0B 55 #define BMI055_ACC_INT_STATUS_3 0x0C 56 #define BMI055_ACC_FIFO_STATUS 0x0E 57 #define BMI055_ACC_RANGE 0x0F 58 #define BMI055_ACC_BW 0x10 59 #define BMI055_ACC_PMU_LPW 0x11 60 #define BMI055_ACC_PMU_LOW_POWER 0x12 61 #define BMI055_ACC_DATA_CTRL 0x13 62 #define BMI055_ACC_SOFTRESET 0x14 63 #define BMI055_ACC_INT_EN_0 0x16 64 #define BMI055_ACC_INT_EN_1 0x17 65 #define BMI055_ACC_INT_EN_2 0x18 66 #define BMI055_ACC_INT_MAP_0 0x19 67 #define BMI055_ACC_INT_MAP_1 0x1A 68 #define BMI055_ACC_INT_MAP_2 0x1B 69 #define BMI055_ACC_INT_SRC 0x1E 70 #define BMI055_ACC_INT_OUT_CTRL 0x20 71 #define BMI055_ACC_INT_LATCH 0x21 72 #define BMI055_ACC_INT_LH_0 0x22 73 #define BMI055_ACC_INT_LH_1 0x23 74 #define BMI055_ACC_INT_LH_2 0x24 75 #define BMI055_ACC_INT_LH_3 0x25 76 #define BMI055_ACC_INT_LH_4 0x26 77 #define BMI055_ACC_INT_MOT_0 0x27 78 #define BMI055_ACC_INT_MOT_1 0x28 79 #define BMI055_ACC_INT_MOT_2 0x29 80 #define BMI055_ACC_INT_TAP_0 0x2A 81 #define BMI055_ACC_INT_TAP_1 0x2B 82 #define BMI055_ACC_INT_ORIE_0 0x2C 83 #define BMI055_ACC_INT_ORIE_1 0x2D 84 #define BMI055_ACC_INT_FLAT_0 0x2E 85 #define BMI055_ACC_INT_FLAT_1 0x2F 86 #define BMI055_ACC_FIFO_CONFIG_0 0x30 87 #define BMI055_ACC_SELF_TEST 0x32 88 #define BMI055_ACC_EEPROM_CTRL 0x33 89 #define BMI055_ACC_SERIAL_CTRL 0x34 90 #define BMI055_ACC_OFFSET_CTRL 0x36 91 #define BMI055_ACC_OFC_SETTING 0x37 92 #define BMI055_ACC_OFFSET_X 0x38 93 #define BMI055_ACC_OFFSET_Y 0x39 94 #define BMI055_ACC_OFFSET_Z 0x3A 95 #define BMI055_ACC_TRIM_GPO 0x3B 96 #define BMI055_ACC_TRIM_GP1 0x3C 97 #define BMI055_ACC_FIFO_CONFIG_1 0x3E 98 #define BMI055_ACC_FIFO_DATA 0x3F 101 #define BMI055_ACC_WHO_AM_I 0xFA 104 #define BMI055_ACCEL_BW_7_81 (1<<3) | (0<<2) | (0<<1) | (0<<0) 105 #define BMI055_ACCEL_BW_15_63 (1<<3) | (0<<2) | (0<<1) | (1<<0) 106 #define BMI055_ACCEL_BW_31_25 (1<<3) | (0<<2) | (1<<1) | (0<<0) 107 #define BMI055_ACCEL_BW_62_5 (1<<3) | (0<<2) | (1<<1) | (1<<0) 108 #define BMI055_ACCEL_BW_125 (1<<3) | (1<<2) | (0<<1) | (0<<0) 109 #define BMI055_ACCEL_BW_250 (1<<3) | (1<<2) | (0<<1) | (1<<0) 110 #define BMI055_ACCEL_BW_500 (1<<3) | (1<<2) | (1<<1) | (0<<0) 111 #define BMI055_ACCEL_BW_1000 (1<<3) | (1<<2) | (1<<1) | (1<<0) 114 #define BMI055_ACCEL_NORMAL (0<<7) | (0<<6) | (0<<5) 115 #define BMI055_ACCEL_DEEP_SUSPEND (0<<7) | (0<<6) | (1<<5) 116 #define BMI055_ACCEL_LOW_POWER (0<<7) | (1<<6) | (0<<5) 117 #define BMI055_ACCEL_SUSPEND (1<<7) | (0<<6) | (0<<5) 120 #define BMI055_ACCEL_RANGE_2_G (0<<3) | (0<<2) | (1<<1) | (1<<0) 121 #define BMI055_ACCEL_RANGE_4_G (0<<3) | (1<<2) | (0<<1) | (1<<0) 122 #define BMI055_ACCEL_RANGE_8_G (1<<3) | (0<<2) | (0<<1) | (0<<0) 123 #define BMI055_ACCEL_RANGE_16_G (1<<3) | (1<<2) | (0<<1) | (0<<0) 126 #define BMI055_ACC_DRDY_INT_EN (1<<4) 129 #define BMI055_ACC_DRDY_INT1 (1<<0) 132 #define BMI055_ACCEL_DEFAULT_RANGE_G 16 133 #define BMI055_ACCEL_DEFAULT_RATE 1000 134 #define BMI055_ACCEL_MAX_RATE 1000 135 #define BMI055_ACCEL_MAX_PUBLISH_RATE 280 137 #define BMI055_ACCEL_DEFAULT_DRIVER_FILTER_FREQ 50 140 #define BMI055_NEW_DATA_MASK 0x01 179 #define BMI055_ACCEL_NUM_CHECKED_REGISTERS 5 214 void modify_reg(
unsigned reg, uint8_t clearbits, uint8_t setbits);
BMI055_accel operator=(const BMI055_accel &)
void print_info()
Diagnostics - print some basic information about the driver.
uint8_t _checked_values[BMI055_ACCEL_NUM_CHECKED_REGISTERS]
Namespace encapsulating all device framework classes, functions and data.
static const uint8_t _checked_registers[BMI055_ACCEL_NUM_CHECKED_REGISTERS]
perf_counter_t _duplicates
perf_counter_t _sample_perf
void modify_reg(unsigned reg, uint8_t clearbits, uint8_t setbits)
Modify a register in the BMI055_accel.
Rotation
Enum for board and external compass rotations.
uint8_t _checked_bad[BMI055_ACCEL_NUM_CHECKED_REGISTERS]
void measure()
Fetch measurements from the sensor and update the report buffers.
int set_accel_range(unsigned max_g)
Set the BMI055_accel measurement range.
void write_checked_reg(unsigned reg, uint8_t value)
Write a register in the BMI055_accel, updating _checked_values.
PX4Accelerometer _px4_accel
perf_counter_t _bad_registers
#define BMI055_ACCEL_NUM_CHECKED_REGISTERS
BMI055_accel(int bus, const char *path_accel, uint32_t device, enum Rotation rotation)
void check_registers(void)
perf_counter_t _bad_transfers
void stop()
Stop automatic measurement.