PX4 Firmware
PX4 Autopilot Software http://px4.io
drv_sensor.h File Reference

Common sensor API and ioctl definitions. More...

#include <px4_platform_common/defines.h>
#include <stdint.h>
#include <sys/ioctl.h>
#include "drv_device.h"
Include dependency graph for drv_sensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DRV_MAG_DEVTYPE_HMC5883   0x01
 Sensor type definitions. More...
 
#define DRV_MAG_DEVTYPE_LSM303D   0x02
 
#define DRV_MAG_DEVTYPE_MAGSIM   0x03
 
#define DRV_MAG_DEVTYPE_MPU9250   0x04
 
#define DRV_MAG_DEVTYPE_LIS3MDL   0x05
 
#define DRV_MAG_DEVTYPE_IST8310   0x06
 
#define DRV_MAG_DEVTYPE_RM3100   0x07
 
#define DRV_MAG_DEVTYPE_QMC5883   0x08
 
#define DRV_MAG_DEVTYPE_AK09916   0x09
 
#define DRV_DEVTYPE_ICM20948   0x0A
 
#define DRV_ACC_DEVTYPE_LSM303D   0x11
 
#define DRV_ACC_DEVTYPE_BMA180   0x12
 
#define DRV_ACC_DEVTYPE_MPU6000   0x13
 
#define DRV_ACC_DEVTYPE_ACCELSIM   0x14
 
#define DRV_ACC_DEVTYPE_MPU9250   0x16
 
#define DRV_ACC_DEVTYPE_BMI160   0x17
 
#define DRV_GYR_DEVTYPE_MPU6000   0x21
 
#define DRV_GYR_DEVTYPE_L3GD20   0x22
 
#define DRV_GYR_DEVTYPE_GYROSIM   0x23
 
#define DRV_GYR_DEVTYPE_MPU9250   0x24
 
#define DRV_GYR_DEVTYPE_BMI160   0x25
 
#define DRV_RNG_DEVTYPE_MB12XX   0x31
 
#define DRV_RNG_DEVTYPE_LL40LS   0x32
 
#define DRV_ACC_DEVTYPE_MPU6050   0x33
 
#define DRV_ACC_DEVTYPE_MPU6500   0x34
 
#define DRV_GYR_DEVTYPE_MPU6050   0x35
 
#define DRV_GYR_DEVTYPE_MPU6500   0x36
 
#define DRV_ACC_DEVTYPE_ICM20602   0x37
 
#define DRV_GYR_DEVTYPE_ICM20602   0x38
 
#define DRV_ACC_DEVTYPE_ICM20608   0x39
 
#define DRV_GYR_DEVTYPE_ICM20608   0x3A
 
#define DRV_ACC_DEVTYPE_ICM20689   0x3B
 
#define DRV_GYR_DEVTYPE_ICM20689   0x3C
 
#define DRV_BARO_DEVTYPE_MS5611   0x3D
 
#define DRV_BARO_DEVTYPE_MS5607   0x3E
 
#define DRV_BARO_DEVTYPE_BMP280   0x3F
 
#define DRV_BARO_DEVTYPE_LPS25H   0x40
 
#define DRV_ACC_DEVTYPE_BMI055   0x41
 
#define DRV_GYR_DEVTYPE_BMI055   0x42
 
#define DRV_MAG_DEVTYPE_BMM150   0x43
 
#define DRV_BARO_DEVTYPE_BMP285   0x44
 
#define DRV_DIFF_PRESS_DEVTYPE_ETS3   0x45
 
#define DRV_DIFF_PRESS_DEVTYPE_MS4525   0x46
 
#define DRV_DIFF_PRESS_DEVTYPE_MS5525   0x47
 
#define DRV_DIFF_PRESS_DEVTYPE_SDP31   0x48
 
#define DRV_DIFF_PRESS_DEVTYPE_SDP32   0x49
 
#define DRV_DIFF_PRESS_DEVTYPE_SDP33   0x50
 
#define DRV_BARO_DEVTYPE_MPL3115A2   0x51
 
#define DRV_ACC_DEVTYPE_FXOS8701C   0x52
 
#define DRV_GYR_DEVTYPE_FXAS2100C   0x54
 
#define DRV_ACC_DEVTYPE_ADIS16448   0x55
 
#define DRV_MAG_DEVTYPE_ADIS16448   0x56
 
#define DRV_GYR_DEVTYPE_ADIS16448   0x57
 
#define DRV_BARO_DEVTYPE_LPS22HB   0x58
 
#define DRV_ACC_DEVTYPE_ADIS16477   0x59
 
#define DRV_GYR_DEVTYPE_ADIS16477   0x60
 
#define DRV_ACC_DEVTYPE_LSM303AGR   0x61
 
#define DRV_MAG_DEVTYPE_LSM303AGR   0x62
 
#define DRV_ACC_DEVTYPE_ADIS16497   0x63
 
#define DRV_GYR_DEVTYPE_ADIS16497   0x64
 
#define DRV_BARO_DEVTYPE_BAROSIM   0x65
 
#define DRV_DEVTYPE_BMI088   0x66
 
#define DRV_DEVTYPE_BMP388   0x67
 
#define _SENSORIOCBASE   (0x2000)
 
#define _SENSORIOC(_n)   (_PX4_IOC(_SENSORIOCBASE, _n))
 
#define SENSORIOCSPOLLRATE   _SENSORIOC(0)
 Set the driver polling rate to (arg) Hz, or one of the SENSOR_POLLRATE constants. More...
 
#define SENSOR_POLLRATE_DEFAULT   1000003
 poll at driver normal rate More...
 
#define SENSORIOCRESET   _SENSORIOC(4)
 Reset the sensor to its default configuration. More...
 

Detailed Description

Common sensor API and ioctl definitions.

Definition in file drv_sensor.h.

Macro Definition Documentation

◆ _SENSORIOC

#define _SENSORIOC (   _n)    (_PX4_IOC(_SENSORIOCBASE, _n))

Definition at line 128 of file drv_sensor.h.

◆ _SENSORIOCBASE

#define _SENSORIOCBASE   (0x2000)

Definition at line 127 of file drv_sensor.h.

◆ DRV_ACC_DEVTYPE_ACCELSIM

#define DRV_ACC_DEVTYPE_ACCELSIM   0x14

Definition at line 68 of file drv_sensor.h.

◆ DRV_ACC_DEVTYPE_ADIS16448

#define DRV_ACC_DEVTYPE_ADIS16448   0x55

Definition at line 106 of file drv_sensor.h.

Referenced by ADIS16448::ADIS16448().

◆ DRV_ACC_DEVTYPE_ADIS16477

#define DRV_ACC_DEVTYPE_ADIS16477   0x59

Definition at line 110 of file drv_sensor.h.

Referenced by ADIS16477::ADIS16477().

◆ DRV_ACC_DEVTYPE_ADIS16497

#define DRV_ACC_DEVTYPE_ADIS16497   0x63

Definition at line 114 of file drv_sensor.h.

Referenced by ADIS16497::ADIS16497().

◆ DRV_ACC_DEVTYPE_BMA180

#define DRV_ACC_DEVTYPE_BMA180   0x12

Definition at line 66 of file drv_sensor.h.

Referenced by BMA180::BMA180().

◆ DRV_ACC_DEVTYPE_BMI055

#define DRV_ACC_DEVTYPE_BMI055   0x41

Definition at line 92 of file drv_sensor.h.

Referenced by BMI055_accel::BMI055_accel().

◆ DRV_ACC_DEVTYPE_BMI160

#define DRV_ACC_DEVTYPE_BMI160   0x17

Definition at line 70 of file drv_sensor.h.

Referenced by BMI160::BMI160().

◆ DRV_ACC_DEVTYPE_FXOS8701C

#define DRV_ACC_DEVTYPE_FXOS8701C   0x52

Definition at line 103 of file drv_sensor.h.

Referenced by FXOS8701CQ::FXOS8701CQ().

◆ DRV_ACC_DEVTYPE_ICM20602

#define DRV_ACC_DEVTYPE_ICM20602   0x37

Definition at line 82 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_ACC_DEVTYPE_ICM20608

#define DRV_ACC_DEVTYPE_ICM20608   0x39

Definition at line 84 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_ACC_DEVTYPE_ICM20689

#define DRV_ACC_DEVTYPE_ICM20689   0x3B

Definition at line 86 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_ACC_DEVTYPE_LSM303AGR

#define DRV_ACC_DEVTYPE_LSM303AGR   0x61

Definition at line 112 of file drv_sensor.h.

◆ DRV_ACC_DEVTYPE_LSM303D

#define DRV_ACC_DEVTYPE_LSM303D   0x11

Definition at line 65 of file drv_sensor.h.

Referenced by LSM303D::LSM303D().

◆ DRV_ACC_DEVTYPE_MPU6000

#define DRV_ACC_DEVTYPE_MPU6000   0x13

Definition at line 67 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_ACC_DEVTYPE_MPU6050

#define DRV_ACC_DEVTYPE_MPU6050   0x33

Definition at line 78 of file drv_sensor.h.

◆ DRV_ACC_DEVTYPE_MPU6500

#define DRV_ACC_DEVTYPE_MPU6500   0x34

Definition at line 79 of file drv_sensor.h.

◆ DRV_ACC_DEVTYPE_MPU9250

#define DRV_ACC_DEVTYPE_MPU9250   0x16

Definition at line 69 of file drv_sensor.h.

Referenced by MPU9250::MPU9250(), and MPU9250_SPI::MPU9250_SPI().

◆ DRV_BARO_DEVTYPE_BAROSIM

#define DRV_BARO_DEVTYPE_BAROSIM   0x65

Definition at line 116 of file drv_sensor.h.

◆ DRV_BARO_DEVTYPE_BMP280

#define DRV_BARO_DEVTYPE_BMP280   0x3F

Definition at line 90 of file drv_sensor.h.

◆ DRV_BARO_DEVTYPE_BMP285

#define DRV_BARO_DEVTYPE_BMP285   0x44

Definition at line 95 of file drv_sensor.h.

◆ DRV_BARO_DEVTYPE_LPS22HB

#define DRV_BARO_DEVTYPE_LPS22HB   0x58

Definition at line 109 of file drv_sensor.h.

Referenced by LPS22HB::LPS22HB().

◆ DRV_BARO_DEVTYPE_LPS25H

#define DRV_BARO_DEVTYPE_LPS25H   0x40

Definition at line 91 of file drv_sensor.h.

Referenced by LPS25H::LPS25H().

◆ DRV_BARO_DEVTYPE_MPL3115A2

#define DRV_BARO_DEVTYPE_MPL3115A2   0x51

Definition at line 102 of file drv_sensor.h.

Referenced by MPL3115A2::MPL3115A2().

◆ DRV_BARO_DEVTYPE_MS5607

#define DRV_BARO_DEVTYPE_MS5607   0x3E

Definition at line 89 of file drv_sensor.h.

Referenced by MS5611::init().

◆ DRV_BARO_DEVTYPE_MS5611

#define DRV_BARO_DEVTYPE_MS5611   0x3D

Definition at line 88 of file drv_sensor.h.

Referenced by MS5611::init().

◆ DRV_DEVTYPE_BMI088

#define DRV_DEVTYPE_BMI088   0x66

Definition at line 117 of file drv_sensor.h.

Referenced by BMI088_accel::BMI088_accel(), and BMI088_gyro::BMI088_gyro().

◆ DRV_DEVTYPE_BMP388

#define DRV_DEVTYPE_BMP388   0x67

Definition at line 118 of file drv_sensor.h.

Referenced by BMP388::BMP388().

◆ DRV_DEVTYPE_ICM20948

#define DRV_DEVTYPE_ICM20948   0x0A

Definition at line 64 of file drv_sensor.h.

Referenced by ICM20948::ICM20948(), and ICM20948_SPI::ICM20948_SPI().

◆ DRV_DIFF_PRESS_DEVTYPE_ETS3

#define DRV_DIFF_PRESS_DEVTYPE_ETS3   0x45

Definition at line 96 of file drv_sensor.h.

◆ DRV_DIFF_PRESS_DEVTYPE_MS4525

#define DRV_DIFF_PRESS_DEVTYPE_MS4525   0x46

Definition at line 97 of file drv_sensor.h.

Referenced by ETSAirspeed::ETSAirspeed(), and MEASAirspeed::MEASAirspeed().

◆ DRV_DIFF_PRESS_DEVTYPE_MS5525

#define DRV_DIFF_PRESS_DEVTYPE_MS5525   0x47

Definition at line 98 of file drv_sensor.h.

Referenced by MS5525::init_ms5525().

◆ DRV_DIFF_PRESS_DEVTYPE_SDP31

#define DRV_DIFF_PRESS_DEVTYPE_SDP31   0x48

Definition at line 99 of file drv_sensor.h.

Referenced by Sensors::diff_pres_poll(), and SDP3X::init_sdp3x().

◆ DRV_DIFF_PRESS_DEVTYPE_SDP32

#define DRV_DIFF_PRESS_DEVTYPE_SDP32   0x49

Definition at line 100 of file drv_sensor.h.

Referenced by Sensors::diff_pres_poll(), and SDP3X::init_sdp3x().

◆ DRV_DIFF_PRESS_DEVTYPE_SDP33

#define DRV_DIFF_PRESS_DEVTYPE_SDP33   0x50

Definition at line 101 of file drv_sensor.h.

Referenced by Sensors::diff_pres_poll(), and SDP3X::init_sdp3x().

◆ DRV_GYR_DEVTYPE_ADIS16448

#define DRV_GYR_DEVTYPE_ADIS16448   0x57

Definition at line 108 of file drv_sensor.h.

Referenced by ADIS16448::ADIS16448().

◆ DRV_GYR_DEVTYPE_ADIS16477

#define DRV_GYR_DEVTYPE_ADIS16477   0x60

Definition at line 111 of file drv_sensor.h.

Referenced by ADIS16477::ADIS16477().

◆ DRV_GYR_DEVTYPE_ADIS16497

#define DRV_GYR_DEVTYPE_ADIS16497   0x64

Definition at line 115 of file drv_sensor.h.

Referenced by ADIS16497::ADIS16497().

◆ DRV_GYR_DEVTYPE_BMI055

#define DRV_GYR_DEVTYPE_BMI055   0x42

Definition at line 93 of file drv_sensor.h.

Referenced by BMI055_gyro::BMI055_gyro().

◆ DRV_GYR_DEVTYPE_BMI160

#define DRV_GYR_DEVTYPE_BMI160   0x25

Definition at line 75 of file drv_sensor.h.

Referenced by BMI160::BMI160().

◆ DRV_GYR_DEVTYPE_FXAS2100C

#define DRV_GYR_DEVTYPE_FXAS2100C   0x54

Definition at line 105 of file drv_sensor.h.

Referenced by FXAS21002C::FXAS21002C().

◆ DRV_GYR_DEVTYPE_GYROSIM

#define DRV_GYR_DEVTYPE_GYROSIM   0x23

Definition at line 73 of file drv_sensor.h.

◆ DRV_GYR_DEVTYPE_ICM20602

#define DRV_GYR_DEVTYPE_ICM20602   0x38

Definition at line 83 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_GYR_DEVTYPE_ICM20608

#define DRV_GYR_DEVTYPE_ICM20608   0x3A

Definition at line 85 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_GYR_DEVTYPE_ICM20689

#define DRV_GYR_DEVTYPE_ICM20689   0x3C

Definition at line 87 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_GYR_DEVTYPE_L3GD20

#define DRV_GYR_DEVTYPE_L3GD20   0x22

Definition at line 72 of file drv_sensor.h.

Referenced by L3GD20::L3GD20().

◆ DRV_GYR_DEVTYPE_MPU6000

#define DRV_GYR_DEVTYPE_MPU6000   0x21

Definition at line 71 of file drv_sensor.h.

Referenced by MPU6000::MPU6000().

◆ DRV_GYR_DEVTYPE_MPU6050

#define DRV_GYR_DEVTYPE_MPU6050   0x35

Definition at line 80 of file drv_sensor.h.

◆ DRV_GYR_DEVTYPE_MPU6500

#define DRV_GYR_DEVTYPE_MPU6500   0x36

Definition at line 81 of file drv_sensor.h.

◆ DRV_GYR_DEVTYPE_MPU9250

#define DRV_GYR_DEVTYPE_MPU9250   0x24

Definition at line 74 of file drv_sensor.h.

Referenced by MPU9250::MPU9250().

◆ DRV_MAG_DEVTYPE_ADIS16448

#define DRV_MAG_DEVTYPE_ADIS16448   0x56

Definition at line 107 of file drv_sensor.h.

Referenced by ADIS16448::ADIS16448().

◆ DRV_MAG_DEVTYPE_AK09916

#define DRV_MAG_DEVTYPE_AK09916   0x09

Definition at line 63 of file drv_sensor.h.

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

◆ DRV_MAG_DEVTYPE_BMM150

#define DRV_MAG_DEVTYPE_BMM150   0x43

Definition at line 94 of file drv_sensor.h.

Referenced by BMM150::BMM150().

◆ DRV_MAG_DEVTYPE_HMC5883

#define DRV_MAG_DEVTYPE_HMC5883   0x01

Sensor type definitions.

Used to create a unique device id for redundant and combo sensors

Definition at line 55 of file drv_sensor.h.

Referenced by HMC5883::HMC5883(), HMC5883_I2C::HMC5883_I2C(), and UavcanMagnetometerBridge::UavcanMagnetometerBridge().

◆ DRV_MAG_DEVTYPE_IST8310

#define DRV_MAG_DEVTYPE_IST8310   0x06

Definition at line 60 of file drv_sensor.h.

Referenced by IST8310::IST8310().

◆ DRV_MAG_DEVTYPE_LIS3MDL

#define DRV_MAG_DEVTYPE_LIS3MDL   0x05

Definition at line 59 of file drv_sensor.h.

Referenced by LIS3MDL::LIS3MDL().

◆ DRV_MAG_DEVTYPE_LSM303AGR

#define DRV_MAG_DEVTYPE_LSM303AGR   0x62

Definition at line 113 of file drv_sensor.h.

Referenced by LSM303AGR::LSM303AGR().

◆ DRV_MAG_DEVTYPE_LSM303D

#define DRV_MAG_DEVTYPE_LSM303D   0x02

Definition at line 56 of file drv_sensor.h.

Referenced by LSM303D::LSM303D().

◆ DRV_MAG_DEVTYPE_MAGSIM

#define DRV_MAG_DEVTYPE_MAGSIM   0x03

Definition at line 57 of file drv_sensor.h.

◆ DRV_MAG_DEVTYPE_MPU9250

#define DRV_MAG_DEVTYPE_MPU9250   0x04

Definition at line 58 of file drv_sensor.h.

Referenced by MPU9250_mag::MPU9250_mag().

◆ DRV_MAG_DEVTYPE_QMC5883

#define DRV_MAG_DEVTYPE_QMC5883   0x08

Definition at line 62 of file drv_sensor.h.

Referenced by QMC5883::QMC5883(), and QMC5883_I2C::QMC5883_I2C().

◆ DRV_MAG_DEVTYPE_RM3100

#define DRV_MAG_DEVTYPE_RM3100   0x07

Definition at line 61 of file drv_sensor.h.

Referenced by RM3100::RM3100().

◆ DRV_RNG_DEVTYPE_LL40LS

#define DRV_RNG_DEVTYPE_LL40LS   0x32

Definition at line 77 of file drv_sensor.h.

◆ DRV_RNG_DEVTYPE_MB12XX

#define DRV_RNG_DEVTYPE_MB12XX   0x31

Definition at line 76 of file drv_sensor.h.

◆ SENSOR_POLLRATE_DEFAULT

◆ SENSORIOCRESET

◆ SENSORIOCSPOLLRATE