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
145 if (mpu->config.initialized) {
153 #if IMU_MPU9250_READ_MAG
void ak8963_event(struct Ak8963 *ak)
void ak8963_configure(struct Ak8963 *ak)
void ak8963_init(struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
Initialize AK8963 struct.
void ak8963_read(struct Ak8963 *ak)
bool initialized
config done flag
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
uint8_t slave_addr
Slave address.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
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.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
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.
void mpu9250_set_default_config(struct Mpu9250Config *c)
Mpu9250I2cSlaveConfigure configure
void(* Mpu9250ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
uint8_t nb_slave_init
number of already configured/initialized slaves
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.
enum Mpu9250MstClk i2c_mst_clk
MPU I2C master clock speed.
uint8_t nb_slaves
number of used I2C slaves
uint8_t nb_bytes
number of bytes to read starting with MPU9250_REG_INT_STATUS
#define MPU9250_I2C_NB_SLAVES
bool i2c_bypass
Bypass MPU I2C.
enum Mpu9250ConfStatus init_status
init status
struct Mpu9250I2cSlave slaves[MPU9250_I2C_NB_SLAVES]
I2C slaves.
bool initialized
config done flag
void mpu9250_i2c_event(struct Mpu9250_I2c *mpu)
bool 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_read(struct Mpu9250_I2c *mpu)
void mpu9250_i2c_init(struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void mpu9250_i2c_start_configure(struct Mpu9250_I2c *mpu)
bool mpu9250_configure_i2c_slaves(Mpu9250ConfigSet mpu_set, void *mpu)
configure the registered I2C slaves
#define Int16FromBuf(_buf, _idx)
Driver for the MPU-9250 using I2C.
union Mpu9250_I2c::@346 data_rates
struct Mpu9250Config config
uint8_t data_ext[MPU9250_BUFFER_EXT_LEN]
struct i2c_transaction i2c_trans
struct Ak8963 akm
"internal" magnetometer
union Mpu9250_I2c::@345 data_accel
enum Mpu9250I2cSlaveInitStatus slave_init_status
struct i2c_periph * i2c_p
@ MPU9250_I2C_CONF_I2C_SMPLRT
@ MPU9250_I2C_CONF_I2C_BYPASS_EN
@ MPU9250_I2C_CONF_UNINIT
@ MPU9250_I2C_CONF_I2C_MST_DELAY
@ MPU9250_I2C_CONF_I2C_MST_EN
@ MPU9250_I2C_CONF_I2C_MST_DIS
@ MPU9250_I2C_CONF_I2C_BYPASS_DIS
@ MPU9250_I2C_CONF_I2C_MST_CLK
@ MPU9250_I2C_CONF_SLAVES_CONFIGURE
volatile bool data_available
data ready flag
#define MPU9250_REG_I2C_MST_DELAY
#define MPU9250_REG_I2C_MST_CTRL
#define MPU9250_I2C_MST_EN
#define MPU9250_REG_INT_PIN_CFG
#define MPU9250_REG_USER_CTRL
#define MPU9250_REG_I2C_SLV4_CTRL
#define MPU9250_REG_INT_STATUS
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.