48 #define DIR_WRITE 0x00 59 #define MPU9250_LOW_SPI_BUS_SPEED 1000*1000 60 #define MPU9250_HIGH_SPI_BUS_SPEED 20*1000*1000 70 int read(
unsigned address,
void *
data,
unsigned count)
override;
71 int write(
unsigned address,
void *data,
unsigned count)
override;
87 interface = new MPU9250_SPI(bus, cs);
113 if (
sizeof(cmd) < (count + 1)) {
121 cmd[1] = *(uint8_t *)data;
123 return transfer(&cmd[0], &cmd[0], count + 1);
136 uint8_t *pbuff = count <
sizeof(
MPUReport) ? cmd : (uint8_t *)
data ;
149 int ret = transfer(pbuff, pbuff, count);
151 if (ret ==
OK && pbuff == &cmd[0]) {
156 memcpy(data, &cmd[1], count);
180 PX4_WARN(
"probe failed! %u", whoami);
void set_bus_frequency(unsigned ®_speed_reg_out)
MPU9250_SPI(int bus, uint32_t device)
device::Device * MPU9250_SPI_interface(int bus, uint32_t cs)
Namespace encapsulating all device framework classes, functions and data.
Report conversation within the mpu, including command byte and interrupt status.
int write(unsigned address, void *data, unsigned count) override
#define MPU9250_LOW_SPI_BUS_SPEED
~MPU9250_SPI() override=default
#define MPU9250_IS_HIGH_SPEED(r)
#define MPU9250_HIGH_SPI_BUS_SPEED
Fundamental base class for all physical drivers (I2C, SPI).
#define DRV_ACC_DEVTYPE_MPU9250
int read(unsigned address, void *data, unsigned count) override