48 #define DIR_WRITE 0x00 59 #define ICM20948_LOW_SPI_BUS_SPEED 1000*1000 60 #define ICM20948_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 ICM20948_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);
179 PX4_WARN(
"probe failed! %u", whoami);
#define ICM20948_LOW_SPI_BUS_SPEED
int write(unsigned address, void *data, unsigned count) override
ICM20948_SPI(int bus, uint32_t device)
device::Device * ICM20948_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.
#define ICM20948_IS_HIGH_SPEED(r)
Fundamental base class for all physical drivers (I2C, SPI).
#define ICM20948_HIGH_SPI_BUS_SPEED
#define DRV_DEVTYPE_ICM20948
int read(unsigned address, void *data, unsigned count) override
~ICM20948_SPI() override=default
void set_bus_frequency(unsigned ®_speed_reg_out)