|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
107 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
116 if (bit_is_set(mpu->
rx_buf[1], 0)) {
130 #pragma GCC diagnostic push
131 #pragma GCC diagnostic ignored "-Wcast-qual"
133 #pragma GCC diagnostic pop
148 if (mpu->config.initialized) {
struct spi_periph * spi_p
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
#define MPU9250_BUFFER_LEN
enum Mpu9250MstClk i2c_mst_clk
MPU I2C master clock speed.
Mpu9250I2cSlaveConfigure configure
uint8_t data_ext[MPU9250_BUFFER_EXT_LEN]
enum SPIClockPolarity cpol
clock polarity control
union Mpu9250_Spi::@338 data_rates
void mpu9250_spi_event(struct Mpu9250_Spi *mpu)
@ MPU9250_SPI_CONF_I2C_MST_EN
uint8_t nb_bytes
number of bytes to read starting with MPU9250_REG_INT_STATUS
void mpu9250_spi_start_configure(struct Mpu9250_Spi *mpu)
uint16_t output_length
number of data words to write
enum Mpu9250ConfStatus init_status
init status
static void mpu9250_spi_write_to_reg(void *mpu, uint8_t _reg, uint8_t _val)
void mpu9250_spi_init(struct Mpu9250_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
#define MPU9250_REG_INT_STATUS
@ SPISelectUnselect
slave is selected before transaction and unselected after
enum SPIBitOrder bitorder
MSB/LSB order.
void mpu9250_send_config(Mpu9250ConfigSet mpu_set, void *mpu, struct Mpu9250Config *config)
Configuration sequence called once before normal use.
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
SPI peripheral structure.
enum SPISlaveSelect select
slave selection behavior
void mpu9250_spi_read(struct Mpu9250_Spi *mpu)
#define MPU9250_REG_I2C_MST_CTRL
void mpu9250_set_default_config(struct Mpu9250Config *c)
enum SPIClockPhase cpha
clock phase control
SPICallback after_cb
NULL or function called after the transaction.
struct spi_transaction spi_trans
volatile uint8_t rx_buf[MPU9250_BUFFER_LEN]
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
enum Mpu9250SpiSlaveInitStatus slave_init_status
@ SPICpolIdleHigh
CPOL = 1.
union Mpu9250_Spi::@337 data_accel
#define MPU9250_I2C_NB_SLAVES
uint8_t nb_slaves
number of used I2C slaves
#define MPU9250_I2C_IF_DIS
uint16_t input_length
number of data words to read
#define MPU9250_REG_WHO_AM_I
enum SPIDataSizeSelect dss
data transfer word size
#define MPU9250_REG_I2C_MST_DELAY
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
@ MPU9250_SPI_CONF_I2C_MST_CLK
volatile uint8_t * input_buf
pointer to receive buffer for DMA
void(* Mpu9250ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
volatile bool data_available
data ready flag
#define MPU9250_I2C_MST_EN
@ MPU9250_SPI_CONF_I2C_MST_DELAY
bool mpu9250_configure_i2c_slaves(Mpu9250ConfigSet mpu_set, void *mpu)
configure the registered I2C slaves
SPICallback before_cb
NULL or function called before the transaction.
struct Mpu9250I2cSlave slaves[MPU9250_I2C_NB_SLAVES]
I2C slaves.
#define MPU9250_REG_USER_CTRL
struct Mpu9250Config config
#define Int16FromBuf(_buf, _idx)
bool initialized
config done flag
@ MPU9250_SPI_CONF_UNINIT
enum SPITransactionStatus status
#define MPU9250_WHOAMI_REPLY
uint8_t nb_slave_init
number of already configured/initialized slaves
volatile uint8_t tx_buf[2]
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.
@ MPU9250_SPI_CONF_SLAVES_CONFIGURE