Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
MPU-60X0 driver common interface (I2C and SPI). More...
Go to the source code of this file.
Data Structures | |
struct | Mpu60x0I2cSlave |
struct | Mpu60x0Config |
Macros | |
#define | MPU60X0_DEFAULT_SMPLRT_DIV 0 |
Default sample rate divider. More... | |
#define | MPU60X0_DEFAULT_FS_SEL MPU60X0_GYRO_RANGE_2000 |
Default gyro full scale range +- 2000°/s. More... | |
#define | MPU60X0_DEFAULT_AFS_SEL MPU60X0_ACCEL_RANGE_16G |
Default accel full scale range +- 16g. More... | |
#define | MPU60X0_DEFAULT_DLPF_CFG MPU60X0_DLPF_42HZ |
Default internal sampling (1kHz, 42Hz LP Bandwidth) More... | |
#define | MPU60X0_DEFAULT_INT_CFG 1 |
Default interrupt config: DATA_RDY_EN. More... | |
#define | MPU60X0_DEFAULT_CLK_SEL 1 |
Default clock: PLL with X gyro reference. More... | |
#define | MPU60X0_I2C_NB_SLAVES 5 |
Typedefs | |
typedef void(* | Mpu60x0ConfigSet )(void *mpu, uint8_t _reg, uint8_t _val) |
Configuration function prototype. More... | |
typedef bool(* | Mpu60x0I2cSlaveConfigure )(Mpu60x0ConfigSet mpu_set, void *mpu) |
function prototype for configuration of a single I2C slave More... | |
Functions | |
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. More... | |
bool | mpu60x0_configure_i2c_slaves (Mpu60x0ConfigSet mpu_set, void *mpu) |
Configure I2C slaves of the MPU. More... | |
MPU-60X0 driver common interface (I2C and SPI).
Definition in file mpu60x0.h.
struct Mpu60x0I2cSlave |
Data Fields | ||
---|---|---|
Mpu60x0I2cSlaveConfigure | configure |
struct Mpu60x0Config |
Data Fields | ||
---|---|---|
enum Mpu60x0AccelRanges | accel_range | g Range |
uint8_t | clk_sel | Clock select. |
enum Mpu60x0DLPF | dlpf_cfg | Digital Low Pass Filter. |
bool | drdy_int_enable | Enable Data Ready Interrupt. |
enum Mpu60x0GyroRanges | gyro_range | deg/s Range |
bool | i2c_bypass |
Bypass MPU I2C. Only effective if using the I2C implementation. |
enum Mpu60x0MstClk | i2c_mst_clk | MPU I2C master clock speed. |
uint8_t | i2c_mst_delay | MPU I2C slaves delayed sample rate. |
enum Mpu60x0ConfStatus | init_status | init status |
bool | initialized | config done flag |
uint8_t | nb_bytes | number of bytes to read starting with MPU60X0_REG_INT_STATUS |
uint8_t | nb_slave_init | number of already configured/initialized slaves |
uint8_t | nb_slaves | number of used I2C slaves |
struct Mpu60x0I2cSlave | slaves[MPU60X0_I2C_NB_SLAVES] | I2C slaves. |
uint8_t | smplrt_div | Sample rate divider. |
#define MPU60X0_DEFAULT_AFS_SEL MPU60X0_ACCEL_RANGE_16G |
Default accel full scale range +- 16g.
Definition at line 41 of file mpu60x0.h.
Referenced by mpu60x0_set_default_config().
#define MPU60X0_DEFAULT_CLK_SEL 1 |
Default clock: PLL with X gyro reference.
Definition at line 47 of file mpu60x0.h.
Referenced by mpu60x0_set_default_config().
#define MPU60X0_DEFAULT_DLPF_CFG MPU60X0_DLPF_42HZ |
Default internal sampling (1kHz, 42Hz LP Bandwidth)
Definition at line 43 of file mpu60x0.h.
Referenced by mpu60x0_set_default_config().
#define MPU60X0_DEFAULT_FS_SEL MPU60X0_GYRO_RANGE_2000 |
Default gyro full scale range +- 2000°/s.
Definition at line 39 of file mpu60x0.h.
Referenced by mpu60x0_set_default_config().
#define MPU60X0_DEFAULT_INT_CFG 1 |
#define MPU60X0_DEFAULT_SMPLRT_DIV 0 |
Default sample rate divider.
Definition at line 37 of file mpu60x0.h.
Referenced by mpu60x0_set_default_config().
#define MPU60X0_I2C_NB_SLAVES 5 |
Definition at line 51 of file mpu60x0.h.
Referenced by mpu60x0_configure_i2c_slaves().
typedef bool(* Mpu60x0I2cSlaveConfigure)(Mpu60x0ConfigSet mpu_set, void *mpu) |
enum Mpu60x0ConfStatus |
bool mpu60x0_configure_i2c_slaves | ( | Mpu60x0ConfigSet | mpu_set, |
void * | mpu | ||
) |
Configure I2C slaves of the MPU.
This is I2C/SPI implementation specific.
mpu_set | configuration function |
mpu | Mpu60x0Spi or Mpu60x0I2c peripheral |
Configure I2C slaves of the MPU.
Definition at line 134 of file mpu60x0_i2c.c.
References Mpu60x0_Spi::config, Mpu60x0_I2c::config, Mpu60x0I2cSlave::configure, Mpu60x0Config::i2c_bypass, Mpu60x0Config::i2c_mst_clk, Mpu60x0Config::i2c_mst_delay, MPU60X0_I2C_CONF_DONE, MPU60X0_I2C_CONF_I2C_BYPASS_DIS, MPU60X0_I2C_CONF_I2C_BYPASS_EN, 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_I2C_SMPLRT, MPU60X0_I2C_CONF_SLAVES_CONFIGURE, MPU60X0_I2C_CONF_UNINIT, MPU60X0_I2C_IF_DIS, MPU60X0_I2C_MST_EN, MPU60X0_I2C_NB_SLAVES, MPU60X0_REG_I2C_MST_CTRL, MPU60X0_REG_I2C_MST_DELAY, MPU60X0_REG_I2C_SLV4_CTRL, MPU60X0_REG_INT_PIN_CFG, MPU60X0_REG_USER_CTRL, MPU60X0_SPI_CONF_DONE, MPU60X0_SPI_CONF_I2C_MST_CLK, MPU60X0_SPI_CONF_I2C_MST_DELAY, MPU60X0_SPI_CONF_I2C_MST_EN, MPU60X0_SPI_CONF_SLAVES_CONFIGURE, MPU60X0_SPI_CONF_UNINIT, Mpu60x0Config::nb_slave_init, Mpu60x0Config::nb_slaves, Mpu60x0_Spi::slave_init_status, Mpu60x0_I2c::slave_init_status, and Mpu60x0Config::slaves.
Referenced by mpu60x0_send_config().
void mpu60x0_send_config | ( | Mpu60x0ConfigSet | mpu_set, |
void * | mpu, | ||
struct Mpu60x0Config * | config | ||
) |
Configuration sequence called once before normal use.
Definition at line 52 of file mpu60x0.c.
References Mpu60x0Config::accel_range, Mpu60x0Config::clk_sel, Mpu60x0Config::dlpf_cfg, Mpu60x0Config::drdy_int_enable, Mpu60x0Config::gyro_range, Mpu60x0Config::init_status, Mpu60x0Config::initialized, MPU60X0_CONF_ACCEL, MPU60X0_CONF_DLPF, MPU60X0_CONF_DONE, MPU60X0_CONF_GYRO, MPU60X0_CONF_I2C_SLAVES, MPU60X0_CONF_INT_ENABLE, MPU60X0_CONF_PWR, MPU60X0_CONF_RESET, MPU60X0_CONF_SD, MPU60X0_CONF_USER_RESET, mpu60x0_configure_i2c_slaves(), MPU60X0_FIFO_RESET, MPU60X0_I2C_MST_RESET, MPU60X0_REG_ACCEL_CONFIG, MPU60X0_REG_CONFIG, MPU60X0_REG_GYRO_CONFIG, MPU60X0_REG_INT_ENABLE, MPU60X0_REG_PWR_MGMT_1, MPU60X0_REG_SMPLRT_DIV, MPU60X0_REG_USER_CTRL, MPU60X0_SIG_COND_RESET, Mpu60x0Config::nb_slaves, and Mpu60x0Config::smplrt_div.
Referenced by mpu60x0_i2c_event(), mpu60x0_i2c_start_configure(), mpu60x0_spi_event(), and mpu60x0_spi_start_configure().
void mpu60x0_set_default_config | ( | struct Mpu60x0Config * | c | ) |
Definition at line 32 of file mpu60x0.c.
References Mpu60x0Config::accel_range, Mpu60x0Config::clk_sel, Mpu60x0Config::dlpf_cfg, Mpu60x0Config::drdy_int_enable, Mpu60x0Config::gyro_range, Mpu60x0Config::i2c_bypass, MPU60X0_DEFAULT_AFS_SEL, MPU60X0_DEFAULT_CLK_SEL, MPU60X0_DEFAULT_DLPF_CFG, MPU60X0_DEFAULT_FS_SEL, MPU60X0_DEFAULT_SMPLRT_DIV, Mpu60x0Config::nb_bytes, Mpu60x0Config::nb_slave_init, Mpu60x0Config::nb_slaves, and Mpu60x0Config::smplrt_div.
Referenced by mpu60x0_i2c_init(), and mpu60x0_spi_init().