31 void *mpu __attribute__((unused)));
91 #ifdef MPU9250_MAG_PRESCALER
99 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
122 #pragma GCC diagnostic push
123 #pragma GCC diagnostic ignored "-Wcast-qual"
125 #pragma GCC diagnostic pop
enum Mpu9250MstClk i2c_mst_clk
MPU I2C master clock speed.
Mpu9250I2cSlaveConfigure configure
union Mpu9250_I2c::@46 data_rates
struct i2c_transaction i2c_trans
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
#define MPU9250_REG_INT_STATUS
transaction successfully finished by I2C driver
struct Mpu9250Config config
enum Mpu9250ConfStatus init_status
init status
uint8_t nb_bytes
number of bytes to read starting with MPU9250_REG_INT_STATUS
bool_t imu_mpu9250_configure_mag_slave(Mpu9250ConfigSet mpu_set, void *mpu)
callback function to configure ak8963 mag
static void mpu9250_i2c_write_to_reg(void *mpu, uint8_t _reg, uint8_t _val)
void mpu9250_i2c_init(struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
uint8_t data_ext[MPU9250_BUFFER_EXT_LEN]
void ak8963_init(struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
Initialize AK8963 struct.
void mpu9250_i2c_start_configure(struct Mpu9250_I2c *mpu)
bool_t i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
void mpu9250_i2c_event(struct Mpu9250_I2c *mpu)
bool_t initialized
config done flag
union Mpu9250_I2c::@45 data_accel
void ak8963_read(struct Ak8963 *ak)
struct Mpu9250I2cSlave slaves[5]
I2C slaves.
struct Ak8963 akm
"internal" magnetometer
transaction set to done by user level
void mpu9250_send_config(Mpu9250ConfigSet mpu_set, void *mpu, struct Mpu9250Config *config)
Configuration sequence called once before normal use.
#define MPU9250_REG_I2C_MST_CTRL
bool_t i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
void(* Mpu9250ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
bool_t i2c_bypass
Bypass MPU I2C.
void mpu9250_set_default_config(struct Mpu9250Config *c)
#define MPU9250_REG_I2C_SLV4_CTRL
uint8_t nb_slaves
number of used I2C slaves
enum Mpu9250I2cSlaveInitStatus slave_init_status
enum I2CTransactionStatus status
Transaction status.
void mpu9250_i2c_read(struct Mpu9250_I2c *mpu)
volatile bool_t data_available
data ready flag
#define MPU9250_REG_I2C_MST_DELAY
uint8_t slave_addr
Slave address.
I2C peripheral structure.
bool_t mpu9250_configure_i2c_slaves(Mpu9250ConfigSet mpu_set, void *mpu)
Configure I2C slaves of the MPU.
bool_t initialized
config done flag
void ak8963_event(struct Ak8963 *ak)
#define MPU9250_REG_USER_CTRL
#define MPU9250_I2C_MST_EN
#define MPU9250_REG_INT_PIN_CFG
#define Int16FromBuf(_buf, _idx)
void ak8963_configure(struct Ak8963 *ak)
struct i2c_periph * i2c_p
Driver for the MPU-9250 using I2C.
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.