60 ScheduledWorkItem(MODULE_NAME,
px4::device_bus_to_wq(get_device_id())),
111 uint8_t retries = 10;
147 printf(
"unexpected whoami 0x%02x\n",
_whoami);
158 if (frequency <= 100) {
162 }
else if (frequency <= 250) {
166 }
else if (frequency <= 1000) {
170 }
else if (frequency > 1000) {
190 ::printf(
"error triggered\n");
227 if (max_dps <= 125) {
232 }
else if (max_dps <= 250) {
237 }
else if (max_dps <= 500) {
242 }
else if (max_dps <= 1000) {
247 }
else if (max_dps <= 2000) {
364 if (
OK != transfer((uint8_t *)&bmi_gyroreport, ((uint8_t *)&bmi_gyroreport),
sizeof(bmi_gyroreport))) {
374 report.gyro_x = bmi_gyroreport.gyro_x;
375 report.gyro_y = bmi_gyroreport.gyro_y;
376 report.gyro_z = bmi_gyroreport.gyro_z;
378 if (report.gyro_x == 0 &&
379 report.gyro_y == 0 &&
380 report.gyro_z == 0) {
422 _px4_gyro.
update(timestamp_sample, report.gyro_x, report.gyro_y, report.gyro_z);
443 ::printf(
"reg %02x:%02x should be %02x\n",
450 ::printf(
"reg %02x:%02x was bad %02x\n",
464 printf(
"BMI088 gyro registers\n");
468 printf(
"Gyro Chip Id: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
473 printf(
"Gyro Power: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
478 printf(
"Gyro Bw: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
483 printf(
"Gyro Range: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
488 printf(
"Gyro Int-en-0: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
493 printf(
"Gyro Int-en-1: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
498 printf(
"Gyro Int-Map-1: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
#define BMI088_GYRO_RANGE_2000_DPS
uint8_t _checked_values[BMI088_GYRO_NUM_CHECKED_REGISTERS]
#define BMI088_GYRO_RANGE_250_DPS
measure the time elapsed performing an event
perf_counter_t _sample_perf
void stop()
Stop automatic measurement.
#define BMI088_GYRO_RATE_2000
virtual uint8_t read_reg(unsigned reg)
Read a register from the BMI088.
void modify_reg(unsigned reg, uint8_t clearbits, uint8_t setbits)
Modify a register in the BMI088_gyro.
uint8_t _register_wait
whoami result
#define BMI088_GYRO_NORMAL
uint8_t _checked_bad[BMI088_GYRO_NUM_CHECKED_REGISTERS]
void check_registers(void)
#define BMI088_GYRO_RANGE_1000_DPS
#define BMI088_GYR_CHIP_ID
static const uint8_t _checked_registers[BMI088_GYRO_NUM_CHECKED_REGISTERS]
__EXPORT float _accel_last_temperature_copy
Namespace encapsulating all device framework classes, functions and data.
count the number of times an event occurs
void set_device_type(uint8_t devtype)
#define BMI088_GYR_INT_MAP_1
#define BMI088_GYRO_NUM_CHECKED_REGISTERS
perf_counter_t _bad_transfers
void update(hrt_abstime timestamp, float x, float y, float z)
void perf_count(perf_counter_t handle)
Count a performance event.
void measure()
Fetch measurements from the sensor and update the report buffers.
#define BMI088_GYRO_RATE_100
static void measure_trampoline(void *arg)
Static trampoline from the hrt_call context; because we don't have a generic hrt wrapper yet...
void perf_free(perf_counter_t handle)
Free a counter.
void init()
Activates/configures the hardware registers.
Rotation
Enum for board and external compass rotations.
#define BMI088_GYR_DRDY_INT_EN
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
void set_error_count(uint64_t error_count)
void perf_end(perf_counter_t handle)
End a performance event.
#define BMI088_GYR_WHO_AM_I
void print_info()
Diagnostics - print some basic information about the driver.
#define BMI088_SOFT_RESET
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
#define BMI088_GYRO_DEFAULT_RANGE_DPS
#define BMI088_GYR_INT_EN_0
perf_counter_t _bad_registers
#define BMI088_GYRO_BW_MASK
Report conversation within the BMI088_gyro, including command byte and interrupt status.
void set_temperature(float temperature)
#define BMI088_GYRO_RANGE_125_DPS
#define BMI088_GYRO_RATE_400
#define BMI088_GYR_DRDY_INT1
void write_checked_reg(unsigned reg, uint8_t value)
Write a register in the BMI088_gyro, updating _checked_values.
#define BMI088_GYRO_DEFAULT_RATE
void perf_print_counter(perf_counter_t handle)
Print one performance counter to stdout.
uint64_t perf_event_count(perf_counter_t handle)
Return current event_count.
#define BMI088_GYR_SOFTRESET
#define BMI088_GYRO_RANGE_500_DPS
#define BMI088_GYR_INT_EN_1
#define BMI088_TIMER_REDUCTION
int gyro_set_sample_rate(float desired_sample_rate_hz)
void set_scale(float scale)
#define BMI088_GYRO_RATE_1000
#define DRV_DEVTYPE_BMI088
void perf_begin(perf_counter_t handle)
Begin a performance event.
#define DEVICE_DEBUG(FMT,...)
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
int set_gyro_range(unsigned max_dps)
Set the BMI088_gyro measurement range.
BMI088_gyro(int bus, const char *path_gyro, uint32_t device, enum Rotation rotation)
void write_reg(unsigned reg, uint8_t value)
Write a register in the BMI088.