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
124 if (mpu->config.initialized) {
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 mpu60x0_set_default_config(struct Mpu60x0Config *c)
void mpu60x0_send_config(Mpu60x0ConfigSet mpu_set, void *mpu, struct Mpu60x0Config *config)
Configuration sequence called once before normal use.
Mpu60x0I2cSlaveConfigure configure
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.
#define MPU60X0_I2C_NB_SLAVES
enum Mpu60x0MstClk i2c_mst_clk
MPU I2C master clock speed.
bool initialized
config done flag
uint8_t nb_bytes
number of bytes to read starting with MPU60X0_REG_INT_STATUS
uint8_t nb_slaves
number of used I2C slaves
uint8_t nb_slave_init
number of already configured/initialized slaves
struct Mpu60x0I2cSlave slaves[MPU60X0_I2C_NB_SLAVES]
I2C slaves.
bool i2c_bypass
Bypass MPU I2C.
enum Mpu60x0ConfStatus init_status
init status
void(* Mpu60x0ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void mpu60x0_i2c_start_configure(struct Mpu60x0_I2c *mpu)
static void mpu60x0_i2c_write_to_reg(void *mpu, uint8_t _reg, uint8_t _val)
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
#define Int16FromBuf(_buf, _idx)
bool mpu60x0_configure_i2c_slaves(Mpu60x0ConfigSet mpu_set, void *mpu)
configure the registered I2C slaves
void mpu60x0_i2c_read(struct Mpu60x0_I2c *mpu)
Driver for the MPU-60X0 using I2C.
struct i2c_transaction i2c_trans
union Mpu60x0_I2c::@341 data_accel
volatile bool data_available
data ready flag
uint8_t data_ext[MPU60X0_BUFFER_EXT_LEN]
union Mpu60x0_I2c::@342 data_rates
enum Mpu60x0I2cSlaveInitStatus slave_init_status
struct i2c_periph * i2c_p
@ MPU60X0_I2C_CONF_I2C_BYPASS_DIS
@ MPU60X0_I2C_CONF_I2C_MST_CLK
@ MPU60X0_I2C_CONF_I2C_MST_DELAY
@ MPU60X0_I2C_CONF_I2C_MST_DIS
@ MPU60X0_I2C_CONF_I2C_MST_EN
@ MPU60X0_I2C_CONF_UNINIT
@ MPU60X0_I2C_CONF_I2C_BYPASS_EN
@ MPU60X0_I2C_CONF_SLAVES_CONFIGURE
@ MPU60X0_I2C_CONF_I2C_SMPLRT
float temp
temperature in degrees Celcius
struct Mpu60x0Config config
#define MPU60X0_REG_USER_CTRL
#define MPU60X0_REG_INT_PIN_CFG
#define MPU60X0_REG_I2C_SLV4_CTRL
#define MPU60X0_REG_INT_STATUS
#define MPU60X0_REG_I2C_MST_CTRL
#define MPU60X0_I2C_MST_EN
#define MPU60X0_REG_I2C_MST_DELAY
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.