PX4 Firmware
PX4 Autopilot Software http://px4.io
MPU9250_mag.h File Reference
Include dependency graph for MPU9250_mag.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ak8963_regs
 
class  MPU9250_mag
 Helper class implementing the magnetometer driver node. More...
 

Macros

#define AK8963_I2C_ADDR   0x0C
 
#define AK8963_DEVICE_ID   0x48
 
#define AK8963REG_WIA   0x00
 
#define AK8963REG_ST1   0x02
 
#define AK8963REG_HXL   0x03
 
#define AK8963REG_ASAX   0x10
 
#define AK8963REG_CNTL1   0x0A
 
#define AK8963REG_CNTL2   0x0B
 
#define AK8963_SINGLE_MEAS_MODE   0x01
 
#define AK8963_CONTINUOUS_MODE1   0x02
 
#define AK8963_CONTINUOUS_MODE2   0x06
 
#define AK8963_POWERDOWN_MODE   0x00
 
#define AK8963_SELFTEST_MODE   0x08
 
#define AK8963_FUZE_MODE   0x0F
 
#define AK8963_16BIT_ADC   0x10
 
#define AK8963_14BIT_ADC   0x00
 
#define AK8963_RESET   0x01
 
#define AK8963_HOFL   0x08
 
#define AK09916_DEVICE_ID_A   0x48
 
#define AK09916_DEVICE_ID_B   0x09
 
#define AK09916REG_HXL   0x11
 
#define AK09916REG_HXH   0x12
 
#define AK09916REG_HYL   0x13
 
#define AK09916REG_HYH   0x14
 
#define AK09916REG_HZL   0x15
 
#define AK09916REG_HZH   0x16
 
#define AK09916REG_ST1   0x10
 
#define AK09916REG_ST2   0x18
 
#define AK09916REG_CNTL2   0x31
 
#define AK09916REG_CNTL3   0x32
 
#define AK09916_CNTL2_POWERDOWN_MODE   0x00
 
#define AK09916_CNTL2_SINGLE_MODE   0x01 /* default */
 
#define AK09916_CNTL2_CONTINOUS_MODE_10HZ   0x02
 
#define AK09916_CNTL2_CONTINOUS_MODE_20HZ   0x04
 
#define AK09916_CNTL2_CONTINOUS_MODE_50HZ   0x06
 
#define AK09916_CNTL2_CONTINOUS_MODE_100HZ   0x08
 
#define AK09916_CNTL2_SELFTEST_MODE   0x10
 
#define AK09916_CNTL3_SRST   0x01
 
#define AK09916_ST1_DRDY   0x01
 
#define AK09916_ST1_DOR   0x02
 

Typedefs

typedef device::Device *(* MPU9250_mag_constructor) (int, bool)
 

Functions

device::DeviceAK8963_I2C_interface (int bus)
 

Variables

static constexpr float MPU9250_MAG_RANGE_GA {1.5e-3f}
 

Macro Definition Documentation

◆ AK09916_CNTL2_CONTINOUS_MODE_100HZ

#define AK09916_CNTL2_CONTINOUS_MODE_100HZ   0x08

Definition at line 87 of file MPU9250_mag.h.

◆ AK09916_CNTL2_CONTINOUS_MODE_10HZ

#define AK09916_CNTL2_CONTINOUS_MODE_10HZ   0x02

Definition at line 84 of file MPU9250_mag.h.

◆ AK09916_CNTL2_CONTINOUS_MODE_20HZ

#define AK09916_CNTL2_CONTINOUS_MODE_20HZ   0x04

Definition at line 85 of file MPU9250_mag.h.

◆ AK09916_CNTL2_CONTINOUS_MODE_50HZ

#define AK09916_CNTL2_CONTINOUS_MODE_50HZ   0x06

Definition at line 86 of file MPU9250_mag.h.

◆ AK09916_CNTL2_POWERDOWN_MODE

#define AK09916_CNTL2_POWERDOWN_MODE   0x00

Definition at line 82 of file MPU9250_mag.h.

◆ AK09916_CNTL2_SELFTEST_MODE

#define AK09916_CNTL2_SELFTEST_MODE   0x10

Definition at line 88 of file MPU9250_mag.h.

◆ AK09916_CNTL2_SINGLE_MODE

#define AK09916_CNTL2_SINGLE_MODE   0x01 /* default */

Definition at line 83 of file MPU9250_mag.h.

◆ AK09916_CNTL3_SRST

#define AK09916_CNTL3_SRST   0x01

Definition at line 89 of file MPU9250_mag.h.

◆ AK09916_DEVICE_ID_A

#define AK09916_DEVICE_ID_A   0x48

Definition at line 67 of file MPU9250_mag.h.

◆ AK09916_DEVICE_ID_B

#define AK09916_DEVICE_ID_B   0x09

Definition at line 68 of file MPU9250_mag.h.

◆ AK09916_ST1_DOR

#define AK09916_ST1_DOR   0x02

Definition at line 91 of file MPU9250_mag.h.

◆ AK09916_ST1_DRDY

#define AK09916_ST1_DRDY   0x01

Definition at line 90 of file MPU9250_mag.h.

◆ AK09916REG_CNTL2

#define AK09916REG_CNTL2   0x31

Definition at line 78 of file MPU9250_mag.h.

◆ AK09916REG_CNTL3

#define AK09916REG_CNTL3   0x32

Definition at line 79 of file MPU9250_mag.h.

◆ AK09916REG_HXH

#define AK09916REG_HXH   0x12

Definition at line 71 of file MPU9250_mag.h.

◆ AK09916REG_HXL

#define AK09916REG_HXL   0x11

Definition at line 70 of file MPU9250_mag.h.

◆ AK09916REG_HYH

#define AK09916REG_HYH   0x14

Definition at line 73 of file MPU9250_mag.h.

◆ AK09916REG_HYL

#define AK09916REG_HYL   0x13

Definition at line 72 of file MPU9250_mag.h.

◆ AK09916REG_HZH

#define AK09916REG_HZH   0x16

Definition at line 75 of file MPU9250_mag.h.

◆ AK09916REG_HZL

#define AK09916REG_HZL   0x15

Definition at line 74 of file MPU9250_mag.h.

◆ AK09916REG_ST1

#define AK09916REG_ST1   0x10

Definition at line 76 of file MPU9250_mag.h.

◆ AK09916REG_ST2

#define AK09916REG_ST2   0x18

Definition at line 77 of file MPU9250_mag.h.

◆ AK8963_14BIT_ADC

#define AK8963_14BIT_ADC   0x00

Definition at line 61 of file MPU9250_mag.h.

◆ AK8963_16BIT_ADC

#define AK8963_16BIT_ADC   0x10

◆ AK8963_CONTINUOUS_MODE1

#define AK8963_CONTINUOUS_MODE1   0x02

Definition at line 55 of file MPU9250_mag.h.

◆ AK8963_CONTINUOUS_MODE2

#define AK8963_CONTINUOUS_MODE2   0x06

Definition at line 56 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_setup().

◆ AK8963_DEVICE_ID

#define AK8963_DEVICE_ID   0x48

Definition at line 45 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_check_id().

◆ AK8963_FUZE_MODE

#define AK8963_FUZE_MODE   0x0F

Definition at line 59 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_read_adjustments().

◆ AK8963_HOFL

#define AK8963_HOFL   0x08

Definition at line 63 of file MPU9250_mag.h.

◆ AK8963_I2C_ADDR

#define AK8963_I2C_ADDR   0x0C

Definition at line 44 of file MPU9250_mag.h.

Referenced by MPU9250_mag::set_passthrough().

◆ AK8963_POWERDOWN_MODE

#define AK8963_POWERDOWN_MODE   0x00

Definition at line 57 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_read_adjustments().

◆ AK8963_RESET

#define AK8963_RESET   0x01

Definition at line 62 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_reset(), and MPU9250_mag::ak8963_setup().

◆ AK8963_SELFTEST_MODE

#define AK8963_SELFTEST_MODE   0x08

Definition at line 58 of file MPU9250_mag.h.

◆ AK8963_SINGLE_MEAS_MODE

#define AK8963_SINGLE_MEAS_MODE   0x01

Definition at line 54 of file MPU9250_mag.h.

◆ AK8963REG_ASAX

#define AK8963REG_ASAX   0x10

Definition at line 50 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_read_adjustments().

◆ AK8963REG_CNTL1

#define AK8963REG_CNTL1   0x0A

◆ AK8963REG_CNTL2

#define AK8963REG_CNTL2   0x0B

Definition at line 52 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_reset(), and MPU9250_mag::ak8963_setup().

◆ AK8963REG_HXL

#define AK8963REG_HXL   0x03

Definition at line 49 of file MPU9250_mag.h.

◆ AK8963REG_ST1

#define AK8963REG_ST1   0x02

Definition at line 48 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_setup(), and MPU9250_mag::measure().

◆ AK8963REG_WIA

#define AK8963REG_WIA   0x00

Definition at line 47 of file MPU9250_mag.h.

Referenced by MPU9250_mag::ak8963_check_id().

Typedef Documentation

◆ MPU9250_mag_constructor

typedef device::Device*(* MPU9250_mag_constructor) (int, bool)

Definition at line 107 of file MPU9250_mag.h.

Function Documentation

◆ AK8963_I2C_interface()

device::Device* AK8963_I2C_interface ( int  bus)

Referenced by mpu9250::start_bus().

Here is the caller graph for this function:

Variable Documentation

◆ MPU9250_MAG_RANGE_GA

constexpr float MPU9250_MAG_RANGE_GA {1.5e-3f}
static

Definition at line 41 of file MPU9250_mag.h.

Referenced by MPU9250_mag::MPU9250_mag().