OP-1857 - Enable PPM On Flexi Port
[librepilot.git] / flight / targets / boards / coptercontrol / firmware / pios_board_posix.c
blob7fa958a38e38358bd2d9163708089f02c893626a
1 /**
2 ******************************************************************************
4 * @file pios_board.c
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @brief Defines board specific static initializers for hardware for the OpenPilot board.
7 * @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
19 * for more details.
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
26 #include "inc/openpilot.h"
27 #include <pios_udp_priv.h>
28 #include <pios_com_priv.h>
29 #include <uavobjectsinit.h>
31 /**
32 * PIOS_Board_Init()
33 * initializes all the core systems on this specific hardware
34 * called from System/openpilot.c
36 void PIOS_Board_Init(void)
38 /* Delay system */
39 PIOS_DELAY_Init();
41 /* Initialize the delayed callback library */
42 PIOS_CALLBACKSCHEDULER_Initialize();
44 /* Initialize UAVObject libraries */
45 EventDispatcherInitialize();
46 UAVObjInitialize();
48 /* Initialize the alarms library */
49 AlarmsInitialize();
51 /* Initialize the task monitor */
52 if (PIOS_TASK_MONITOR_Initialize(TASKINFO_RUNNING_NUMELEM)) {
53 PIOS_Assert(0);
56 /* Initialize the PiOS library */
57 PIOS_COM_Init();
61 const struct pios_udp_cfg pios_udp0_cfg = {
62 .ip = "0.0.0.0",
63 .port = 9000,
65 const struct pios_udp_cfg pios_udp1_cfg = {
66 .ip = "0.0.0.0",
67 .port = 9001,
69 const struct pios_udp_cfg pios_udp2_cfg = {
70 .ip = "0.0.0.0",
71 .port = 9002,
74 #ifdef PIOS_COM_AUX
76 * AUX USART
78 const struct pios_udp_cfg pios_udp3_cfg = {
79 .ip = "0.0.0.0",
80 .port = 9003,
82 #endif
85 * Board specific number of devices.
87 struct pios_udp_dev pios_udp_devs[] = {
88 #define PIOS_UDP_TELEM 0
90 .cfg = &pios_udp0_cfg,
92 #define PIOS_UDP_GPS 1
94 .cfg = &pios_udp1_cfg,
96 #define PIOS_UDP_LOCAL 2
98 .cfg = &pios_udp2_cfg,
100 #ifdef PIOS_COM_AUX
101 #define PIOS_UDP_AUX 3
103 .cfg = &pios_udp3_cfg,
105 #endif
108 uint8_t pios_udp_num_devices = NELEMENTS(pios_udp_devs);
111 * COM devices
115 * Board specific number of devices.
117 extern const struct pios_com_driver pios_serial_com_driver;
118 extern const struct pios_com_driver pios_udp_com_driver;
120 struct pios_com_dev pios_com_devs[] = {
122 .id = PIOS_UDP_TELEM,
123 .driver = &pios_udp_com_driver,
126 .id = PIOS_UDP_GPS,
127 .driver = &pios_udp_com_driver,
130 .id = PIOS_UDP_LOCAL,
131 .driver = &pios_udp_com_driver,
133 #ifdef PIOS_COM_AUX
135 .id = PIOS_UDP_AUX,
136 .driver = &pios_udp_com_driver,
138 #endif
141 const uint8_t pios_com_num_devices = NELEMENTS(pios_com_devs);
144 * @}