80 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
99 mpu->
temp = (float)temp_raw / 340.0f + 36.53f;
106 #pragma GCC diagnostic push
107 #pragma GCC diagnostic ignored "-Wcast-qual"
109 #pragma GCC diagnostic pop
uint8_t data_ext[MPU60X0_BUFFER_EXT_LEN]
#define MPU60X0_REG_USER_CTRL
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
#define MPU60X0_I2C_MST_EN
transaction successfully finished by I2C driver
bool initialized
config done flag
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
struct Mpu60x0Config config
uint8_t nb_slave_init
number of already configured/initialized slaves
#define MPU60X0_REG_I2C_MST_CTRL
union Mpu60x0_I2c::@312 data_accel
#define Int16FromBuf(_buf, _idx)
void mpu60x0_i2c_read(struct Mpu60x0_I2c *mpu)
#define MPU60X0_REG_INT_PIN_CFG
Mpu60x0I2cSlaveConfigure configure
struct i2c_transaction i2c_trans
float temp
temperature in degrees Celcius
enum Mpu60x0ConfStatus init_status
init status
enum Mpu60x0MstClk i2c_mst_clk
MPU I2C master clock speed.
union Mpu60x0_I2c::@313 data_rates
transaction set to done by user level
#define MPU60X0_REG_I2C_MST_DELAY
#define MPU60X0_I2C_NB_SLAVES
uint8_t nb_slaves
number of used I2C slaves
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.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
void mpu60x0_send_config(Mpu60x0ConfigSet mpu_set, void *mpu, struct Mpu60x0Config *config)
Configuration sequence called once before normal use.
#define MPU60X0_REG_INT_STATUS
uint8_t slave_addr
Slave address.
Driver for the MPU-60X0 using I2C.
I2C peripheral structure.
#define MPU60X0_REG_I2C_SLV4_CTRL
bool mpu60x0_configure_i2c_slaves(Mpu60x0ConfigSet mpu_set, void *mpu)
configure the registered I2C slaves
void mpu60x0_i2c_start_configure(struct Mpu60x0_I2c *mpu)
static void mpu60x0_i2c_write_to_reg(void *mpu, uint8_t _reg, uint8_t _val)
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.
bool i2c_bypass
Bypass MPU I2C.
enum Mpu60x0I2cSlaveInitStatus slave_init_status
void mpu60x0_set_default_config(struct Mpu60x0Config *c)
struct i2c_periph * i2c_p
uint8_t nb_bytes
number of bytes to read starting with MPU60X0_REG_INT_STATUS
struct Mpu60x0I2cSlave slaves[MPU60X0_I2C_NB_SLAVES]
I2C slaves.
void(* Mpu60x0ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
volatile bool data_available
data ready flag