52 ScheduledWorkItem(MODULE_NAME,
px4::device_bus_to_wq(get_device_id())),
103 uint8_t retries = 10;
149 if (frequency <= 100) {
153 }
else if (frequency <= 250) {
157 }
else if (frequency <= 1000) {
161 }
else if (frequency > 1000) {
181 ::printf(
"error triggered\n");
218 if (max_dps <= 125) {
223 }
else if (max_dps <= 250) {
228 }
else if (max_dps <= 500) {
233 }
else if (max_dps <= 1000) {
238 }
else if (max_dps <= 2000) {
347 if (
OK != transfer((uint8_t *)&bmi_gyroreport, ((uint8_t *)&bmi_gyroreport),
sizeof(bmi_gyroreport))) {
356 report.gyro_x = bmi_gyroreport.gyro_x;
357 report.gyro_y = bmi_gyroreport.gyro_y;
358 report.gyro_z = bmi_gyroreport.gyro_z;
360 if (report.temp == 0 &&
361 report.gyro_x == 0 &&
362 report.gyro_y == 0 &&
363 report.gyro_z == 0) {
408 _px4_gyro.
update(timestamp_sample, report.gyro_x, report.gyro_y, report.gyro_z);
429 ::printf(
"reg %02x:%02x should be %02x\n",
436 ::printf(
"reg %02x:%02x was bad %02x\n",
450 printf(
"BMI055 gyro registers\n");
454 printf(
"Gyro Chip Id: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
459 printf(
"Gyro Power: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
464 printf(
"Gyro Bw: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
469 printf(
"Gyro Range: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
474 printf(
"Gyro Int-en-0: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
479 printf(
"Gyro Int-en-1: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
484 printf(
"Gyro Int-Map-1: %02x:%02x ", (
unsigned)reg, (
unsigned)v);
#define BMI055_GYRO_RATE_2000
#define BMI055_GYRO_DEFAULT_RANGE_DPS
#define BMI055_GYR_CHIP_ID
#define BMI055_GYR_WHO_AM_I
measure the time elapsed performing an event
int gyro_set_sample_rate(float desired_sample_rate_hz)
#define BMI055_SOFT_RESET
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.
#define BMI055_GYRO_RANGE_1000_DPS
#define BMI055_GYRO_DEFAULT_RATE
#define BMI055_GYRO_RANGE_125_DPS
#define BMI055_GYRO_NORMAL
int set_gyro_range(unsigned max_dps)
Set the BMI055_gyro measurement range.
Namespace encapsulating all device framework classes, functions and data.
count the number of times an event occurs
#define BMI055_GYRO_BW_MASK
#define BMI055_TIMER_REDUCTION
#define BMI055_GYRO_RATE_400
void write_reg(unsigned reg, uint8_t value)
Write a register in the BMI055.
void set_device_type(uint8_t devtype)
#define BMI055_GYR_DRDY_INT_EN
uint8_t read_reg(unsigned reg)
Read a register from the BMI055.
#define BMI055_GYRO_RANGE_500_DPS
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.
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 BMI055_GYR_SOFTRESET
perf_counter_t _bad_registers
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
#define BMI055_GYRO_RATE_100
static const uint8_t _checked_registers[BMI055_GYRO_NUM_CHECKED_REGISTERS]
#define BMI055_GYRO_RANGE_2000_DPS
void set_error_count(uint64_t error_count)
void perf_end(perf_counter_t handle)
End a performance event.
#define BMI055_GYR_INT_EN_1
uint8_t _register_wait
whoami result
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
perf_counter_t _bad_transfers
#define DRV_GYR_DEVTYPE_BMI055
#define BMI055_GYR_INT_EN_0
void stop()
Stop automatic measurement.
void set_temperature(float temperature)
uint8_t _checked_values[BMI055_GYRO_NUM_CHECKED_REGISTERS]
#define BMI055_GYRO_NUM_CHECKED_REGISTERS
#define BMI055_GYRO_RANGE_250_DPS
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.
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.
void set_scale(float scale)
#define BMI055_GYRO_RATE_1000
#define BMI055_GYR_DRDY_INT1
void perf_begin(perf_counter_t handle)
Begin a performance event.
perf_counter_t _sample_perf
#define DEVICE_DEBUG(FMT,...)
#define BMI055_GYR_INT_MAP_1
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
void print_info()
Diagnostics - print some basic information about the driver.