2 ******************************************************************************
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
6 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
8 * @brief Defines board hardware for the NucleoF303RE 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
89 // -------------------------
91 // -------------------------
92 #define PIOS_MASTER_CLOCK 72000000
93 #define PIOS_RCC_HSE_BYPASS
95 // -------------------------
96 // Interrupt Priorities
97 // -------------------------
98 #define PIOS_IRQ_PRIO_LOW 12 // lower than RTOS
99 #define PIOS_IRQ_PRIO_MID 8 // higher than RTOS
100 #define PIOS_IRQ_PRIO_HIGH 5 // for SPI, ADC, I2C etc...
101 #define PIOS_IRQ_PRIO_HIGHEST 4 // for USART etc...
102 // ------------------------
104 // See also pios_board.c
105 // ------------------------
106 #define PIOS_I2C_MAX_DEVS 1
107 extern uint32_t pios_i2c_id
;
108 #define PIOS_I2C_MAIN_ADAPTER (pios_i2c_id)
109 #define PIOS_I2C_ESC_ADAPTER (pios_i2c_id)
110 #define PIOS_I2C_EXTERNAL_ADAPTER (pios_i2c_id)
112 // ------------------------
114 // ------------------------
115 #define PIOS_BMP085_OVERSAMPLING 3
117 // -------------------------
120 // See also pios_board.c
121 // -------------------------
122 #define PIOS_SPI_MAX_DEVS 2
124 // -------------------------
126 // -------------------------
127 #define PIOS_USART_MAX_DEVS 2
129 // -------------------------
132 // See also pios_board.c
133 // -------------------------
134 #define PIOS_COM_MAX_DEVS 3
136 // -------------------------
138 // PIOS_ADC_PinGet(0) = Current sensor
139 // PIOS_ADC_PinGet(1) = RSSI sensor
140 // PIOS_ADC_PinGet(2) = Battery voltage
141 // -------------------------
142 #define PIOS_DMA_PIN_CONFIG \
144 { GPIOA, GPIO_Pin_5, ADC_Channel_2, false }, /* ADC_1 / Current */ \
145 { GPIOB, GPIO_Pin_2, ADC_Channel_12, false }, /* ADC_2 / RSSI */ \
146 { GPIOA, GPIO_Pin_4, ADC_Channel_1, false }, /* Battery voltage */ \
149 /* we have to do all this to satisfy the PIOS_ADC_MAX_SAMPLES define in pios_adc.h */
150 /* which is annoying because this then determines the rate at which we generate buffer turnover events */
151 /* the objective here is to get enough buffer space to support 100Hz averaging rate */
152 #define PIOS_ADC_NUM_CHANNELS 3
153 #define PIOS_ADC_MAX_OVERSAMPLING 32
154 #define PIOS_ADC_USE_ADC2 0
156 // #define PIOS_ADC_USE_TEMP_SENSOR
157 // #define PIOS_ADC_TEMPERATURE_PIN 4
159 // ------------------------
161 // See also pios_board.c
162 // ------------------------
163 #define PIOS_RCVR_MAX_DEVS 3
164 #define PIOS_RCVR_MAX_CHANNELS 12
165 #define PIOS_GCSRCVR_TIMEOUT_MS 100
167 // -------------------------
168 // Receiver PPM input
169 // -------------------------
170 #define PIOS_PPM_MAX_DEVS 1
171 #define PIOS_PPM_NUM_INPUTS 16
173 // -------------------------
174 // Receiver PWM input
175 // -------------------------
176 #define PIOS_PWM_MAX_DEVS 1
177 #define PIOS_PWM_NUM_INPUTS 6
179 // -------------------------
180 // Receiver DSM input
181 // -------------------------
182 #define PIOS_DSM_MAX_DEVS 2
183 #define PIOS_DSM_NUM_INPUTS 12
185 // -------------------------
186 // Receiver S.Bus input
187 // -------------------------
188 #define PIOS_SBUS_MAX_DEVS 1
189 #define PIOS_SBUS_NUM_INPUTS (16 + 2)
191 // -------------------------
192 // Receiver HOTT input
193 // -------------------------
194 #define PIOS_HOTT_MAX_DEVS 1
195 #define PIOS_HOTT_NUM_INPUTS 32
197 // -------------------------
198 // Receiver EX.Bus input
199 // -------------------------
200 #define PIOS_EXBUS_MAX_DEVS 1
201 #define PIOS_EXBUS_NUM_INPUTS 16
203 // -------------------------
204 // Receiver Multiplex SRXL input
205 // -------------------------
206 #define PIOS_SRXL_MAX_DEVS 1
207 #define PIOS_SRXL_NUM_INPUTS 16
209 // -------------------------
210 // Receiver FlySky IBus input
211 // -------------------------
212 #define PIOS_IBUS_MAX_DEVS 1
213 #define PIOS_IBUS_NUM_INPUTS 10
215 // -------------------------
217 // -------------------------
218 #define PIOS_SERVO_UPDATE_HZ 50
219 #define PIOS_SERVOS_INITIAL_POSITION 0 /* dont want to start motors, have no pulse till settings loaded */
220 #define PIOS_SERVO_BANKS 6
222 // --------------------------
223 // Timer controller settings
224 // --------------------------
225 #define PIOS_TIM_MAX_DEVS 3
227 // -------------------------
229 // -------------------------
230 #define PIOS_GPIO_PORTS {}
231 #define PIOS_GPIO_PINS {}
232 #define PIOS_GPIO_CLKS {}
233 #define PIOS_GPIO_NUM 0
235 // -------------------------
237 // -------------------------
238 #define PIOS_USB_HID_MAX_DEVS 1
240 #define PIOS_USB_ENABLED 1
241 #define PIOS_USB_DETECT_GPIO_PORT GPIOC
242 #define PIOS_USB_MAX_DEVS 1
243 #define PIOS_USB_DETECT_GPIO_PIN GPIO_Pin_15
245 #endif /* PIOS_BOARD_H */