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
41 #include <pios_helpers.h>
42 #include <pios_math.h>
43 #include <pios_constants.h>
46 /* SimPosix version of this file. This will probably be removed later */
47 #include <pios_sim_posix.h>
58 /* STM32 Std Peripherals Lib */
59 #if defined(STM32F10X)
60 #include <stm32f10x.h>
61 #elif defined(STM32F4XX)
62 #include <stm32f4xx.h>
63 #include <stm32f4xx_rcc.h>
64 #elif defined(STM32F0)
65 #include <stm32f0xx.h>
67 #error "No Architecture defined"
70 /* PIOS board specific feature selection */
71 #include "pios_config.h"
73 /* PIOS board specific device configuration */
74 #include "pios_board.h"
76 /* PIOS debug interface */
77 /* #define PIOS_INCLUDE_DEBUG_CONSOLE */
78 /* #define DEBUG_LEVEL 0 */
79 /* #define PIOS_ENABLE_DEBUG_PINS */
80 #include <pios_debug.h>
81 #include <pios_debuglog.h>
83 /* PIOS common functions */
86 /* PIOS FreeRTOS support */
87 #ifdef PIOS_INCLUDE_FREERTOS
97 #include <pios_architecture.h>
99 #ifdef PIOS_INCLUDE_TASK_MONITOR
100 #ifndef PIOS_INCLUDE_FREERTOS
101 #error PiOS Task Monitor requires PIOS_INCLUDE_FREERTOS to be defined
103 #include <pios_task_monitor.h>
106 /* PIOS CallbackScheduler */
107 #ifdef PIOS_INCLUDE_CALLBACKSCHEDULER
108 #ifndef PIOS_INCLUDE_FREERTOS
109 #error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined
111 #include <pios_callbackscheduler.h>
114 /* PIOS bootloader helper */
115 #ifdef PIOS_INCLUDE_BL_HELPER
116 /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */
117 #include <pios_bl_helper.h>
120 /* PIOS system functions */
121 #ifdef PIOS_INCLUDE_DELAY
122 #include <pios_delay.h>
123 #include <pios_deltatime.h>
126 #ifdef PIOS_INCLUDE_INITCALL
127 #include "pios_initcall.h"
130 #ifdef PIOS_INCLUDE_SYS
131 #include <pios_sys.h>
134 /* PIOS hardware peripherals */
135 #ifdef PIOS_INCLUDE_IRQ
136 #include <pios_irq.h>
139 #ifdef PIOS_INCLUDE_RTC
140 #include <pios_rtc.h>
143 #ifdef PIOS_INCLUDE_TIM
144 #include <pios_tim.h>
147 #ifdef PIOS_INCLUDE_USART
148 #include <pios_usart.h>
151 #ifdef PIOS_INCLUDE_ADC
152 #include <pios_adc.h>
155 #ifdef PIOS_INCLUDE_I2C
156 #include <pios_i2c.h>
159 #ifdef PIOS_INCLUDE_SPI
160 #include <pios_spi.h>
163 #ifdef PIOS_INCLUDE_GPIO
164 #include <pios_gpio.h>
167 #ifdef PIOS_INCLUDE_EXTI
168 #include <pios_exti.h>
171 #ifdef PIOS_INCLUDE_WDG
172 #include <pios_wdg.h>
175 /* PIOS USB functions */
176 #ifdef PIOS_INCLUDE_USB
177 /* #define PIOS_INCLUDE_USB_HID */
178 /* #define PIOS_INCLUDE_USB_CDC */
179 /* #define PIOS_INCLUDE_USB_RCTX */
180 #include <pios_usb.h>
181 #ifdef PIOS_INCLUDE_USB_HID
182 #include <pios_usb_hid.h>
184 #ifdef PIOS_INCLUDE_USB_RCTX
185 #include <pios_usb_rctx.h>
189 #ifdef PIOS_INCLUDE_MPXV
190 /* MPXV5004, MPXV7002 based Airspeed Sensor */
191 #include <pios_mpxv.h>
194 #ifdef PIOS_INCLUDE_ETASV3
195 /* Eagle Tree Systems Airspeed MicroSensor V3 */
196 #include <pios_etasv3.h>
199 #ifdef PIOS_INCLUDE_MS4525DO
200 /* PixHawk Airspeed Sensor based on MS4525DO */
201 #include <pios_ms4525do.h>
205 #ifdef PIOS_INCLUDE_HCSR04
206 /* HC-SR04 Ultrasonic Sensor */
207 #include <pios_hcsr04.h>
210 /* PIOS receiver drivers */
211 #ifdef PIOS_INCLUDE_PWM
212 #include <pios_pwm.h>
215 #ifdef PIOS_INCLUDE_PPM
216 #include <pios_ppm.h>
219 #ifdef PIOS_INCLUDE_PPM_FLEXI
220 /* PPM on CC flexi port */
223 #ifdef PIOS_INCLUDE_DSM
224 #include <pios_dsm.h>
227 #ifdef PIOS_INCLUDE_SBUS
228 #include <pios_sbus.h>
231 #ifdef PIOS_INCLUDE_SRXL
232 #include <pios_srxl.h>
235 /* PIOS abstract receiver interface */
236 #ifdef PIOS_INCLUDE_RCVR
237 #include <pios_rcvr.h>
240 /* PIOS common peripherals */
241 #ifdef PIOS_INCLUDE_LED
242 #include <pios_led.h>
245 #ifdef PIOS_INCLUDE_IAP
246 #include <pios_iap.h>
249 #ifdef PIOS_INCLUDE_SERVO
250 #include <pios_servo.h>
253 #ifdef PIOS_INCLUDE_I2C_ESC
254 #include <pios_i2c_esc.h>
257 #ifdef PIOS_INCLUDE_OVERO
258 /* #define PIOS_OVERO_SPI */
259 #include <pios_overo.h>
262 #ifdef PIOS_INCLUDE_SDCARD
263 /* #define LOG_FILENAME "startup.log" */
265 #include <pios_sdcard.h>
268 #ifdef PIOS_INCLUDE_FLASH
269 /* #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS */
270 /* #define FLASH_FREERTOS */
271 #include <pios_flash.h>
272 #include <pios_flashfs.h>
275 /* driver for storage on internal flash */
276 /* #define PIOS_INCLUDE_FLASH_INTERNAL */
278 #ifdef PIOS_INCLUDE_FLASH_EEPROM
279 #include <pios_flash_eeprom.h>
282 /* PIOS radio modules */
283 #ifdef PIOS_INCLUDE_RFM22B
284 /* #define PIOS_INCLUDE_PPM_OUT */
285 /* #define PIOS_RFM22B_DEBUG_ON_TELEM */
286 #include <pios_rfm22b.h>
287 #ifdef PIOS_INCLUDE_RFM22B_COM
288 #include <pios_rfm22b_com.h>
290 #endif /* PIOS_INCLUDE_RFM22B */
292 /* PIOS misc peripherals */
293 #ifdef PIOS_INCLUDE_VIDEO
294 #include <pios_video.h>
297 #ifdef PIOS_INCLUDE_WAVE
298 #include <pios_wavplay.h>
301 #ifdef PIOS_INCLUDE_UDP
302 #include <pios_udp.h>
305 /* PIOS abstract comms interface with options */
306 #ifdef PIOS_INCLUDE_COM
307 /* #define PIOS_INCLUDE_COM_MSG */
308 /* #define PIOS_INCLUDE_TELEMETRY_RF */
309 /* #define PIOS_INCLUDE_COM_TELEM */
310 /* #define PIOS_INCLUDE_COM_FLEXI */
311 /* #define PIOS_INCLUDE_COM_AUX */
312 /* #define PIOS_TELEM_PRIORITY_QUEUE */
313 /* #define PIOS_INCLUDE_GPS */
314 /* #define PIOS_GPS_MINIMAL */
315 /* #define PIOS_INCLUDE_GPS_NMEA_PARSER */
316 /* #define PIOS_INCLUDE_GPS_UBX_PARSER */
317 /* #define PIOS_GPS_SETS_HOMELOCATION */
318 #include <pios_com.h>
321 /* Stabilization options */
322 /* #define PIOS_QUATERNION_STABILIZATION */
324 /* Performance counters */
325 /* #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 */
327 #endif /* USE_SIM_POSIX */
331 } // closing brace for extern "C"