|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
126 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
135 if (bit_is_set(mpu->
rx_buf[1], 0)) {
146 mpu->
temp = (float)temp_raw / 361.0
f + 35.0
f;
148 mpu->
temp = (float)temp_raw / 326.8
f + 25.0
f;
156 #pragma GCC diagnostic push
157 #pragma GCC diagnostic ignored "-Wcast-qual"
159 #pragma GCC diagnostic pop
174 if (mpu->config.initialized) {
uint8_t nb_bytes
number of bytes to read starting with MPU60X0_REG_INT_STATUS
struct spi_transaction spi_trans
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
uint8_t nb_slave_init
number of already configured/initialized slaves
enum SPIClockPolarity cpol
clock polarity control
@ MPU60X0_SPI_CONF_SLAVES_CONFIGURE
#define MPU60X0_REG_USER_CTRL
uint16_t output_length
number of data words to write
#define ICM20600_WHOAMI_REPLY
@ MPU60X0_SPI_CONF_UNINIT
uint8_t data_ext[MPU60X0_BUFFER_EXT_LEN]
bool mpu60x0_configure_i2c_slaves(Mpu60x0ConfigSet mpu_set, void *mpu)
configure the registered I2C slaves
@ MPU60X0_SPI_CONF_I2C_MST_EN
enum Mpu60x0MstClk i2c_mst_clk
MPU I2C master clock speed.
#define MPU60X0_WHOAMI_REPLY
@ SPISelectUnselect
slave is selected before transaction and unselected after
#define MPU60X0_REG_I2C_MST_CTRL
#define MPU60X0_REG_WHO_AM_I
enum SPIBitOrder bitorder
MSB/LSB order.
void(* Mpu60x0ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
SPI peripheral structure.
enum SPISlaveSelect select
slave selection behavior
static void mpu60x0_spi_write_to_reg(void *mpu, uint8_t _reg, uint8_t _val)
#define MPU60X0_REG_I2C_MST_DELAY
Mpu60x0I2cSlaveConfigure configure
#define MPU60X0_BUFFER_LEN
struct spi_periph * spi_p
enum SPIClockPhase cpha
clock phase control
SPICallback after_cb
NULL or function called after the transaction.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
void mpu60x0_send_config(Mpu60x0ConfigSet mpu_set, void *mpu, struct Mpu60x0Config *config)
Configuration sequence called once before normal use.
#define MPU60X0_I2C_IF_DIS
#define Int16FromBuf(_buf, _idx)
@ SPICpolIdleHigh
CPOL = 1.
enum Mpu60x0ConfStatus init_status
init status
enum Mpu60x0SpiSlaveInitStatus slave_init_status
#define ICM20689_WHOAMI_REPLY
void mpu60x0_spi_start_configure(struct Mpu60x0_Spi *mpu)
void mpu60x0_spi_read(struct Mpu60x0_Spi *mpu)
#define ICM20602_WHOAMI_REPLY
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
@ MPU60X0_SPI_CONF_I2C_MST_CLK
#define MPU60X0_I2C_NB_SLAVES
uint8_t nb_slaves
number of used I2C slaves
uint16_t input_length
number of data words to read
enum SPIDataSizeSelect dss
data transfer word size
#define MPU60X0_REG_INT_STATUS
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
union Mpu60x0_Spi::@333 data_accel
uint8_t i2c_mst_delay
MPU I2C slaves delayed sample rate.
struct Mpu60x0I2cSlave slaves[MPU60X0_I2C_NB_SLAVES]
I2C slaves.
volatile uint8_t * input_buf
pointer to receive buffer for DMA
volatile bool data_available
data ready flag
float temp
temperature in degrees Celcius
@ MPU60X0_SPI_CONF_I2C_MST_DELAY
volatile uint8_t tx_buf[2]
void mpu60x0_set_default_config(struct Mpu60x0Config *c)
SPICallback before_cb
NULL or function called before the transaction.
enum Mpu60x0Type type
The type of sensor (MPU60x0, ICM20608, ...)
union Mpu60x0_Spi::@334 data_rates
struct Mpu60x0Config config
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
enum SPITransactionStatus status
#define ICM20608_WHOAMI_REPLY
#define MPU60X0_I2C_MST_EN
volatile uint8_t rx_buf[MPU60X0_BUFFER_LEN]
void mpu60x0_spi_event(struct Mpu60x0_Spi *mpu)
bool initialized
config done flag