40 #define BMI055_DEVICE_PATH_GYRO "/dev/bmi055_gyro" 41 #define BMI055_DEVICE_PATH_GYRO_EXT "/dev/bmi055_gyro_ext" 44 #define BMI055_GYR_CHIP_ID 0x00 45 #define BMI055_GYR_X_L 0x02 46 #define BMI055_GYR_X_H 0x03 47 #define BMI055_GYR_Y_L 0x04 48 #define BMI055_GYR_Y_H 0x05 49 #define BMI055_GYR_Z_L 0x06 50 #define BMI055_GYR_Z_H 0x07 51 #define BMI055_GYR_INT_STATUS_0 0x09 52 #define BMI055_GYR_INT_STATUS_1 0x0A 53 #define BMI055_GYR_INT_STATUS_2 0x0B 54 #define BMI055_GYR_INT_STATUS_3 0x0C 55 #define BMI055_GYR_FIFO_STATUS 0x0E 56 #define BMI055_GYR_RANGE 0x0F 57 #define BMI055_GYR_BW 0x10 58 #define BMI055_GYR_LPM1 0x11 59 #define BMI055_GYR_LPM2 0x12 60 #define BMI055_GYR_RATE_HBW 0x13 61 #define BMI055_GYR_SOFTRESET 0x14 62 #define BMI055_GYR_INT_EN_0 0x15 63 #define BMI055_GYR_INT_EN_1 0x16 64 #define BMI055_GYR_INT_MAP_0 0x17 65 #define BMI055_GYR_INT_MAP_1 0x18 66 #define BMI055_GYR_INT_MAP_2 0x19 67 #define BMI055_GYRO_0_REG 0x1A 68 #define BMI055_GYRO_1_REG 0x1B 69 #define BMI055_GYRO_2_REG 0x1C 70 #define BMI055_GYRO_3_REG 0x1E 71 #define BMI055_GYR_INT_LATCH 0x21 72 #define BMI055_GYR_INT_LH_0 0x22 73 #define BMI055_GYR_INT_LH_1 0x23 74 #define BMI055_GYR_INT_LH_2 0x24 75 #define BMI055_GYR_INT_LH_3 0x25 76 #define BMI055_GYR_INT_LH_4 0x26 77 #define BMI055_GYR_INT_LH_5 0x27 78 #define BMI055_GYR_SOC 0x31 79 #define BMI055_GYR_A_FOC 0x32 80 #define BMI055_GYR_TRIM_NVM_CTRL 0x33 81 #define BMI055_BGW_SPI3_WDT 0x34 82 #define BMI055_GYR_OFFSET_COMP 0x36 83 #define BMI055_GYR_OFFSET_COMP_X 0x37 84 #define BMI055_GYR_OFFSET_COMP_Y 0x38 85 #define BMI055_GYR_OFFSET_COMP_Z 0x39 86 #define BMI055_GYR_TRIM_GPO 0x3A 87 #define BMI055_GYR_TRIM_GP1 0x3B 88 #define BMI055_GYR_SELF_TEST 0x3C 89 #define BMI055_GYR_FIFO_CONFIG_0 0x3D 90 #define BMI055_GYR_FIFO_CONFIG_1 0x3E 91 #define BMI055_GYR_FIFO_DATA 0x3F 94 #define BMI055_GYR_WHO_AM_I 0x0F 97 #define BMI055_GYRO_RATE_100 (0<<3) | (1<<2) | (1<<1) | (1<<0) 98 #define BMI055_GYRO_RATE_200 (0<<3) | (1<<2) | (1<<1) | (0<<0) 99 #define BMI055_GYRO_RATE_400 (0<<3) | (0<<2) | (1<<1) | (1<<0) 100 #define BMI055_GYRO_RATE_1000 (0<<3) | (0<<2) | (1<<1) | (0<<0) 101 #define BMI055_GYRO_RATE_2000 (0<<3) | (0<<2) | (0<<1) | (1<<0) 104 #define BMI055_GYRO_NORMAL (0<<7) | (0<<5) 105 #define BMI055_GYRO_DEEP_SUSPEND (0<<7) | (1<<5) 106 #define BMI055_GYRO_SUSPEND (1<<7) | (0<<5) 109 #define BMI055_GYRO_RANGE_2000_DPS (0<<2) | (0<<1) | (0<<0) 110 #define BMI055_GYRO_RANGE_1000_DPS (0<<2) | (0<<1) | (1<<0) 111 #define BMI055_GYRO_RANGE_500_DPS (0<<2) | (1<<1) | (0<<0) 112 #define BMI055_GYRO_RANGE_250_DPS (0<<2) | (1<<1) | (1<<0) 113 #define BMI055_GYRO_RANGE_125_DPS (1<<2) | (0<<1) | (0<<0) 116 #define BMI055_GYR_DRDY_INT_EN (1<<7) 119 #define BMI055_GYR_DRDY_INT1 (1<<0) 122 #define BMI055_GYRO_DEFAULT_RANGE_DPS 2000 123 #define BMI055_GYRO_DEFAULT_RATE 1000 124 #define BMI055_GYRO_MAX_RATE 1000 125 #define BMI055_GYRO_MAX_PUBLISH_RATE 280 127 #define BMI055_GYRO_DEFAULT_DRIVER_FILTER_FREQ 50 130 #define BMI055_GYRO_BW_MASK 0x0F 132 #define BMI055_ACC_TEMP 0x08 170 #define BMI055_GYRO_NUM_CHECKED_REGISTERS 7 203 void modify_reg(
unsigned reg, uint8_t clearbits, uint8_t setbits);
235 #pragma pack(push, 1)
int gyro_set_sample_rate(float desired_sample_rate_hz)
uint8_t _checked_bad[BMI055_GYRO_NUM_CHECKED_REGISTERS]
void check_registers(void)
Report conversation within the BMI055_gyro, including command byte and interrupt status.
int set_gyro_range(unsigned max_dps)
Set the BMI055_gyro measurement range.
Namespace encapsulating all device framework classes, functions and data.
void measure()
Fetch measurements from the sensor and update the report buffers.
Rotation
Enum for board and external compass rotations.
perf_counter_t _bad_registers
static const uint8_t _checked_registers[BMI055_GYRO_NUM_CHECKED_REGISTERS]
perf_counter_t _bad_transfers
void stop()
Stop automatic measurement.
uint8_t _checked_values[BMI055_GYRO_NUM_CHECKED_REGISTERS]
#define BMI055_GYRO_NUM_CHECKED_REGISTERS
void modify_reg(unsigned reg, uint8_t clearbits, uint8_t setbits)
Modify a register in the BMI055_gyro.
BMI055_gyro(int bus, const char *path_gyro, uint32_t device, enum Rotation rotation)
void write_checked_reg(unsigned reg, uint8_t value)
Write a register in the BMI055_gyro, updating _checked_values.
perf_counter_t _sample_perf
BMI055_gyro operator=(const BMI055_gyro &)
void print_info()
Diagnostics - print some basic information about the driver.