31 void *mpu __attribute__((unused)));
50 #if IMU_MPU9250_READ_MAG
94 #if IMU_MPU9250_READ_MAG
95 #ifdef MPU9250_MAG_PRESCALER
104 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
127 #pragma GCC diagnostic push
128 #pragma GCC diagnostic ignored "-Wcast-qual"
130 #pragma GCC diagnostic pop
153 #if IMU_MPU9250_READ_MAG
enum Mpu9250MstClk i2c_mst_clk
MPU I2C master clock speed.
Mpu9250I2cSlaveConfigure configure
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
union Mpu9250_I2c::@318 data_rates
transaction successfully finished by I2C driver
struct Mpu9250Config config
volatile bool data_available
data ready flag
enum Mpu9250ConfStatus init_status
init status
uint8_t nb_bytes
number of bytes to read starting with MPU9250_REG_INT_STATUS
static void mpu9250_i2c_write_to_reg(void *mpu, uint8_t _reg, uint8_t _val)
bool imu_mpu9250_configure_mag_slave(Mpu9250ConfigSet mpu_set, void *mpu)
callback function to configure ak8963 mag
void mpu9250_i2c_init(struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
union Mpu9250_I2c::@317 data_accel
bool mpu9250_configure_i2c_slaves(Mpu9250ConfigSet mpu_set, void *mpu)
configure the registered I2C slaves
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 initialized
config done flag
void mpu9250_i2c_event(struct Mpu9250_I2c *mpu)
bool i2c_bypass
Bypass MPU I2C.
void ak8963_read(struct Ak8963 *ak)
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
void(* Mpu9250ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
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
bool 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.
enum I2CTransactionStatus status
Transaction status.
void mpu9250_i2c_read(struct Mpu9250_I2c *mpu)
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
#define MPU9250_REG_I2C_MST_DELAY
uint8_t slave_addr
Slave address.
I2C peripheral structure.
void ak8963_event(struct Ak8963 *ak)
#define MPU9250_REG_USER_CTRL
#define MPU9250_I2C_MST_EN
struct Mpu9250I2cSlave slaves[MPU9250_I2C_NB_SLAVES]
I2C slaves.
#define MPU9250_REG_INT_PIN_CFG
#define Int16FromBuf(_buf, _idx)
uint8_t nb_slave_init
number of already configured/initialized slaves
void ak8963_configure(struct Ak8963 *ak)
#define MPU9250_I2C_NB_SLAVES
bool initialized
config done flag
struct i2c_periph * i2c_p
Driver for the MPU-9250 using I2C.
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.