2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
24 #define DEBUG_MODE DEBUG_NONE
27 #ifndef I2C1_CLOCKSPEED
28 #define I2C1_CLOCKSPEED 800
30 #ifndef I2C2_CLOCKSPEED
31 #define I2C2_CLOCKSPEED 800
33 #ifndef I2C3_CLOCKSPEED
34 #define I2C3_CLOCKSPEED 800
36 #ifndef I2C4_CLOCKSPEED
37 #define I2C4_CLOCKSPEED 800
40 // Default values for internal pullup
42 #if defined(USE_I2C_PULLUP)
43 #define I2C1_PULLUP true
44 #define I2C2_PULLUP true
45 #define I2C3_PULLUP true
46 #define I2C4_PULLUP true
48 #define I2C1_PULLUP false
49 #define I2C2_PULLUP false
50 #define I2C3_PULLUP false
51 #define I2C4_PULLUP false
54 // Extracted from rx/rx.c and rx/rx.h
56 #define RX_MAPPABLE_CHANNEL_COUNT 8
58 #ifndef RX_SPI_DEFAULT_PROTOCOL
59 #define RX_SPI_DEFAULT_PROTOCOL 0
62 #define RX_MIN_USEC 885
63 #define RX_MAX_USEC 2115
64 #define RX_MID_USEC 1500
66 #ifndef SPEKTRUM_BIND_PIN
67 #define SPEKTRUM_BIND_PIN NONE
71 #define BINDPLUG_PIN NONE
74 // Previously there was logic here to default GYRO_1_CUSTOM_ALIGN and GYRO_2_CUSTOM_ALIGN
75 // to CUSTOM_ALIGN_CW0_DEG if they weren't defined in the target. The defaulting logic
76 // has been moved to pg/gyrodev.c to set the custom alignment based on the sensor alignment
77 // if a custom alignment is not applied in the target.
80 #ifndef USB_DETECT_PIN
81 #define USB_DETECT_PIN NONE
83 #ifndef USB_MSC_BUTTON_PIN
84 #define USB_MSC_BUTTON_PIN NONE
86 #if !defined(MSC_BUTTON_IPU)
87 #define MSC_BUTTON_IPU true
92 #ifndef MAX_TIMER_PINMAP_COUNT
93 #define MAX_TIMER_PINMAP_COUNT 21 // Largest known for F405RG (OMNINXT)
98 #define DEFAULT_MIXER MIXER_QUADX
101 #if defined(USE_RANGEFINDER) && defined(USE_RANGEFINDER_HCSR04)
102 #ifndef RANGEFINDER_HCSR04_TRIGGER_PIN
103 #define RANGEFINDER_HCSR04_TRIGGER_PIN NONE
105 #ifndef RANGEFINDER_HCSR04_ECHO_PIN
106 #define RANGEFINDER_HCSR04_ECHO_PIN NONE
112 #ifndef MAG_SPI_INSTANCE
113 #define MAG_SPI_INSTANCE NULL
116 #define MAG_CS_PIN NONE
118 #ifndef MAG_I2C_INSTANCE
119 #define MAG_I2C_INSTANCE I2C_DEVICE
124 #define MAG_INT_EXTI NONE
128 #if defined(USE_BARO)
129 #ifndef BARO_SPI_INSTANCE
130 #define BARO_SPI_INSTANCE NULL
133 #define BARO_CS_PIN NONE
135 #ifndef BARO_I2C_INSTANCE
136 #define BARO_I2C_INSTANCE I2C_DEVICE
138 #ifndef BARO_XCLR_PIN
139 #define BARO_XCLR_PIN NONE
145 #if !defined(ADC1_DMA_OPT)
146 #define ADC1_DMA_OPT (DMA_OPT_UNUSED)
148 #if !defined(ADC2_DMA_OPT)
149 #define ADC2_DMA_OPT (DMA_OPT_UNUSED)
151 #if !defined(ADC3_DMA_OPT)
152 #define ADC3_DMA_OPT (DMA_OPT_UNUSED)
154 #if !defined(ADC4_DMA_OPT)
155 #define ADC4_DMA_OPT (DMA_OPT_UNUSED)
157 #if !defined(ADC5_DMA_OPT)
158 #define ADC5_DMA_OPT (DMA_OPT_UNUSED)
164 #ifdef USE_SPI_DEVICE_1
165 #ifndef SPI1_TX_DMA_OPT
166 #define SPI1_TX_DMA_OPT (DMA_OPT_UNUSED)
168 #ifndef SPI1_RX_DMA_OPT
169 #define SPI1_RX_DMA_OPT (DMA_OPT_UNUSED)
172 #ifdef USE_SPI_DEVICE_2
173 #ifndef SPI2_TX_DMA_OPT
174 #define SPI2_TX_DMA_OPT (DMA_OPT_UNUSED)
176 #ifndef SPI2_RX_DMA_OPT
177 #define SPI2_RX_DMA_OPT (DMA_OPT_UNUSED)
180 #ifdef USE_SPI_DEVICE_3
181 #ifndef SPI3_TX_DMA_OPT
182 #define SPI3_TX_DMA_OPT (DMA_OPT_UNUSED)
184 #ifndef SPI3_RX_DMA_OPT
185 #define SPI3_RX_DMA_OPT (DMA_OPT_UNUSED)
188 #ifdef USE_SPI_DEVICE_4
189 #ifndef SPI4_TX_DMA_OPT
190 #define SPI4_TX_DMA_OPT (DMA_OPT_UNUSED)
192 #ifndef SPI4_RX_DMA_OPT
193 #define SPI4_RX_DMA_OPT (DMA_OPT_UNUSED)
196 #ifdef USE_SPI_DEVICE_5
197 #ifndef SPI5_TX_DMA_OPT
198 #define SPI5_TX_DMA_OPT (DMA_OPT_UNUSED)
200 #ifndef SPI5_RX_DMA_OPT
201 #define SPI5_RX_DMA_OPT (DMA_OPT_UNUSED)
204 #ifdef USE_SPI_DEVICE_6
205 #ifndef SPI6_TX_DMA_OPT
206 #define SPI6_TX_DMA_OPT (DMA_OPT_UNUSED)
208 #ifndef SPI6_RX_DMA_OPT
209 #define SPI6_RX_DMA_OPT (DMA_OPT_UNUSED)
215 #ifndef UART0_TX_DMA_OPT
216 #define UART0_TX_DMA_OPT (DMA_OPT_UNUSED)
218 #ifndef UART0_RX_DMA_OPT
219 #define UART0_RX_DMA_OPT (DMA_OPT_UNUSED)
224 #ifndef UART1_TX_DMA_OPT
225 #define UART1_TX_DMA_OPT (DMA_OPT_UNUSED)
227 #ifndef UART1_RX_DMA_OPT
228 #define UART1_RX_DMA_OPT (DMA_OPT_UNUSED)
233 #ifndef UART2_TX_DMA_OPT
234 #define UART2_TX_DMA_OPT (DMA_OPT_UNUSED)
236 #ifndef UART2_RX_DMA_OPT
237 #define UART2_RX_DMA_OPT (DMA_OPT_UNUSED)
242 #ifndef UART3_TX_DMA_OPT
243 #define UART3_TX_DMA_OPT (DMA_OPT_UNUSED)
245 #ifndef UART3_RX_DMA_OPT
246 #define UART3_RX_DMA_OPT (DMA_OPT_UNUSED)
251 #ifndef UART4_TX_DMA_OPT
252 #define UART4_TX_DMA_OPT (DMA_OPT_UNUSED)
254 #ifndef UART4_RX_DMA_OPT
255 #define UART4_RX_DMA_OPT (DMA_OPT_UNUSED)
260 #ifndef UART5_TX_DMA_OPT
261 #define UART5_TX_DMA_OPT (DMA_OPT_UNUSED)
263 #ifndef UART5_RX_DMA_OPT
264 #define UART5_RX_DMA_OPT (DMA_OPT_UNUSED)
269 #ifndef UART6_TX_DMA_OPT
270 #define UART6_TX_DMA_OPT (DMA_OPT_UNUSED)
272 #ifndef UART6_RX_DMA_OPT
273 #define UART6_RX_DMA_OPT (DMA_OPT_UNUSED)
278 #ifndef UART7_TX_DMA_OPT
279 #define UART7_TX_DMA_OPT (DMA_OPT_UNUSED)
281 #ifndef UART7_RX_DMA_OPT
282 #define UART7_RX_DMA_OPT (DMA_OPT_UNUSED)
287 #ifndef UART8_TX_DMA_OPT
288 #define UART8_TX_DMA_OPT (DMA_OPT_UNUSED)
290 #ifndef UART8_RX_DMA_OPT
291 #define UART8_RX_DMA_OPT (DMA_OPT_UNUSED)
296 #ifndef UART9_TX_DMA_OPT
297 #define UART9_TX_DMA_OPT (DMA_OPT_UNUSED)
299 #ifndef UART9_RX_DMA_OPT
300 #define UART9_RX_DMA_OPT (DMA_OPT_UNUSED)
305 #ifndef UART10_TX_DMA_OPT
306 #define UART10_TX_DMA_OPT (DMA_OPT_UNUSED)
308 #ifndef UART10_RX_DMA_OPT
309 #define UART10_RX_DMA_OPT (DMA_OPT_UNUSED)
313 #ifndef RTC6705_CS_PIN
314 #define RTC6705_CS_PIN NONE
317 #ifndef RTC6705_POWER_PIN
318 #define RTC6705_POWER_PIN NONE
321 #ifndef RTC6705_SPICLK_PIN
322 #define RTC6705_SPICLK_PIN NONE
325 #ifndef RTC6705_SPI_SDO_PIN
326 #define RTC6705_SPI_SDO_PIN NONE
329 #ifndef RTC6705_SPI_INSTANCE
330 #define RTC6705_SPI_INSTANCE NULL
333 #if defined(USE_QUAD_MIXER_ONLY)
334 #define MAX_SUPPORTED_MOTORS 4
335 #define MAX_SUPPORTED_SERVOS 1
337 #ifndef MAX_SUPPORTED_MOTORS
338 #define MAX_SUPPORTED_MOTORS 8
340 #define MAX_SUPPORTED_SERVOS 8
343 #ifndef BOX_USER1_NAME
344 #define BOX_USER1_NAME "USER1"
347 #ifndef BOX_USER2_NAME
348 #define BOX_USER2_NAME "USER2"
351 #ifndef BOX_USER3_NAME
352 #define BOX_USER3_NAME "USER3"
355 #ifndef BOX_USER4_NAME
356 #define BOX_USER4_NAME "USER4"