PX4 Firmware
PX4 Autopilot Software http://px4.io
drv_mag.h File Reference
#include <stdint.h>
#include <sys/ioctl.h>
#include "drv_sensor.h"
#include "drv_orb_dev.h"
#include <uORB/topics/sensor_mag.h>
Include dependency graph for drv_mag.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mag_calibration_s
 mag scaling factors; Vout = (Vin * Vscale) + Voffset More...
 

Macros

#define MAG_BASE_DEVICE_PATH   "/dev/mag"
 
#define MAG0_DEVICE_PATH   "/dev/mag0"
 
#define MAG1_DEVICE_PATH   "/dev/mag1"
 
#define MAG2_DEVICE_PATH   "/dev/mag2"
 
#define mag_report   sensor_mag_s
 
#define _MAGIOCBASE   (0x2400)
 
#define _MAGIOC(_n)   (_PX4_IOC(_MAGIOCBASE, _n))
 
#define MAGIOCSSCALE   _MAGIOC(4)
 set the mag scaling constants to the structure pointed to by (arg) More...
 
#define MAGIOCGSCALE   _MAGIOC(5)
 copy the mag scaling constants to the structure pointed to by (arg) More...
 
#define MAGIOCSRANGE   _MAGIOC(6)
 set the measurement range to handle (at least) arg Gauss More...
 
#define MAGIOCCALIBRATE   _MAGIOC(8)
 perform self-calibration, update scale factors to canonical units More...
 
#define MAGIOCEXSTRAP   _MAGIOC(9)
 excite strap More...
 
#define MAGIOCGEXTERNAL   _MAGIOC(11)
 determine if mag is external or onboard More...
 
#define MAGIOCSTEMPCOMP   _MAGIOC(12)
 enable/disable temperature compensation More...
 

Macro Definition Documentation

◆ _MAGIOC

#define _MAGIOC (   _n)    (_PX4_IOC(_MAGIOCBASE, _n))

Definition at line 70 of file drv_mag.h.

◆ _MAGIOCBASE

#define _MAGIOCBASE   (0x2400)

Definition at line 69 of file drv_mag.h.

◆ MAG0_DEVICE_PATH

#define MAG0_DEVICE_PATH   "/dev/mag0"

Definition at line 48 of file drv_mag.h.

◆ MAG1_DEVICE_PATH

#define MAG1_DEVICE_PATH   "/dev/mag1"

Definition at line 49 of file drv_mag.h.

◆ MAG2_DEVICE_PATH

#define MAG2_DEVICE_PATH   "/dev/mag2"

Definition at line 50 of file drv_mag.h.

◆ MAG_BASE_DEVICE_PATH

◆ mag_report

◆ MAGIOCCALIBRATE

#define MAGIOCCALIBRATE   _MAGIOC(8)

perform self-calibration, update scale factors to canonical units

Definition at line 82 of file drv_mag.h.

Referenced by lis3mdl::calibrate(), hmc5883::calibrate(), ist8310::calibrate(), do_mag_calibration(), UavcanMagnetometerBridge::ioctl(), LIS3MDL::ioctl(), HMC5883::ioctl(), RM3100::ioctl(), IST8310::ioctl(), and BMM150::ioctl().

◆ MAGIOCEXSTRAP

◆ MAGIOCGEXTERNAL

◆ MAGIOCGSCALE

#define MAGIOCGSCALE   _MAGIOC(5)

◆ MAGIOCSRANGE

#define MAGIOCSRANGE   _MAGIOC(6)

set the measurement range to handle (at least) arg Gauss

Definition at line 79 of file drv_mag.h.

Referenced by HMC5883::calibrate(), LIS3MDL::calibrate(), do_mag(), UavcanMagnetometerBridge::ioctl(), LIS3MDL::ioctl(), HMC5883::ioctl(), RM3100::ioctl(), and QMC5883::ioctl().

◆ MAGIOCSSCALE

◆ MAGIOCSTEMPCOMP

#define MAGIOCSTEMPCOMP   _MAGIOC(12)

enable/disable temperature compensation

Definition at line 91 of file drv_mag.h.

Referenced by HMC5883::ioctl(), and hmc5883::temp_enable().