2 ******************************************************************************
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
6 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
8 * @brief Defines board hardware for the PikoBLX board
9 * @see The GNU Public License (GPL) Version 3
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 // ------------------------
31 // Timers and Channels Used
32 // ------------------------
34 Timer | Channel 1 | Channel 2 | Channel 3 | Channel 4
35 ------+-----------+-----------+-----------+----------
37 TIM2 | RC In 5 | RC In 6 | Servo 6 |
38 TIM3 | Servo 5 | RC In 2 | RC In 3 | RC In 4
39 TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1
40 ------+-----------+-----------+-----------+----------
43 // ------------------------
45 // ------------------------
59 // ------------------------
60 // BOOTLOADER_SETTINGS
61 // ------------------------
62 #define BOARD_READABLE true
63 #define BOARD_WRITABLE true
64 #define MAX_DEL_RETRYS 3
66 // ------------------------
68 // ------------------------
69 #define PIOS_WATCHDOG_TIMEOUT 250
70 #define PIOS_WDG_REGISTER RTC_BKP_DR4
71 #define PIOS_WDG_ACTUATOR 0x0001
72 #define PIOS_WDG_STABILIZATION 0x0002
73 #define PIOS_WDG_ATTITUDE 0x0004
74 #define PIOS_WDG_MANUAL 0x0008
75 #define PIOS_WDG_AUTOTUNE 0x0010
76 #define PIOS_WDG_SENSORS 0x0020
79 // ------------------------
81 // ------------------------
82 #define TELEM_QUEUE_SIZE 10
84 // ------------------------
86 // ------------------------
87 #define PIOS_LED_HEARTBEAT 0
88 #define PIOS_LED_ALARM 1
89 #define PIOS_BUZZER_ALARM 2
91 // -------------------------
93 // -------------------------
94 #define PIOS_MASTER_CLOCK 72000000
96 // -------------------------
97 // Interrupt Priorities
98 // -------------------------
99 #define PIOS_IRQ_PRIO_LOW 12 // lower than RTOS
100 #define PIOS_IRQ_PRIO_MID 8 // higher than RTOS
101 #define PIOS_IRQ_PRIO_HIGH 5 // for SPI, ADC, I2C etc...
102 #define PIOS_IRQ_PRIO_HIGHEST 4 // for USART etc...
103 // ------------------------
105 // See also pios_board.c
106 // ------------------------
107 #define PIOS_I2C_MAX_DEVS 0
109 // -------------------------
112 // See also pios_board.c
113 // -------------------------
114 #define PIOS_SPI_MAX_DEVS 2
115 extern uint32_t pios_spi_mpu6000_id
;
116 #define PIOS_SPI_MPU6000_ADAPTER (pios_spi_mpu6000_id)
118 // -------------------------
120 // -------------------------
121 #define PIOS_USART_MAX_DEVS 3
123 // -------------------------
126 // See also pios_board.c
127 // -------------------------
128 #define PIOS_COM_MAX_DEVS 3
131 #ifdef PIOS_INCLUDE_WS2811
132 extern uint32_t pios_ws2811_id
;
133 #define PIOS_WS2811_DEVICE (pios_ws2811_id)
136 // -------------------------
138 // PIOS_ADC_PinGet(0) = Current sensor
139 // PIOS_ADC_PinGet(1) = Battery voltage
140 // -------------------------
141 #define PIOS_DMA_PIN_CONFIG \
143 { GPIOB, GPIO_Pin_2, ADC_Channel_12, false }, /* ADC_2 / Current */ \
144 { GPIOA, GPIO_Pin_5, ADC_Channel_2, false }, /* ADC_1 / Voltage */ \
147 /* we have to do all this to satisfy the PIOS_ADC_MAX_SAMPLES define in pios_adc.h */
148 /* which is annoying because this then determines the rate at which we generate buffer turnover events */
149 /* the objective here is to get enough buffer space to support 100Hz averaging rate */
150 #define PIOS_ADC_NUM_CHANNELS 2
151 #define PIOS_ADC_MAX_OVERSAMPLING 32
152 #define PIOS_ADC_USE_ADC2 0
154 // #define PIOS_ADC_USE_TEMP_SENSOR
155 // #define PIOS_ADC_TEMPERATURE_PIN 4
157 // ------------------------
159 // See also pios_board.c
160 // ------------------------
161 #define PIOS_RCVR_MAX_DEVS 3
162 #define PIOS_RCVR_MAX_CHANNELS 12
163 #define PIOS_GCSRCVR_TIMEOUT_MS 100
165 // -------------------------
166 // Receiver PPM input
167 // -------------------------
168 #define PIOS_PPM_MAX_DEVS 1
169 #define PIOS_PPM_NUM_INPUTS 16
171 // -------------------------
172 // Receiver PWM input
173 // -------------------------
174 #define PIOS_PWM_MAX_DEVS 1
175 #define PIOS_PWM_NUM_INPUTS 6
177 // -------------------------
178 // Receiver DSM input
179 // -------------------------
180 #define PIOS_DSM_MAX_DEVS 2
181 #define PIOS_DSM_NUM_INPUTS 12
183 // -------------------------
184 // Receiver S.Bus input
185 // -------------------------
186 #define PIOS_SBUS_MAX_DEVS 1
187 #define PIOS_SBUS_NUM_INPUTS (16 + 2)
189 // -------------------------
190 // Receiver HOTT input
191 // -------------------------
192 #define PIOS_HOTT_MAX_DEVS 1
193 #define PIOS_HOTT_NUM_INPUTS 32
195 // -------------------------
196 // Receiver EX.Bus input
197 // -------------------------
198 #define PIOS_EXBUS_MAX_DEVS 1
199 #define PIOS_EXBUS_NUM_INPUTS 16
201 // -------------------------
202 // Receiver Multiplex SRXL input
203 // -------------------------
204 #define PIOS_SRXL_MAX_DEVS 1
205 #define PIOS_SRXL_NUM_INPUTS 16
207 // -------------------------
208 // Receiver FlySky IBus input
209 // -------------------------
210 #define PIOS_IBUS_MAX_DEVS 1
211 #define PIOS_IBUS_NUM_INPUTS 10
213 // -------------------------
215 // -------------------------
216 #define PIOS_SERVO_UPDATE_HZ 50
217 #define PIOS_SERVOS_INITIAL_POSITION 0 /* dont want to start motors, have no pulse till settings loaded */
218 #define PIOS_SERVO_BANKS 6
220 // --------------------------
221 // Timer controller settings
222 // --------------------------
223 #define PIOS_TIM_MAX_DEVS 3
225 // -------------------------
227 // -------------------------
228 #define PIOS_GPIO_PORTS {}
229 #define PIOS_GPIO_PINS {}
230 #define PIOS_GPIO_CLKS {}
231 #define PIOS_GPIO_NUM 0
233 // -------------------------
235 // -------------------------
236 #define PIOS_USB_HID_MAX_DEVS 1
238 #define PIOS_USB_ENABLED 1
239 #define PIOS_USB_MAX_DEVS 1
241 #endif /* PIOS_BOARD_H */