Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_mpu9250_spi.c File Reference

IMU driver for the MPU9250 using SPI. More...

+ Include dependency graph for imu_mpu9250_spi.c:

Go to the source code of this file.

Macros

#define IMU_MPU9250_SMPLRT_DIV   9
 
#define IMU_MPU9250_GYRO_LOWPASS_FILTER   MPU9250_DLPF_GYRO_41HZ
 
#define IMU_MPU9250_ACCEL_LOWPASS_FILTER   MPU9250_DLPF_ACCEL_41HZ
 
#define IMU_MPU9250_GYRO_RANGE   MPU9250_GYRO_RANGE_1000
 
#define IMU_MPU9250_ACCEL_RANGE   MPU9250_ACCEL_RANGE_8G
 
#define IMU_MPU9250_CHAN_X   0
 
#define IMU_MPU9250_CHAN_Y   1
 
#define IMU_MPU9250_CHAN_Z   2
 
#define IMU_MPU9250_X_SIGN   1
 
#define IMU_MPU9250_Y_SIGN   1
 
#define IMU_MPU9250_Z_SIGN   1
 
#define IMU_MPU9250_READ_MAG   TRUE
 
#define IMU_MPU9250_MAG_STARTUP_DELAY   1
 
#define Int16FromBuf(_buf, _idx)   ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8)))
 

Functions

void mpu_wait_slave4_ready (void)
 
void mpu_wait_slave4_ready_cb (struct spi_transaction *t)
 
bool imu_mpu9250_configure_mag_slave (Mpu9250ConfigSet mpu_set, void *mpu)
 function to configure akm8963 mag More...
 
void imu_mpu9250_init (void)
 
void imu_mpu9250_periodic (void)
 
void imu_mpu9250_event (void)
 
static void mpu_set_and_wait (Mpu9250ConfigSet mpu_set, void *mpu, uint8_t _reg, uint8_t _val)
 

Variables

struct ImuMpu9250 imu_mpu9250
 

Detailed Description

IMU driver for the MPU9250 using SPI.

Definition in file imu_mpu9250_spi.c.

Macro Definition Documentation

#define IMU_MPU9250_ACCEL_LOWPASS_FILTER   MPU9250_DLPF_ACCEL_41HZ

Definition at line 62 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_init().

#define IMU_MPU9250_ACCEL_RANGE   MPU9250_ACCEL_RANGE_8G

Definition at line 76 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_init().

#define IMU_MPU9250_CHAN_X   0

Definition at line 82 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_CHAN_Y   1

Definition at line 86 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_CHAN_Z   2

Definition at line 90 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_GYRO_LOWPASS_FILTER   MPU9250_DLPF_GYRO_41HZ

Definition at line 61 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_init().

#define IMU_MPU9250_GYRO_RANGE   MPU9250_GYRO_RANGE_1000

Definition at line 71 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_init().

#define IMU_MPU9250_MAG_STARTUP_DELAY   1

Definition at line 112 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_configure_mag_slave().

#define IMU_MPU9250_READ_MAG   TRUE

Definition at line 108 of file imu_mpu9250_spi.c.

#define IMU_MPU9250_SMPLRT_DIV   9

Definition at line 60 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_init().

#define IMU_MPU9250_X_SIGN   1

Definition at line 95 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_Y_SIGN   1

Definition at line 99 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_Z_SIGN   1

Definition at line 103 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

#define Int16FromBuf (   _buf,
  _idx 
)    ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8)))

Definition at line 173 of file imu_mpu9250_spi.c.

Referenced by imu_mpu9250_event().

Function Documentation

bool imu_mpu9250_configure_mag_slave ( Mpu9250ConfigSet  mpu_set,
void *  mpu 
)
void imu_mpu9250_periodic ( void  )

Definition at line 168 of file imu_mpu9250_spi.c.

References imu_mpu9250, ImuMpu9250::mpu, mpu9250, mpu9250_i2c_periodic(), and mpu9250_spi_periodic().

+ Here is the call graph for this function:

static void mpu_set_and_wait ( Mpu9250ConfigSet  mpu_set,
void *  mpu,
uint8_t  _reg,
uint8_t  _val 
)
inlinestatic

Definition at line 221 of file imu_mpu9250_spi.c.

References imu_mpu9250, ImuMpu9250::mpu, and SPITransSuccess.

Referenced by imu_mpu9250_configure_mag_slave().

+ Here is the caller graph for this function:

void mpu_wait_slave4_ready ( void  )

Definition at line 265 of file imu_mpu9250_spi.c.

References imu_mpu9250, ImuMpu9250::mpu, MPU9250_REG_I2C_MST_STATUS, MPU9250_SPI_READ, ImuMpu9250::slave4_ready, spi_submit(), SPITransDone, spi_transaction::status, ImuMpu9250::wait_slave4_trans, and ImuMpu9250::wait_slave4_tx_buf.

Referenced by imu_mpu9250_configure_mag_slave().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mpu_wait_slave4_ready_cb ( struct spi_transaction t)

Definition at line 275 of file imu_mpu9250_spi.c.

References imu_mpu9250, spi_transaction::input_buf, MPU9250_I2C_SLV4_DONE, ImuMpu9250::slave4_ready, SPITransDone, and spi_transaction::status.

Referenced by imu_mpu9250_init().

+ Here is the caller graph for this function:

Variable Documentation