APM:Libraries
AP_HAL_Boards.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #define HAL_BOARD_SITL 3
10 #define HAL_BOARD_SMACCM 4 // unused
11 #define HAL_BOARD_PX4 5
12 #define HAL_BOARD_LINUX 7
13 #define HAL_BOARD_VRBRAIN 8
14 #define HAL_BOARD_CHIBIOS 10
15 #define HAL_BOARD_F4LIGHT 11
16 #define HAL_BOARD_EMPTY 99
17 
18 /* Default board subtype is -1 */
19 #define HAL_BOARD_SUBTYPE_NONE -1
20 
21 /* HAL Linux sub-types, starting at 1000 */
22 #define HAL_BOARD_SUBTYPE_LINUX_NONE 1000
23 #define HAL_BOARD_SUBTYPE_LINUX_ERLEBOARD 1001
24 #define HAL_BOARD_SUBTYPE_LINUX_PXF 1002
25 #define HAL_BOARD_SUBTYPE_LINUX_NAVIO 1003
26 #define HAL_BOARD_SUBTYPE_LINUX_ZYNQ 1004
27 #define HAL_BOARD_SUBTYPE_LINUX_BBBMINI 1005
28 #define HAL_BOARD_SUBTYPE_LINUX_BEBOP 1006
29 #define HAL_BOARD_SUBTYPE_LINUX_MINLURE 1008
30 #define HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2 1009
31 #define HAL_BOARD_SUBTYPE_LINUX_BH 1010
32 #define HAL_BOARD_SUBTYPE_LINUX_PXFMINI 1012
33 #define HAL_BOARD_SUBTYPE_LINUX_NAVIO2 1013
34 #define HAL_BOARD_SUBTYPE_LINUX_DISCO 1014
35 #define HAL_BOARD_SUBTYPE_LINUX_AERO 1015
36 #define HAL_BOARD_SUBTYPE_LINUX_DARK 1016
37 #define HAL_BOARD_SUBTYPE_LINUX_BLUE 1018
38 #define HAL_BOARD_SUBTYPE_LINUX_OCPOC_ZYNQ 1019
39 #define HAL_BOARD_SUBTYPE_LINUX_EDGE 1020
40 #define HAL_BOARD_SUBTYPE_LINUX_RST_ZYNQ 1021
41 #define HAL_BOARD_SUBTYPE_LINUX_POCKET 1022
42 
43 /* HAL PX4 sub-types, starting at 2000 */
44 #define HAL_BOARD_SUBTYPE_PX4_V1 2000
45 #define HAL_BOARD_SUBTYPE_PX4_V2 2001
46 #define HAL_BOARD_SUBTYPE_PX4_V4 2002
47 #define HAL_BOARD_SUBTYPE_PX4_V3 2003
48 #define HAL_BOARD_SUBTYPE_PX4_AEROFC_V1 2004
49 #define HAL_BOARD_SUBTYPE_PX4_V4PRO 2005
50 
51 /* HAL VRBRAIN sub-types, starting at 4000 */
52 #define HAL_BOARD_SUBTYPE_VRBRAIN_V45 4000
53 #define HAL_BOARD_SUBTYPE_VRBRAIN_V51 4001
54 #define HAL_BOARD_SUBTYPE_VRBRAIN_V52 4002
55 #define HAL_BOARD_SUBTYPE_VRUBRAIN_V51 4003
56 #define HAL_BOARD_SUBTYPE_VRUBRAIN_V52 4004
57 #define HAL_BOARD_SUBTYPE_VRCORE_V10 4005
58 #define HAL_BOARD_SUBTYPE_VRBRAIN_V54 4006
59 #define HAL_BOARD_SUBTYPE_VRBRAIN_V52E 4007
60 
61 
62 /* HAL CHIBIOS sub-types, starting at 5000 */
63 #define HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412 5000
64 #define HAL_BOARD_SUBTYPE_CHIBIOS_FMUV3 5001
65 #define HAL_BOARD_SUBTYPE_CHIBIOS_FMUV4 5002
66 #define HAL_BOARD_SUBTYPE_CHIBIOS_MINDPXV2 5003
67 #define HAL_BOARD_SUBTYPE_CHIBIOS_SPARKY2 5004
68 #define HAL_BOARD_SUBTYPE_CHIBIOS_REVOMINI 5005
69 #define HAL_BOARD_SUBTYPE_CHIBIOS_MINIPIX 5006
70 #define HAL_BOARD_SUBTYPE_CHIBIOS_CRAZYFLIE2 5007
71 #define HAL_BOARD_SUBTYPE_CHIBIOS_OMNIBUSF7V2 5008
72 #define HAL_BOARD_SUBTYPE_CHIBIOS_GENERIC 5009
73 #define HAL_BOARD_SUBTYPE_CHIBIOS_F4BY 5010
74 #define HAL_BOARD_SUBTYPE_CHIBIOS_OMNIBUSF4PRO 5011
75 #define HAL_BOARD_SUBTYPE_CHIBIOS_AIRBOTF4 5012
76 
77 /* InertialSensor driver types */
78 #define HAL_INS_NONE 0
79 #define HAL_INS_MPU60XX_SPI 2
80 #define HAL_INS_MPU60XX_I2C 3
81 #define HAL_INS_HIL 4
82 #define HAL_INS_PX4 5
83 #define HAL_INS_L3G4200D 7
84 #define HAL_INS_VRBRAIN 8
85 #define HAL_INS_MPU9250_SPI 9
86 #define HAL_INS_L3GD20 10
87 #define HAL_INS_LSM9DS0 11
88 #define HAL_INS_MPU9250_I2C 13
89 #define HAL_INS_BH 14
90 #define HAL_INS_BBBMINI 17
91 #define HAL_INS_AERO 18
92 #define HAL_INS_MPU6500 19
93 #define HAL_INS_EDGE 20
94 #define HAL_INS_RST 21
95 #define HAL_INS_LSM9DS1 22
96 #define HAL_INS_ICM20789_SPI 23
97 
98 /* Barometer driver types */
99 #define HAL_BARO_NONE 0
100 #define HAL_BARO_BMP085 1
101 #define HAL_BARO_MS5611_I2C 2
102 #define HAL_BARO_MS5611_SPI 3
103 #define HAL_BARO_MS5607_I2C 4
104 #define HAL_BARO_PX4 5
105 #define HAL_BARO_HIL 6
106 #define HAL_BARO_VRBRAIN 7
107 #define HAL_BARO_MS5637_I2C 8
108 #define HAL_BARO_BMP280_I2C 11
109 #define HAL_BARO_BMP280_SPI 12
110 #define HAL_BARO_LPS25H 13
111 #define HAL_BARO_20789_I2C_I2C 14
112 #define HAL_BARO_20789_I2C_SPI 15
113 #define HAL_BARO_LPS22H_SPI 16
114 #define HAL_BARO_LPS25H_IMU_I2C 17
115 #define HAL_BARO_FBM320_I2C 18
116 #define HAL_BARO_DPS280_I2C 19
117 
118 /* Compass driver types */
119 #define HAL_COMPASS_NONE 0
120 #define HAL_COMPASS_HMC5843 1
121 #define HAL_COMPASS_PX4 2
122 #define HAL_COMPASS_HIL 3
123 #define HAL_COMPASS_VRBRAIN 4
124 #define HAL_COMPASS_AK8963_MPU9250 5
125 #define HAL_COMPASS_AK8963_I2C 6
126 #define HAL_COMPASS_HMC5843_MPU6000 7
127 #define HAL_COMPASS_AK8963_MPU9250_I2C 9
128 #define HAL_COMPASS_BH 10
129 #define HAL_COMPASS_BBBMINI 13
130 #define HAL_COMPASS_NAVIO2 14
131 #define HAL_COMPASS_NAVIO 15
132 #define HAL_COMPASS_AERO 16
133 #define HAL_COMPASS_OCPOC_ZYNQ 17
134 #define HAL_COMPASS_EDGE 18
135 #define HAL_COMPASS_LIS3MDL 19
136 #define HAL_COMPASS_MAG3110 20
137 #define HAL_COMPASS_BMM150_I2C 21
138 #define HAL_COMPASS_QMC5883L 22
139 #define HAL_COMPASS_IST8310 23
140 
141 /* Heat Types */
142 #define HAL_LINUX_HEAT_PWM 1
143 
144 /* CPU classes, used to select if CPU intensive algorithms should be used
145  * Note that these are only approximate, not exact CPU speeds. */
146 
147 /* 150Mhz: PX4 or similar. Assumes:
148  * - hardware floating point
149  * - tens of kilobytes of memory available */
150 #define HAL_CPU_CLASS_150 3
151 /* GigaHz class: SITL, BeagleBone etc. Assumes megabytes of memory available. */
152 #define HAL_CPU_CLASS_1000 4
153 
154 /* Operating system features
155  *
156  * HAL implementations may define the following extra feature defines to 1 if
157  * available:
158  *
159  * - HAL_OS_POSIX_IO : has posix-like filesystem IO
160  * - HAL_OS_SOCKETS : has posix-like sockets */
161 
162 /* DEFINITIONS FOR BOARDS */
163 
164 #if CONFIG_HAL_BOARD == HAL_BOARD_SITL
165  #include <AP_HAL/board/sitl.h>
166 #elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
167  #include <AP_HAL/board/px4.h>
168 #elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX
169  #include <AP_HAL/board/linux.h>
170 #elif CONFIG_HAL_BOARD == HAL_BOARD_EMPTY
171  #include <AP_HAL/board/empty.h>
172 #elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
173  #include <AP_HAL/board/vrbrain.h>
174 #elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
175  #include <AP_HAL/board/chibios.h>
176 #elif CONFIG_HAL_BOARD == HAL_BOARD_F4LIGHT
177  #include <AP_HAL/board/f4light.h>
178 #else
179 #error "Unknown CONFIG_HAL_BOARD type"
180 #endif
181 
182 #ifndef CONFIG_HAL_BOARD_SUBTYPE
183 #error "No CONFIG_HAL_BOARD_SUBTYPE set"
184 #endif
185 
186 #ifndef HAL_OS_POSIX_IO
187 #define HAL_OS_POSIX_IO 0
188 #endif
189 
190 #ifndef HAL_OS_SOCKETS
191 #define HAL_OS_SOCKETS 0
192 #endif
193 
194 #ifndef HAL_PARAM_DEFAULTS_PATH
195 #define HAL_PARAM_DEFAULTS_PATH nullptr
196 #endif
197 
198 #ifndef HAL_HAVE_IMU_HEATER
199 #define HAL_HAVE_IMU_HEATER 0
200 #endif
201 
202 #ifndef HAL_COMPASS_HMC5843_I2C_ADDR
203 #define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E
204 #endif
205 
206 #ifndef HAL_WITH_UAVCAN
207 #define HAL_WITH_UAVCAN 0
208 #endif
209 
210 #ifndef HAL_RCINPUT_WITH_AP_RADIO
211 #define HAL_RCINPUT_WITH_AP_RADIO 0
212 #endif
213 
214 #ifndef HAL_WITH_IO_MCU
215 #define HAL_WITH_IO_MCU 0
216 #endif
217 
218 // this is used as a general mechanism to make a 'small' build by
219 // dropping little used features. We use this to allow us to keep
220 // FMUv2 going for as long as possible
221 #ifndef HAL_MINIMIZE_FEATURES
222 #define HAL_MINIMIZE_FEATURES 0
223 #endif
224 
225 #ifndef HAL_OS_FATFS_IO
226 #define HAL_OS_FATFS_IO 0
227 #endif
228 
229 #ifndef HAL_PX4_HAVE_PX4IO
230 #define HAL_PX4_HAVE_PX4IO 0
231 #endif
232 
233 #ifndef HAL_COMPASS_DEFAULT
234 #define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
235 #endif
236 
237 #ifndef HAL_BARO_DEFAULT
238 #define HAL_BARO_DEFAULT HAL_BARO_NONE
239 #endif
240 
241 #ifndef HAL_INS_DEFAULT
242 #define HAL_INS_DEFAULT HAL_INS_NONE
243 #endif
244 
245 #ifndef HAL_GPS_TYPE_DEFAULT
246 #define HAL_GPS_TYPE_DEFAULT 1
247 #endif
248 
249 #ifndef HAL_CAN_DRIVER_DEFAULT
250 #define HAL_CAN_DRIVER_DEFAULT 0
251 #endif
252 
253 #ifdef HAVE_LIBDL
254 #define AP_MODULE_SUPPORTED 1
255 #else
256 #define AP_MODULE_SUPPORTED 0
257 #endif
258 
259 #ifndef HAL_SUPPORT_RCOUT_SERIAL
260 #define HAL_SUPPORT_RCOUT_SERIAL 0
261 #endif
262