Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_mpu9250_i2c.c File Reference

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

#include "subsystems/imu.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/sys_time.h"
#include "subsystems/abi.h"
+ Include dependency graph for imu_mpu9250_i2c.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_I2C_ADDR   MPU9250_ADDR_ALT
 
#define IMU_MPU9250_CHAN_X   0
 
#define IMU_MPU9250_CHAN_Y   1
 
#define IMU_MPU9250_CHAN_Z   2
 

Functions

void imu_impl_init (void)
 must be defined by underlying hardware More...
 
void imu_periodic (void)
 optional. More...
 
void imu_mpu9250_event (void)
 

Variables

struct ImuMpu9250 imu_mpu9250
 

Detailed Description

IMU driver for the MPU9250 using I2C.

Definition in file imu_mpu9250_i2c.c.

Macro Definition Documentation

#define IMU_MPU9250_ACCEL_LOWPASS_FILTER   MPU9250_DLPF_ACCEL_41HZ

Definition at line 56 of file imu_mpu9250_i2c.c.

Referenced by imu_impl_init().

#define IMU_MPU9250_ACCEL_RANGE   MPU9250_ACCEL_RANGE_8G

Definition at line 70 of file imu_mpu9250_i2c.c.

Referenced by imu_impl_init().

#define IMU_MPU9250_CHAN_X   0

Definition at line 81 of file imu_mpu9250_i2c.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_CHAN_Y   1

Definition at line 85 of file imu_mpu9250_i2c.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_CHAN_Z   2

Definition at line 89 of file imu_mpu9250_i2c.c.

Referenced by imu_mpu9250_event().

#define IMU_MPU9250_GYRO_LOWPASS_FILTER   MPU9250_DLPF_GYRO_41HZ

Definition at line 55 of file imu_mpu9250_i2c.c.

Referenced by imu_impl_init().

#define IMU_MPU9250_GYRO_RANGE   MPU9250_GYRO_RANGE_1000

Definition at line 65 of file imu_mpu9250_i2c.c.

Referenced by imu_impl_init().

#define IMU_MPU9250_I2C_ADDR   MPU9250_ADDR_ALT

Definition at line 75 of file imu_mpu9250_i2c.c.

Referenced by imu_impl_init().

#define IMU_MPU9250_SMPLRT_DIV   9

Definition at line 54 of file imu_mpu9250_i2c.c.

Referenced by imu_impl_init().

Function Documentation

void imu_impl_init ( void  )

must be defined by underlying hardware

must be defined by underlying hardware

Todo:
drdy int handling for adxl345
Todo:
eoc interrupt for itg3200, polling for now (including status reg)
Todo:
drdy int handling for adxl345
Todo:
eoc interrupt for itg3200, polling for now (including status reg)
Todo:
drdy int handling for adxl345

Definition at line 96 of file imu_mpu9250_i2c.c.

References Mpu9250Config::accel_range, Mpu9250_I2c::config, Mpu9250Config::dlpf_accel_cfg, Mpu9250Config::dlpf_gyro_cfg, Mpu9250Config::gyro_range, IMU_MPU9250_ACCEL_LOWPASS_FILTER, IMU_MPU9250_ACCEL_RANGE, IMU_MPU9250_GYRO_LOWPASS_FILTER, IMU_MPU9250_GYRO_RANGE, IMU_MPU9250_I2C_ADDR, IMU_MPU9250_SMPLRT_DIV, ImuMpu9250::mpu, mpu9250_i2c_init(), and Mpu9250Config::smplrt_div.

+ Here is the call graph for this function:

void imu_periodic ( void  )

optional.

If not provided by implementation, empty function is used

optional.

Read the MPU60x0 every periodic call and the HMC58XX every 10th call.

Definition at line 108 of file imu_mpu9250_i2c.c.

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

+ Here is the call graph for this function:

Variable Documentation

struct ImuMpu9250 imu_mpu9250

Definition at line 94 of file imu_mpu9250_i2c.c.

Referenced by imu_mpu9250_event(), and imu_periodic().