PX4 Firmware
PX4 Autopilot Software http://px4.io
mpu9x50_main.cpp File Reference
#include <stdint.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <px4_platform_common/tasks.h>
#include <px4_platform_common/log.h>
#include <px4_platform_common/getopt.h>
#include <uORB/uORB.h>
#include <uORB/topics/parameter_update.h>
#include <drivers/drv_accel.h>
#include <drivers/drv_gyro.h>
#include <drivers/drv_mag.h>
#include <drivers/drv_hrt.h>
#include <semaphore.h>
#include <mpu9x50.h>
Include dependency graph for mpu9x50_main.cpp:

Go to the source code of this file.

Namespaces

 mpu9x50
 

Macros

#define MAX_LEN_DEV_PATH   32
 
#define SPI_INT_GPIO   65
 

Functions

__EXPORT int mpu9x50_main (int argc, char *argv[])
 driver 'main' command More...
 
static void mpu9x50::usage ()
 Print out the usage information. More...
 
static void mpu9x50::stop ()
 mpu9x50 stop measurement More...
 
static void mpu9x50::task_main_trampoline (int argc, char *argv[])
 task main trampoline function More...
 
static void mpu9x50::task_main (int argc, char *argv[])
 mpu9x50 measurement thread primary entry point More...
 
static bool mpu9x50::create_pubs ()
 create and advertise all publicatoins More...
 
static void mpu9x50::update_reports ()
 update all sensor reports with the latest sensor reading More...
 
static void mpu9x50::publish_reports ()
 publish all sensor reports More...
 
static void mpu9x50::parameters_update ()
 update all parameters More...
 
static void mpu9x50::parameters_init ()
 initialize all parameter handles and load the initial parameter values More...
 
static void mpu9x50::parameter_update_poll ()
 poll parameter update More...
 
static void * mpu9x50::data_ready_isr (void *context)
 MPU9x50 data ready interrupt service routine. More...
 
void mpu9x50::start ()
 Attempt to start driver on all available I2C busses. More...
 

Variables

static char mpu9x50::_device [MAX_LEN_DEV_PATH]
 SPI device path that mpu9x50 is connected to. More...
 
static bool mpu9x50::_is_running = false
 flag indicating if mpu9x50 app is running More...
 
static bool mpu9x50::_task_should_exit = false
 flag indicating if measurement thread should exit More...
 
static px4_task_t mpu9x50::_task_handle = -1
 handle to the task main thread More...
 
static struct mpu9x50_data mpu9x50::_data
 IMU measurement data. More...
 
static orb_advert_t mpu9x50::_gyro_pub = nullptr
 gyro data publication More...
 
static int mpu9x50::_gyro_orb_class_instance
 instance handle for gyro devices More...
 
static orb_advert_t mpu9x50::_accel_pub = nullptr
 accelerameter data publication More...
 
static int mpu9x50::_accel_orb_class_instance
 instance handle for accel devices More...
 
static orb_advert_t mpu9x50::_mag_pub = nullptr
 compass data publication More...
 
static int mpu9x50::_mag_orb_class_instance
 instance handle for mag devices More...
 
static int mpu9x50::_params_sub
 parameter update subscription More...
 
static sensor_gyro_s mpu9x50::_gyro
 gyro report More...
 
static sensor_accel_s mpu9x50::_accel
 accel report More...
 
static struct mag_report mpu9x50::_mag
 mag report More...
 
static struct gyro_calibration_s mpu9x50::_gyro_sc
 gyro scale More...
 
static struct accel_calibration_s mpu9x50::_accel_sc
 accel scale More...
 
static struct mag_calibration_s mpu9x50::_mag_sc
 mag scale More...
 
static enum gyro_lpf_e mpu9x50::_gyro_lpf = MPU9X50_GYRO_LPF_20HZ
 gyro lpf enum value More...
 
static enum acc_lpf_e mpu9x50::_accel_lpf = MPU9X50_ACC_LPF_20HZ
 accel lpf enum value More...
 
static enum gyro_sample_rate_e mpu9x50::_imu_sample_rate = MPU9x50_SAMPLE_RATE_500HZ
 IMU sample rate enum. More...
 
struct {
   param_t   mpu9x50::accel_x_offset
 
   param_t   mpu9x50::accel_x_scale
 
   param_t   mpu9x50::accel_y_offset
 
   param_t   mpu9x50::accel_y_scale
 
   param_t   mpu9x50::accel_z_offset
 
   param_t   mpu9x50::accel_z_scale
 
   param_t   mpu9x50::gyro_x_offset
 
   param_t   mpu9x50::gyro_x_scale
 
   param_t   mpu9x50::gyro_y_offset
 
   param_t   mpu9x50::gyro_y_scale
 
   param_t   mpu9x50::gyro_z_offset
 
   param_t   mpu9x50::gyro_z_scale
 
   param_t   mpu9x50::mag_x_offset
 
   param_t   mpu9x50::mag_x_scale
 
   param_t   mpu9x50::mag_y_offset
 
   param_t   mpu9x50::mag_y_scale
 
   param_t   mpu9x50::mag_z_offset
 
   param_t   mpu9x50::mag_z_scale
 
   param_t   mpu9x50::gyro_lpf_enum
 
   param_t   mpu9x50::accel_lpf_enum
 
   param_t   mpu9x50::imu_sample_rate_enum
 
mpu9x50::_params_handles
 parameter handles More...
 
bool mpu9x50::exit_mreasurement = false
 
static int64_t mpu9x50::_isr_data_ready_timestamp = 0
 

Macro Definition Documentation

◆ MAX_LEN_DEV_PATH

#define MAX_LEN_DEV_PATH   32

Definition at line 70 of file mpu9x50_main.cpp.

Referenced by mpu9x50_main().

◆ SPI_INT_GPIO

#define SPI_INT_GPIO   65

Definition at line 73 of file mpu9x50_main.cpp.

Referenced by mpu9x50::task_main().

Function Documentation

◆ mpu9x50_main()

int mpu9x50_main ( int  argc,
char *  argv[] 
)

driver 'main' command

Definition at line 603 of file mpu9x50_main.cpp.

References mpu9x50::_device, mpu9x50::_is_running, MAX_LEN_DEV_PATH, mpu9x50::start(), mpu9x50::stop(), and mpu9x50::usage().

Here is the call graph for this function: