2 ******************************************************************************
4 * @author The LibrePilot Project, http://www.librepilot.org, Copyright (C) 2015
5 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010-2013
6 * PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
7 * @brief Main PiOS header.
8 * @see The GNU Public License (GPL) Version 3
9 *****************************************************************************/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * To add new PIOS options, drivers or functions please insert their
28 * includes below into a corresponding group. If new driver has optional
29 * features, add them as comments before including the driver header.
30 * Finally update all pios_config.h files for every board in the same order
31 * as in this file. Include new definition and all options, but comment
42 #include <pios_helpers.h>
43 #include <pios_math.h>
44 #include <pios_constants.h>
47 /* SimPosix version of this file. This will probably be removed later */
48 #include <pios_sim_posix.h>
59 /* STM32 Std Peripherals Lib */
60 #if defined(STM32F10X)
61 #include <stm32f10x.h>
62 #elif defined(STM32F4XX)
63 #include <stm32f4xx.h>
64 #include <stm32f4xx_rcc.h>
65 #elif defined(STM32F0)
66 #include <stm32f0xx.h>
67 #elif defined(STM32F3)
68 #include <stm32f30x.h>
70 #error "No Architecture defined"
73 /* PIOS board specific feature selection */
74 #include "pios_config.h"
76 /* PIOS board specific device configuration */
77 #include "pios_board.h"
79 /* PIOS debug interface */
80 /* #define PIOS_INCLUDE_DEBUG_CONSOLE */
81 /* #define DEBUG_LEVEL 0 */
82 /* #define PIOS_ENABLE_DEBUG_PINS */
83 #include <pios_debug.h>
84 #include <pios_debuglog.h>
86 /* PIOS common functions */
89 /* PIOS FreeRTOS support */
90 #ifdef PIOS_INCLUDE_FREERTOS
100 #include <pios_architecture.h>
102 #ifdef PIOS_INCLUDE_TASK_MONITOR
103 #ifndef PIOS_INCLUDE_FREERTOS
104 #error PiOS Task Monitor requires PIOS_INCLUDE_FREERTOS to be defined
106 #include <pios_task_monitor.h>
109 /* PIOS CallbackScheduler */
110 #ifdef PIOS_INCLUDE_CALLBACKSCHEDULER
111 #ifndef PIOS_INCLUDE_FREERTOS
112 #error PiOS CallbackScheduler requires PIOS_INCLUDE_FREERTOS to be defined
114 #include <pios_callbackscheduler.h>
117 /* PIOS bootloader helper */
118 #ifdef PIOS_INCLUDE_BL_HELPER
119 /* #define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT */
120 #include <pios_bl_helper.h>
123 /* PIOS system functions */
124 #ifdef PIOS_INCLUDE_DELAY
125 #include <pios_delay.h>
126 #include <pios_deltatime.h>
129 #ifdef PIOS_INCLUDE_INITCALL
130 #include "pios_initcall.h"
133 #ifdef PIOS_INCLUDE_SYS
134 #include <pios_sys.h>
137 /* PIOS hardware peripherals */
138 #ifdef PIOS_INCLUDE_IRQ
139 #include <pios_irq.h>
142 #ifdef PIOS_INCLUDE_RTC
143 #include <pios_rtc.h>
146 #ifdef PIOS_INCLUDE_TIM
147 #include <pios_tim.h>
150 #ifdef PIOS_INCLUDE_USART
151 #include <pios_usart.h>
154 #ifdef PIOS_INCLUDE_ADC
155 #include <pios_adc.h>
158 #ifdef PIOS_INCLUDE_I2C
159 #include <pios_i2c.h>
162 #ifdef PIOS_INCLUDE_SPI
163 #include <pios_spi.h>
166 #ifdef PIOS_INCLUDE_GPIO
167 #include <pios_gpio.h>
170 #ifdef PIOS_INCLUDE_EXTI
171 #include <pios_exti.h>
174 #ifdef PIOS_INCLUDE_WDG
175 #include <pios_wdg.h>
178 /* PIOS USB functions */
179 #ifdef PIOS_INCLUDE_USB
180 /* #define PIOS_INCLUDE_USB_HID */
181 /* #define PIOS_INCLUDE_USB_CDC */
182 /* #define PIOS_INCLUDE_USB_RCTX */
183 #include <pios_usb.h>
184 #ifdef PIOS_INCLUDE_USB_HID
185 #include <pios_usb_hid.h>
187 #ifdef PIOS_INCLUDE_USB_RCTX
188 #include <pios_usb_rctx.h>
192 #ifdef PIOS_INCLUDE_MPXV
193 /* MPXV5004, MPXV7002 based Airspeed Sensor */
194 #include <pios_mpxv.h>
197 #ifdef PIOS_INCLUDE_ETASV3
198 /* Eagle Tree Systems Airspeed MicroSensor V3 */
199 #include <pios_etasv3.h>
202 #ifdef PIOS_INCLUDE_MS4525DO
203 /* PixHawk Airspeed Sensor based on MS4525DO */
204 #include <pios_ms4525do.h>
208 #ifdef PIOS_INCLUDE_HCSR04
209 /* HC-SR04 Ultrasonic Sensor */
210 #include <pios_hcsr04.h>
213 /* PIOS receiver drivers */
214 #ifdef PIOS_INCLUDE_PWM
215 #include <pios_pwm.h>
218 #ifdef PIOS_INCLUDE_PPM
219 #include <pios_ppm.h>
222 #ifdef PIOS_INCLUDE_PPM_FLEXI
223 /* PPM on CC flexi port */
226 #ifdef PIOS_INCLUDE_DSM
227 #include <pios_dsm.h>
230 #ifdef PIOS_INCLUDE_SBUS
231 #include <pios_sbus.h>
234 #ifdef PIOS_INCLUDE_HOTT
235 #include <pios_hott.h>
238 #ifdef PIOS_INCLUDE_EXBUS
239 #include <pios_exbus.h>
242 #ifdef PIOS_INCLUDE_SRXL
243 #include <pios_srxl.h>
246 #ifdef PIOS_INCLUDE_IBUS
247 #include <pios_ibus.h>
250 /* PIOS abstract receiver interface */
251 #ifdef PIOS_INCLUDE_RCVR
252 #include <pios_rcvr.h>
255 /* PIOS common peripherals */
256 #ifdef PIOS_INCLUDE_LED
257 #include <pios_led.h>
260 #ifdef PIOS_INCLUDE_IAP
261 #include <pios_iap.h>
264 #ifdef PIOS_INCLUDE_SERVO
265 #include <pios_servo.h>
268 #ifdef PIOS_INCLUDE_I2C_ESC
269 #include <pios_i2c_esc.h>
272 #ifdef PIOS_INCLUDE_OVERO
273 /* #define PIOS_OVERO_SPI */
274 #include <pios_overo.h>
277 #ifdef PIOS_INCLUDE_SDCARD
278 /* #define LOG_FILENAME "startup.log" */
280 #include <pios_sdcard.h>
283 #ifdef PIOS_INCLUDE_FLASH
284 /* #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS */
285 /* #define FLASH_FREERTOS */
286 #include <pios_flash.h>
287 #include <pios_flashfs.h>
290 /* driver for storage on internal flash */
291 /* #define PIOS_INCLUDE_FLASH_INTERNAL */
293 #ifdef PIOS_INCLUDE_FLASH_EEPROM
294 #include <pios_flash_eeprom.h>
297 /* PIOS radio modules */
298 #ifdef PIOS_INCLUDE_RFM22B
299 /* #define PIOS_INCLUDE_PPM_OUT */
300 /* #define PIOS_RFM22B_DEBUG_ON_TELEM */
301 #include <pios_rfm22b.h>
302 #ifdef PIOS_INCLUDE_RFM22B_COM
303 #include <pios_rfm22b_com.h>
305 #endif /* PIOS_INCLUDE_RFM22B */
307 /* PIOS misc peripherals */
308 #ifdef PIOS_INCLUDE_VIDEO
309 #include <pios_video.h>
312 #ifdef PIOS_INCLUDE_WAVE
313 #include <pios_wavplay.h>
316 #ifdef PIOS_INCLUDE_UDP
317 #include <pios_udp.h>
320 /* PIOS abstract comms interface with options */
321 #ifdef PIOS_INCLUDE_COM
322 /* #define PIOS_INCLUDE_COM_MSG */
323 /* #define PIOS_INCLUDE_TELEMETRY_RF */
324 /* #define PIOS_INCLUDE_COM_TELEM */
325 /* #define PIOS_INCLUDE_COM_FLEXI */
326 /* #define PIOS_INCLUDE_COM_AUX */
327 /* #define PIOS_TELEM_PRIORITY_QUEUE */
328 /* #define PIOS_INCLUDE_GPS */
329 /* #define PIOS_GPS_MINIMAL */
330 /* #define PIOS_INCLUDE_GPS_NMEA_PARSER */
331 /* #define PIOS_INCLUDE_GPS_UBX_PARSER */
332 /* #define PIOS_GPS_SETS_HOMELOCATION */
333 #include <pios_com.h>
336 /* Stabilization options */
337 /* #define PIOS_QUATERNION_STABILIZATION */
339 /* Performance counters */
340 /* #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 */
342 #endif /* USE_SIM_POSIX */
346 } // closing brace for extern "C"