48 class MPU9250_I2C :
public device::I2C
51 MPU9250_I2C(
int bus, uint32_t address);
52 ~MPU9250_I2C()
override =
default;
54 int read(
unsigned address,
void *
data,
unsigned count)
override;
55 int write(
unsigned address,
void *
data,
unsigned count)
override;
67 return new MPU9250_I2C(bus, address);
70 MPU9250_I2C::MPU9250_I2C(
int bus, uint32_t address) :
71 I2C(
"MPU9250_I2C", nullptr, bus, address, 400000)
81 if (
sizeof(cmd) < (count + 1)) {
86 cmd[1] = *(uint8_t *)data;
87 return transfer(&cmd[0], count + 1,
nullptr, 0);
101 return transfer(&cmd, 1, &((uint8_t *)data)[offset], count);
static struct vehicle_status_s status
device::Device * MPU9250_I2C_interface(int bus, uint32_t address)
static void read(bootloader_app_shared_t *pshared)
Report conversation within the mpu, including command byte and interrupt status.
static void write(bootloader_app_shared_t *pshared)
Fundamental base class for all physical drivers (I2C, SPI).
#define DRV_ACC_DEVTYPE_MPU9250
Base class for devices connected via I2C.