2 ******************************************************************************
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 *****************************************************************************/
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
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
37 #include <pios_helpers.h>
38 #include <pios_math.h>
39 #include <pios_constants.h>
42 /* SimPosix version of this file. This will probably be removed later */
43 #include <pios_sim_posix.h>
54 /* STM32 Std Peripherals Lib */
55 #if defined(STM32F10X)
56 #include <stm32f10x.h>
57 #elif defined(STM32F4XX)
58 #include <stm32f4xx.h>
59 #include <stm32f4xx_rcc.h>
60 #elif defined(STM32F0)
61 #include <stm32f0xx.h>
63 #error "No Architecture defined"
66 /* PIOS board specific feature selection */
67 #include "pios_config.h"
69 /* PIOS board specific device configuration */
70 #include "pios_board.h"
72 /* PIOS debug interface */
73 /* #define PIOS_INCLUDE_DEBUG_CONSOLE */
74 /* #define DEBUG_LEVEL 0 */
75 /* #define PIOS_ENABLE_DEBUG_PINS */
76 #include <pios_debug.h>
77 #include <pios_debuglog.h>
79 /* PIOS common functions */
82 /* PIOS FreeRTOS support */
83 #ifdef PIOS_INCLUDE_FREERTOS
93 #include <pios_architecture.h>
95 #ifdef PIOS_INCLUDE_TASK_MONITOR
96 #ifndef PIOS_INCLUDE_FREERTOS
97 #error PiOS Task Monitor requires PIOS_INCLUDE_FREERTOS to be defined
99 #include <pios_task_monitor.h>
102 /* PIOS CallbackScheduler */
103 #ifdef PIOS_INCLUDE_CALLBACKSCHEDULER
104 #ifndef PIOS_INCLUDE_FREERTOS
105 #error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined
107 #include <pios_callbackscheduler.h>
110 /* PIOS bootloader helper */
111 #ifdef PIOS_INCLUDE_BL_HELPER
112 /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */
113 #include <pios_bl_helper.h>
116 /* PIOS system functions */
117 #ifdef PIOS_INCLUDE_DELAY
118 #include <pios_delay.h>
119 #include <pios_deltatime.h>
122 #ifdef PIOS_INCLUDE_INITCALL
123 #include "pios_initcall.h"
126 #ifdef PIOS_INCLUDE_SYS
127 #include <pios_sys.h>
130 /* PIOS hardware peripherals */
131 #ifdef PIOS_INCLUDE_IRQ
132 #include <pios_irq.h>
135 #ifdef PIOS_INCLUDE_RTC
136 #include <pios_rtc.h>
139 #ifdef PIOS_INCLUDE_TIM
140 #include <pios_tim.h>
143 #ifdef PIOS_INCLUDE_USART
144 #include <pios_usart.h>
147 #ifdef PIOS_INCLUDE_ADC
148 #include <pios_adc.h>
151 #ifdef PIOS_INCLUDE_I2C
152 #include <pios_i2c.h>
155 #ifdef PIOS_INCLUDE_SPI
156 #include <pios_spi.h>
159 #ifdef PIOS_INCLUDE_GPIO
160 #include <pios_gpio.h>
163 #ifdef PIOS_INCLUDE_EXTI
164 #include <pios_exti.h>
167 #ifdef PIOS_INCLUDE_WDG
168 #include <pios_wdg.h>
171 /* PIOS USB functions */
172 #ifdef PIOS_INCLUDE_USB
173 /* #define PIOS_INCLUDE_USB_HID */
174 /* #define PIOS_INCLUDE_USB_CDC */
175 /* #define PIOS_INCLUDE_USB_RCTX */
176 #include <pios_usb.h>
177 #ifdef PIOS_INCLUDE_USB_HID
178 #include <pios_usb_hid.h>
180 #ifdef PIOS_INCLUDE_USB_RCTX
181 #include <pios_usb_rctx.h>
185 /* PIOS sensor interfaces */
186 #ifdef PIOS_INCLUDE_ADXL345
187 /* ADXL345 3-Axis Accelerometer */
188 #include <pios_adxl345.h>
191 #ifdef PIOS_INCLUDE_BMA180
192 /* BMA180 3-Axis Accelerometer */
193 #include <pios_bma180.h>
196 #ifdef PIOS_INCLUDE_L3GD20
197 /* L3GD20 3-Axis Gyro */
198 #include <pios_l3gd20.h>
201 #ifdef PIOS_INCLUDE_MPU6000
202 /* MPU6000 3-Axis Gyro/Accelerometer */
203 /* #define PIOS_MPU6000_ACCEL */
204 #include <pios_mpu6000.h>
207 #ifdef PIOS_INCLUDE_HMC5843
208 /* HMC5843 3-Axis Digital Compass */
209 #include <pios_hmc5843.h>
212 #ifdef PIOS_INCLUDE_HMC5X83
213 /* HMC5883/HMC5983 3-Axis Digital Compass */
214 /* #define PIOS_HMC5x83_HAS_GPIOS */
215 #include <pios_hmc5x83.h>
218 #ifdef PIOS_INCLUDE_BMP085
219 /* BMP085 Barometric Pressure Sensor */
220 #include <pios_bmp085.h>
223 #ifdef PIOS_INCLUDE_MS5611
224 /* MS5611 Barometric Pressure Sensor */
225 #include <pios_ms5611.h>
228 #ifdef PIOS_INCLUDE_MPXV
229 /* MPXV5004, MPXV7002 based Airspeed Sensor */
230 #include <pios_mpxv.h>
233 #ifdef PIOS_INCLUDE_ETASV3
234 /* Eagle Tree Systems Airspeed MicroSensor V3 */
235 #include <pios_etasv3.h>
238 #ifdef PIOS_INCLUDE_MS4525DO
239 /* PixHawk Airspeed Sensor based on MS4525DO */
240 #include <pios_ms4525do.h>
244 #ifdef PIOS_INCLUDE_HCSR04
245 /* HC-SR04 Ultrasonic Sensor */
246 #include <pios_hcsr04.h>
249 /* PIOS receiver drivers */
250 #ifdef PIOS_INCLUDE_PWM
251 #include <pios_pwm.h>
254 #ifdef PIOS_INCLUDE_PPM
255 #include <pios_ppm.h>
258 #ifdef PIOS_INCLUDE_PPM_FLEXI
259 /* PPM on CC flexi port */
262 #ifdef PIOS_INCLUDE_DSM
263 #include <pios_dsm.h>
266 #ifdef PIOS_INCLUDE_SBUS
267 #include <pios_sbus.h>
270 /* PIOS abstract receiver interface */
271 #ifdef PIOS_INCLUDE_RCVR
272 #include <pios_rcvr.h>
275 /* PIOS common peripherals */
276 #ifdef PIOS_INCLUDE_LED
277 #include <pios_led.h>
280 #ifdef PIOS_INCLUDE_IAP
281 #include <pios_iap.h>
284 #ifdef PIOS_INCLUDE_SERVO
285 #include <pios_servo.h>
288 #ifdef PIOS_INCLUDE_I2C_ESC
289 #include <pios_i2c_esc.h>
292 #ifdef PIOS_INCLUDE_OVERO
293 /* #define PIOS_OVERO_SPI */
294 #include <pios_overo.h>
297 #ifdef PIOS_INCLUDE_SDCARD
298 /* #define LOG_FILENAME "startup.log" */
300 #include <pios_sdcard.h>
303 #ifdef PIOS_INCLUDE_FLASH
304 /* #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS */
305 /* #define FLASH_FREERTOS */
306 #include <pios_flash.h>
307 #include <pios_flashfs.h>
310 /* driver for storage on internal flash */
311 /* #define PIOS_INCLUDE_FLASH_INTERNAL */
313 #ifdef PIOS_INCLUDE_FLASH_EEPROM
314 #include <pios_eeprom.h>
317 /* PIOS radio modules */
318 #ifdef PIOS_INCLUDE_RFM22B
319 /* #define PIOS_INCLUDE_PPM_OUT */
320 /* #define PIOS_RFM22B_DEBUG_ON_TELEM */
321 #include <pios_rfm22b.h>
322 #ifdef PIOS_INCLUDE_RFM22B_COM
323 #include <pios_rfm22b_com.h>
325 #endif /* PIOS_INCLUDE_RFM22B */
327 /* PIOS misc peripherals */
328 #ifdef PIOS_INCLUDE_VIDEO
329 #include <pios_video.h>
332 #ifdef PIOS_INCLUDE_WAVE
333 #include <pios_wavplay.h>
336 #ifdef PIOS_INCLUDE_UDP
337 #include <pios_udp.h>
340 /* PIOS abstract comms interface with options */
341 #ifdef PIOS_INCLUDE_COM
342 /* #define PIOS_INCLUDE_COM_MSG */
343 /* #define PIOS_INCLUDE_TELEMETRY_RF */
344 /* #define PIOS_INCLUDE_COM_TELEM */
345 /* #define PIOS_INCLUDE_COM_FLEXI */
346 /* #define PIOS_INCLUDE_COM_AUX */
347 /* #define PIOS_TELEM_PRIORITY_QUEUE */
348 /* #define PIOS_INCLUDE_GPS */
349 /* #define PIOS_GPS_MINIMAL */
350 /* #define PIOS_INCLUDE_GPS_NMEA_PARSER */
351 /* #define PIOS_INCLUDE_GPS_UBX_PARSER */
352 /* #define PIOS_GPS_SETS_HOMELOCATION */
353 #include <pios_com.h>
356 /* Stabilization options */
357 /* #define PIOS_QUATERNION_STABILIZATION */
359 /* Performance counters */
360 /* #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 */
362 #endif /* USE_SIM_POSIX */