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

Go to the source code of this file.

Classes

struct  ak09916_regs
 
class  ICM20948_mag
 Helper class implementing the magnetometer driver node. More...
 

Macros

#define ICM20948_AK09916_SAMPLE_RATE   100
 
#define AK09916_I2C_ADDR   0x0C
 
#define AK09916_DEVICE_ID   0x48
 
#define AK09916REG_WIA   0x00
 
#define AK09916REG_CNTL1   0x0A
 
#define AK09916REG_ASAX   0x10
 
#define AK09916_SINGLE_MEAS_MODE   0x01
 
#define AK09916_CONTINUOUS_MODE1   0x02
 
#define AK09916_CONTINUOUS_MODE2   0x06
 
#define AK09916_POWERDOWN_MODE   0x00
 
#define AK09916_SELFTEST_MODE   0x08
 
#define AK09916_FUZE_MODE   0x0F
 
#define AK09916_16BIT_ADC   0x10
 
#define AK09916_14BIT_ADC   0x00
 
#define AK09916_RESET   0x01
 
#define AK09916_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 *(* ICM20948_mag_constructor) (int, bool)
 

Functions

device::DeviceAK09916_I2C_interface (int bus)
 

Variables

static constexpr float ICM20948_MAG_RANGE_GA {1.5e-3f}
 

Macro Definition Documentation

◆ AK09916_14BIT_ADC

#define AK09916_14BIT_ADC   0x00

Definition at line 59 of file ICM20948_mag.h.

◆ AK09916_16BIT_ADC

#define AK09916_16BIT_ADC   0x10

Definition at line 58 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_read_adjustments().

◆ AK09916_CNTL2_CONTINOUS_MODE_100HZ

#define AK09916_CNTL2_CONTINOUS_MODE_100HZ   0x08

Definition at line 85 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_setup(), and AK09916::setup().

◆ AK09916_CNTL2_CONTINOUS_MODE_10HZ

#define AK09916_CNTL2_CONTINOUS_MODE_10HZ   0x02

Definition at line 82 of file ICM20948_mag.h.

◆ AK09916_CNTL2_CONTINOUS_MODE_20HZ

#define AK09916_CNTL2_CONTINOUS_MODE_20HZ   0x04

Definition at line 83 of file ICM20948_mag.h.

◆ AK09916_CNTL2_CONTINOUS_MODE_50HZ

#define AK09916_CNTL2_CONTINOUS_MODE_50HZ   0x06

Definition at line 84 of file ICM20948_mag.h.

◆ AK09916_CNTL2_POWERDOWN_MODE

#define AK09916_CNTL2_POWERDOWN_MODE   0x00

Definition at line 80 of file ICM20948_mag.h.

◆ AK09916_CNTL2_SELFTEST_MODE

#define AK09916_CNTL2_SELFTEST_MODE   0x10

Definition at line 86 of file ICM20948_mag.h.

◆ AK09916_CNTL2_SINGLE_MODE

#define AK09916_CNTL2_SINGLE_MODE   0x01 /* default */

Definition at line 81 of file ICM20948_mag.h.

◆ AK09916_CNTL3_SRST

#define AK09916_CNTL3_SRST   0x01

Definition at line 87 of file ICM20948_mag.h.

◆ AK09916_CONTINUOUS_MODE1

#define AK09916_CONTINUOUS_MODE1   0x02

Definition at line 53 of file ICM20948_mag.h.

◆ AK09916_CONTINUOUS_MODE2

#define AK09916_CONTINUOUS_MODE2   0x06

Definition at line 54 of file ICM20948_mag.h.

◆ AK09916_DEVICE_ID

#define AK09916_DEVICE_ID   0x48

Definition at line 46 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_check_id().

◆ AK09916_DEVICE_ID_A

#define AK09916_DEVICE_ID_A   0x48

Definition at line 65 of file ICM20948_mag.h.

Referenced by AK09916::check_id().

◆ AK09916_DEVICE_ID_B

#define AK09916_DEVICE_ID_B   0x09

Definition at line 66 of file ICM20948_mag.h.

◆ AK09916_FUZE_MODE

#define AK09916_FUZE_MODE   0x0F

Definition at line 57 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_read_adjustments().

◆ AK09916_HOFL

#define AK09916_HOFL   0x08

Definition at line 61 of file ICM20948_mag.h.

◆ AK09916_I2C_ADDR

#define AK09916_I2C_ADDR   0x0C

Definition at line 45 of file ICM20948_mag.h.

Referenced by ICM20948_mag::set_passthrough().

◆ AK09916_POWERDOWN_MODE

#define AK09916_POWERDOWN_MODE   0x00

Definition at line 55 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_read_adjustments().

◆ AK09916_RESET

#define AK09916_RESET   0x01

◆ AK09916_SELFTEST_MODE

#define AK09916_SELFTEST_MODE   0x08

Definition at line 56 of file ICM20948_mag.h.

◆ AK09916_SINGLE_MEAS_MODE

#define AK09916_SINGLE_MEAS_MODE   0x01

Definition at line 52 of file ICM20948_mag.h.

◆ AK09916_ST1_DOR

#define AK09916_ST1_DOR   0x02

Definition at line 89 of file ICM20948_mag.h.

Referenced by AK09916::is_ready().

◆ AK09916_ST1_DRDY

#define AK09916_ST1_DRDY   0x01

◆ AK09916REG_ASAX

#define AK09916REG_ASAX   0x10

Definition at line 50 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_read_adjustments().

◆ AK09916REG_CNTL1

#define AK09916REG_CNTL1   0x0A

Definition at line 49 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_read_adjustments().

◆ AK09916REG_CNTL2

#define AK09916REG_CNTL2   0x31

Definition at line 76 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_setup(), and AK09916::setup().

◆ AK09916REG_CNTL3

#define AK09916REG_CNTL3   0x32

◆ AK09916REG_HXH

#define AK09916REG_HXH   0x12

Definition at line 69 of file ICM20948_mag.h.

◆ AK09916REG_HXL

#define AK09916REG_HXL   0x11

Definition at line 68 of file ICM20948_mag.h.

Referenced by AK09916::measure().

◆ AK09916REG_HYH

#define AK09916REG_HYH   0x14

Definition at line 71 of file ICM20948_mag.h.

◆ AK09916REG_HYL

#define AK09916REG_HYL   0x13

Definition at line 70 of file ICM20948_mag.h.

◆ AK09916REG_HZH

#define AK09916REG_HZH   0x16

Definition at line 73 of file ICM20948_mag.h.

◆ AK09916REG_HZL

#define AK09916REG_HZL   0x15

Definition at line 72 of file ICM20948_mag.h.

◆ AK09916REG_ST1

#define AK09916REG_ST1   0x10

◆ AK09916REG_ST2

#define AK09916REG_ST2   0x18

Definition at line 75 of file ICM20948_mag.h.

◆ AK09916REG_WIA

#define AK09916REG_WIA   0x00

Definition at line 48 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ak09916_check_id(), and AK09916::check_id().

◆ ICM20948_AK09916_SAMPLE_RATE

#define ICM20948_AK09916_SAMPLE_RATE   100

Definition at line 43 of file ICM20948_mag.h.

Typedef Documentation

◆ ICM20948_mag_constructor

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

Definition at line 106 of file ICM20948_mag.h.

Function Documentation

◆ AK09916_I2C_interface()

device::Device* AK09916_I2C_interface ( int  bus)

Referenced by icm20948::start_bus().

Here is the caller graph for this function:

Variable Documentation

◆ ICM20948_MAG_RANGE_GA

constexpr float ICM20948_MAG_RANGE_GA {1.5e-3f}
static

Definition at line 41 of file ICM20948_mag.h.

Referenced by ICM20948_mag::ICM20948_mag().