OP-1483 Added velocity filter to correct EKF's velocity estimate for static velocity...
[librepilot.git] / flight / pios / pios.h
blob124dc1d8a620cf7bdf9a67fe7ffe22e7c1260b98
1 /**
2 ******************************************************************************
3 * @file pios.h
4 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010-2013
5 * @author PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
6 * @brief Main PiOS header.
7 * @see The GNU Public License (GPL) Version 3
8 *****************************************************************************/
9 /*
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * To add new PIOS options, drivers or functions please insert their
27 * includes below into a corresponding group. If new driver has optional
28 * features, add them as comments before including the driver header.
29 * Finally update all pios_config.h files for every board in the same order
30 * as in this file. Include new definition and all options, but comment
31 * out unused ones.
34 #ifndef PIOS_H
35 #define PIOS_H
37 #include <pios_helpers.h>
38 #include <pios_math.h>
39 #include <pios_constants.h>
41 #ifdef USE_SIM_POSIX
42 /* SimPosix version of this file. This will probably be removed later */
43 #include <pios_sim_posix.h>
44 #else
46 /* C Lib includes */
47 #include <stdio.h>
48 #include <stdlib.h>
49 #include <stdarg.h>
50 #include <string.h>
51 #include <math.h>
53 /* STM32 Std Peripherals Lib */
54 #if defined(STM32F10X)
55 #include <stm32f10x.h>
56 #elif defined(STM32F4XX)
57 #include <stm32f4xx.h>
58 #include <stm32f4xx_rcc.h>
59 #endif
61 /* PIOS board specific feature selection */
62 #include "pios_config.h"
64 /* PIOS board specific device configuration */
65 #include "pios_board.h"
67 /* PIOS debug interface */
68 /* #define PIOS_INCLUDE_DEBUG_CONSOLE */
69 /* #define DEBUG_LEVEL 0 */
70 /* #define PIOS_ENABLE_DEBUG_PINS */
71 #include <pios_debug.h>
72 #include <pios_debuglog.h>
74 /* PIOS common functions */
75 #include <pios_crc.h>
77 /* PIOS FreeRTOS support */
78 #ifdef PIOS_INCLUDE_FREERTOS
79 #include "FreeRTOS.h"
80 #include "task.h"
81 #include "queue.h"
82 #include "semphr.h"
83 #endif
84 #include <stdbool.h>
86 #include <pios_mem.h>
88 #include <pios_architecture.h>
90 #ifdef PIOS_INCLUDE_TASK_MONITOR
91 #ifndef PIOS_INCLUDE_FREERTOS
92 #error PiOS Task Monitor requires PIOS_INCLUDE_FREERTOS to be defined
93 #endif
94 #include <pios_task_monitor.h>
95 #endif
97 /* PIOS CallbackScheduler */
98 #ifdef PIOS_INCLUDE_CALLBACKSCHEDULER
99 #ifndef PIOS_INCLUDE_FREERTOS
100 #error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined
101 #endif
102 #include <pios_callbackscheduler.h>
103 #endif
105 /* PIOS bootloader helper */
106 #ifdef PIOS_INCLUDE_BL_HELPER
107 /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */
108 #include <pios_bl_helper.h>
109 #endif
111 /* PIOS system functions */
112 #ifdef PIOS_INCLUDE_DELAY
113 #include <pios_delay.h>
114 #include <pios_deltatime.h>
115 #endif
117 #ifdef PIOS_INCLUDE_INITCALL
118 #include "pios_initcall.h"
119 #endif
121 #ifdef PIOS_INCLUDE_SYS
122 #include <pios_sys.h>
123 #endif
125 /* PIOS hardware peripherals */
126 #ifdef PIOS_INCLUDE_IRQ
127 #include <pios_irq.h>
128 #endif
130 #ifdef PIOS_INCLUDE_RTC
131 #include <pios_rtc.h>
132 #endif
134 #ifdef PIOS_INCLUDE_TIM
135 #include <pios_tim.h>
136 #endif
138 #ifdef PIOS_INCLUDE_USART
139 #include <pios_usart.h>
140 #endif
142 #ifdef PIOS_INCLUDE_ADC
143 #include <pios_adc.h>
144 #endif
146 #ifdef PIOS_INCLUDE_I2C
147 #include <pios_i2c.h>
148 #endif
150 #ifdef PIOS_INCLUDE_SPI
151 #include <pios_spi.h>
152 #endif
154 #ifdef PIOS_INCLUDE_GPIO
155 #include <pios_gpio.h>
156 #endif
158 #ifdef PIOS_INCLUDE_EXTI
159 #include <pios_exti.h>
160 #endif
162 #ifdef PIOS_INCLUDE_WDG
163 #include <pios_wdg.h>
164 #endif
166 /* PIOS USB functions */
167 #ifdef PIOS_INCLUDE_USB
168 /* #define PIOS_INCLUDE_USB_HID */
169 /* #define PIOS_INCLUDE_USB_CDC */
170 /* #define PIOS_INCLUDE_USB_RCTX */
171 #include <pios_usb.h>
172 #ifdef PIOS_INCLUDE_USB_HID
173 #include <pios_usb_hid.h>
174 #endif
175 #ifdef PIOS_INCLUDE_USB_RCTX
176 #include <pios_usb_rctx.h>
177 #endif
178 #endif
180 /* PIOS sensor interfaces */
181 #ifdef PIOS_INCLUDE_ADXL345
182 /* ADXL345 3-Axis Accelerometer */
183 #include <pios_adxl345.h>
184 #endif
186 #ifdef PIOS_INCLUDE_BMA180
187 /* BMA180 3-Axis Accelerometer */
188 #include <pios_bma180.h>
189 #endif
191 #ifdef PIOS_INCLUDE_L3GD20
192 /* L3GD20 3-Axis Gyro */
193 #include <pios_l3gd20.h>
194 #endif
196 #ifdef PIOS_INCLUDE_MPU6000
197 /* MPU6000 3-Axis Gyro/Accelerometer */
198 /* #define PIOS_MPU6000_ACCEL */
199 #include <pios_mpu6000.h>
200 #endif
202 #ifdef PIOS_INCLUDE_HMC5843
203 /* HMC5843 3-Axis Digital Compass */
204 #include <pios_hmc5843.h>
205 #endif
207 #ifdef PIOS_INCLUDE_HMC5X83
208 /* HMC5883/HMC5983 3-Axis Digital Compass */
209 /* #define PIOS_HMC5x83_HAS_GPIOS */
210 #include <pios_hmc5x83.h>
211 #endif
213 #ifdef PIOS_INCLUDE_BMP085
214 /* BMP085 Barometric Pressure Sensor */
215 #include <pios_bmp085.h>
216 #endif
218 #ifdef PIOS_INCLUDE_MS5611
219 /* MS5611 Barometric Pressure Sensor */
220 #include <pios_ms5611.h>
221 #endif
223 #ifdef PIOS_INCLUDE_MPXV
224 /* MPXV5004, MPXV7002 based Airspeed Sensor */
225 #include <pios_mpxv.h>
226 #endif
228 #ifdef PIOS_INCLUDE_ETASV3
229 /* Eagle Tree Systems Airspeed MicroSensor V3 */
230 #include <pios_etasv3.h>
231 #endif
233 #ifdef PIOS_INCLUDE_MS4525DO
234 /* PixHawk Airspeed Sensor based on MS4525DO */
235 #include <pios_ms4525do.h>
236 #endif
239 #ifdef PIOS_INCLUDE_HCSR04
240 /* HC-SR04 Ultrasonic Sensor */
241 #include <pios_hcsr04.h>
242 #endif
244 /* PIOS receiver drivers */
245 #ifdef PIOS_INCLUDE_PWM
246 #include <pios_pwm.h>
247 #endif
249 #ifdef PIOS_INCLUDE_PPM
250 #include <pios_ppm.h>
251 #endif
253 #ifdef PIOS_INCLUDE_PPM_FLEXI
254 /* PPM on CC flexi port */
255 #endif
257 #ifdef PIOS_INCLUDE_DSM
258 #include <pios_dsm.h>
259 #endif
261 #ifdef PIOS_INCLUDE_SBUS
262 #include <pios_sbus.h>
263 #endif
265 /* PIOS abstract receiver interface */
266 #ifdef PIOS_INCLUDE_RCVR
267 #include <pios_rcvr.h>
268 #endif
270 /* PIOS common peripherals */
271 #ifdef PIOS_INCLUDE_LED
272 #include <pios_led.h>
273 #endif
275 #ifdef PIOS_INCLUDE_IAP
276 #include <pios_iap.h>
277 #endif
279 #ifdef PIOS_INCLUDE_SERVO
280 #include <pios_servo.h>
281 #endif
283 #ifdef PIOS_INCLUDE_I2C_ESC
284 #include <pios_i2c_esc.h>
285 #endif
287 #ifdef PIOS_INCLUDE_OVERO
288 /* #define PIOS_OVERO_SPI */
289 #include <pios_overo.h>
290 #endif
292 #ifdef PIOS_INCLUDE_SDCARD
293 /* #define LOG_FILENAME "startup.log" */
294 #include <dosfs.h>
295 #include <pios_sdcard.h>
296 #endif
298 #ifdef PIOS_INCLUDE_FLASH
299 /* #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS */
300 /* #define FLASH_FREERTOS */
301 #include <pios_flash.h>
302 #include <pios_flashfs.h>
303 #endif
305 /* driver for storage on internal flash */
306 /* #define PIOS_INCLUDE_FLASH_INTERNAL */
308 #ifdef PIOS_INCLUDE_FLASH_EEPROM
309 #include <pios_eeprom.h>
310 #endif
312 /* PIOS radio modules */
313 #ifdef PIOS_INCLUDE_RFM22B
314 /* #define PIOS_INCLUDE_PPM_OUT */
315 /* #define PIOS_RFM22B_DEBUG_ON_TELEM */
316 #include <pios_rfm22b.h>
317 #ifdef PIOS_INCLUDE_RFM22B_COM
318 #include <pios_rfm22b_com.h>
319 #endif
320 #endif /* PIOS_INCLUDE_RFM22B */
322 /* PIOS misc peripherals */
323 #ifdef PIOS_INCLUDE_VIDEO
324 #include <pios_video.h>
325 #endif
327 #ifdef PIOS_INCLUDE_WAVE
328 #include <pios_wavplay.h>
329 #endif
331 #ifdef PIOS_INCLUDE_UDP
332 #include <pios_udp.h>
333 #endif
335 /* PIOS abstract comms interface with options */
336 #ifdef PIOS_INCLUDE_COM
337 /* #define PIOS_INCLUDE_COM_MSG */
338 /* #define PIOS_INCLUDE_TELEMETRY_RF */
339 /* #define PIOS_INCLUDE_COM_TELEM */
340 /* #define PIOS_INCLUDE_COM_FLEXI */
341 /* #define PIOS_INCLUDE_COM_AUX */
342 /* #define PIOS_TELEM_PRIORITY_QUEUE */
343 /* #define PIOS_INCLUDE_GPS */
344 /* #define PIOS_GPS_MINIMAL */
345 /* #define PIOS_INCLUDE_GPS_NMEA_PARSER */
346 /* #define PIOS_INCLUDE_GPS_UBX_PARSER */
347 /* #define PIOS_GPS_SETS_HOMELOCATION */
348 #include <pios_com.h>
349 #endif
351 /* Stabilization options */
352 /* #define PIOS_QUATERNION_STABILIZATION */
354 /* Performance counters */
355 /* #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 */
357 #endif /* USE_SIM_POSIX */
358 #endif /* PIOS_H */