Firmware
drv_sensor.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2012-2017 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
40 #ifndef _DRV_SENSOR_H
41 #define _DRV_SENSOR_H
42 
43 #include <px4_defines.h>
44 #include <stdint.h>
45 #include <sys/ioctl.h>
46 
47 #include "drv_device.h"
48 
55 #define DRV_MAG_DEVTYPE_HMC5883 0x01
56 #define DRV_MAG_DEVTYPE_LSM303D 0x02
57 #define DRV_MAG_DEVTYPE_ACCELSIM 0x03
58 #define DRV_MAG_DEVTYPE_MPU9250 0x04
59 #define DRV_MAG_DEVTYPE_LIS3MDL 0x05
60 #define DRV_MAG_DEVTYPE_IST8310 0x06
61 #define DRV_MAG_DEVTYPE_RM3100 0x07
62 #define DRV_MAG_DEVTYPE_QMC5883 0x08
63 #define DRV_ACC_DEVTYPE_LSM303D 0x11
64 #define DRV_ACC_DEVTYPE_BMA180 0x12
65 #define DRV_ACC_DEVTYPE_MPU6000 0x13
66 #define DRV_ACC_DEVTYPE_ACCELSIM 0x14
67 #define DRV_ACC_DEVTYPE_GYROSIM 0x15
68 #define DRV_ACC_DEVTYPE_MPU9250 0x16
69 #define DRV_ACC_DEVTYPE_BMI160 0x17
70 #define DRV_GYR_DEVTYPE_MPU6000 0x21
71 #define DRV_GYR_DEVTYPE_L3GD20 0x22
72 #define DRV_GYR_DEVTYPE_GYROSIM 0x23
73 #define DRV_GYR_DEVTYPE_MPU9250 0x24
74 #define DRV_GYR_DEVTYPE_BMI160 0x25
75 #define DRV_RNG_DEVTYPE_MB12XX 0x31
76 #define DRV_RNG_DEVTYPE_LL40LS 0x32
77 #define DRV_ACC_DEVTYPE_MPU6050 0x33
78 #define DRV_ACC_DEVTYPE_MPU6500 0x34
79 #define DRV_GYR_DEVTYPE_MPU6050 0x35
80 #define DRV_GYR_DEVTYPE_MPU6500 0x36
81 #define DRV_ACC_DEVTYPE_ICM20602 0x37
82 #define DRV_GYR_DEVTYPE_ICM20602 0x38
83 #define DRV_ACC_DEVTYPE_ICM20608 0x39
84 #define DRV_GYR_DEVTYPE_ICM20608 0x3A
85 #define DRV_ACC_DEVTYPE_ICM20689 0x3B
86 #define DRV_GYR_DEVTYPE_ICM20689 0x3C
87 #define DRV_BARO_DEVTYPE_MS5611 0x3D
88 #define DRV_BARO_DEVTYPE_MS5607 0x3E
89 #define DRV_BARO_DEVTYPE_BMP280 0x3F
90 #define DRV_BARO_DEVTYPE_LPS25H 0x40
91 #define DRV_ACC_DEVTYPE_BMI055 0x41
92 #define DRV_GYR_DEVTYPE_BMI055 0x42
93 #define DRV_MAG_DEVTYPE_BMM150 0x43
94 #define DRV_BARO_DEVTYPE_BMP285 0x44
95 #define DRV_DIFF_PRESS_DEVTYPE_ETS3 0x45
96 #define DRV_DIFF_PRESS_DEVTYPE_MS4525 0x46
97 #define DRV_DIFF_PRESS_DEVTYPE_MS5525 0x47
98 #define DRV_DIFF_PRESS_DEVTYPE_SDP31 0x48
99 #define DRV_DIFF_PRESS_DEVTYPE_SDP32 0x49
100 #define DRV_DIFF_PRESS_DEVTYPE_SDP33 0x50
101 #define DRV_BARO_DEVTYPE_MPL3115A2 0x51
102 #define DRV_ACC_DEVTYPE_FXOS8701C 0x52
103 #define DRV_MAG_DEVTYPE_FXOS8701C 0x53
104 #define DRV_GYR_DEVTYPE_FXAS2100C 0x54
105 #define DRV_ACC_DEVTYPE_ADIS16448 0x55
106 #define DRV_MAG_DEVTYPE_ADIS16448 0x56
107 #define DRV_GYR_DEVTYPE_ADIS16448 0x57
108 #define DRV_BARO_DEVTYPE_LPS22HB 0x58
109 #define DRV_ACC_DEVTYPE_ADIS16477 0x59
110 #define DRV_GYR_DEVTYPE_ADIS16477 0x60
111 #define DRV_ACC_DEVTYPE_LSM303AGR 0x61
112 #define DRV_MAG_DEVTYPE_LSM303AGR 0x62
113 #define DRV_ACC_DEVTYPE_ADIS16497 0x63
114 #define DRV_GYR_DEVTYPE_ADIS16497 0x64
115 
116 /*
117  * ioctl() definitions
118  *
119  * Note that a driver may not implement all of these operations, but
120  * if the operation is implemented it should conform to this API.
121  */
122 
123 #define _SENSORIOCBASE (0x2000)
124 #define _SENSORIOC(_n) (_PX4_IOC(_SENSORIOCBASE, _n))
125 
130 #define SENSORIOCSPOLLRATE _SENSORIOC(0)
131 
132 #define SENSOR_POLLRATE_DEFAULT 1000003
137 #define SENSORIOCRESET _SENSORIOC(4)
138 
139 #endif /* _DRV_SENSOR_H */
Generally used magic defines.
Generic device / sensor interface.