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
61 #ifndef SERIALRX_PROVIDER
62 #define SERIALRX_PROVIDER 0
65 #define RX_MIN_USEC 885
66 #define RX_MAX_USEC 2115
67 #define RX_MID_USEC 1500
69 #ifndef SPEKTRUM_BIND_PIN
70 #define SPEKTRUM_BIND_PIN NONE
74 #define BINDPLUG_PIN NONE
78 #if !defined(RX_SPI_INSTANCE)
79 #define RX_SPI_INSTANCE NULL
82 #if !defined(RX_NSS_PIN)
83 #define RX_NSS_PIN NONE
86 #ifndef RX_SPI_LED_PIN
87 #define RX_SPI_LED_PIN NONE
90 #if !defined(RX_SPI_EXTI_PIN)
91 #define RX_SPI_EXTI_PIN NONE
94 #if !defined(RX_SPI_BIND_PIN)
95 #define RX_SPI_BIND_PIN NONE
100 // Previously there was logic here to default GYRO_1_CUSTOM_ALIGN and GYRO_2_CUSTOM_ALIGN
101 // to CUSTOM_ALIGN_CW0_DEG if they weren't defined in the target. The defaulting logic
102 // has been moved to pg/gyrodev.c to set the custom alignment based on the sensor alignment
103 // if a custom alignment is not applied in the target.
106 #ifndef USB_DETECT_PIN
107 #define USB_DETECT_PIN NONE
109 #ifndef USB_MSC_BUTTON_PIN
110 #define USB_MSC_BUTTON_PIN NONE
112 #if !defined(MSC_BUTTON_IPU)
113 #define MSC_BUTTON_IPU true
117 #ifdef USE_TIMER_MGMT
118 #ifndef MAX_TIMER_PINMAP_COUNT
119 #define MAX_TIMER_PINMAP_COUNT 21 // Largest known for F405RG (OMNINXT)
123 #if defined(USE_UART1) || defined(USE_UART2) || defined(USE_UART3) || defined(USE_UART4) || defined(USE_UART5) || defined(USE_UART6) || defined(USE_UART7) || defined(USE_UART8)
128 #if defined(INVERTER_PIN_UART1) || defined(INVERTER_PIN_UART2) || defined(INVERTER_PIN_UART3) || defined(INVERTER_PIN_UART4) || defined(INVERTER_PIN_UART5) || defined(INVERTER_PIN_UART6)
133 #ifndef DEFAULT_MIXER
134 #define DEFAULT_MIXER MIXER_QUADX
137 #if defined(USE_RANGEFINDER) && defined(USE_RANGEFINDER_HCSR04)
138 #ifndef RANGEFINDER_HCSR04_TRIGGER_PIN
139 #define RANGEFINDER_HCSR04_TRIGGER_PIN NONE
141 #ifndef RANGEFINDER_HCSR04_ECHO_PIN
142 #define RANGEFINDER_HCSR04_ECHO_PIN NONE
148 #ifndef MAG_SPI_INSTANCE
149 #define MAG_SPI_INSTANCE NULL
152 #define MAG_CS_PIN NONE
154 #ifndef MAG_I2C_INSTANCE
155 #define MAG_I2C_INSTANCE I2C_DEVICE
160 #define MAG_INT_EXTI NONE
164 #if defined(USE_BARO)
165 #ifndef BARO_SPI_INSTANCE
166 #define BARO_SPI_INSTANCE NULL
169 #define BARO_CS_PIN NONE
171 #ifndef BARO_I2C_INSTANCE
172 #define BARO_I2C_INSTANCE I2C_DEVICE
174 #ifndef BARO_XCLR_PIN
175 #define BARO_XCLR_PIN NONE
181 #if !defined(ADC1_DMA_OPT)
182 #define ADC1_DMA_OPT (DMA_OPT_UNUSED)
184 #if !defined(ADC2_DMA_OPT)
185 #define ADC2_DMA_OPT (DMA_OPT_UNUSED)
187 #if !defined(ADC3_DMA_OPT)
188 #define ADC3_DMA_OPT (DMA_OPT_UNUSED)
190 #if !defined(ADC4_DMA_OPT)
191 #define ADC4_DMA_OPT (DMA_OPT_UNUSED)
193 #if !defined(ADC5_DMA_OPT)
194 #define ADC5_DMA_OPT (DMA_OPT_UNUSED)
200 #ifdef USE_SPI_DEVICE_1
201 #ifndef SPI1_TX_DMA_OPT
202 #define SPI1_TX_DMA_OPT (DMA_OPT_UNUSED)
204 #ifndef SPI1_RX_DMA_OPT
205 #define SPI1_RX_DMA_OPT (DMA_OPT_UNUSED)
208 #ifdef USE_SPI_DEVICE_2
209 #ifndef SPI2_TX_DMA_OPT
210 #define SPI2_TX_DMA_OPT (DMA_OPT_UNUSED)
212 #ifndef SPI2_RX_DMA_OPT
213 #define SPI2_RX_DMA_OPT (DMA_OPT_UNUSED)
216 #ifdef USE_SPI_DEVICE_3
217 #ifndef SPI3_TX_DMA_OPT
218 #define SPI3_TX_DMA_OPT (DMA_OPT_UNUSED)
220 #ifndef SPI3_RX_DMA_OPT
221 #define SPI3_RX_DMA_OPT (DMA_OPT_UNUSED)
224 #ifdef USE_SPI_DEVICE_4
225 #ifndef SPI4_TX_DMA_OPT
226 #define SPI4_TX_DMA_OPT (DMA_OPT_UNUSED)
228 #ifndef SPI4_RX_DMA_OPT
229 #define SPI4_RX_DMA_OPT (DMA_OPT_UNUSED)
232 #ifdef USE_SPI_DEVICE_5
233 #ifndef SPI5_TX_DMA_OPT
234 #define SPI5_TX_DMA_OPT (DMA_OPT_UNUSED)
236 #ifndef SPI5_RX_DMA_OPT
237 #define SPI5_RX_DMA_OPT (DMA_OPT_UNUSED)
240 #ifdef USE_SPI_DEVICE_6
241 #ifndef SPI6_TX_DMA_OPT
242 #define SPI6_TX_DMA_OPT (DMA_OPT_UNUSED)
244 #ifndef SPI6_RX_DMA_OPT
245 #define SPI6_RX_DMA_OPT (DMA_OPT_UNUSED)
251 #ifndef UART1_TX_DMA_OPT
252 #define UART1_TX_DMA_OPT (DMA_OPT_UNUSED)
254 #ifndef UART1_RX_DMA_OPT
255 #define UART1_RX_DMA_OPT (DMA_OPT_UNUSED)
260 #ifndef UART2_TX_DMA_OPT
261 #define UART2_TX_DMA_OPT (DMA_OPT_UNUSED)
263 #ifndef UART2_RX_DMA_OPT
264 #define UART2_RX_DMA_OPT (DMA_OPT_UNUSED)
269 #ifndef UART3_TX_DMA_OPT
270 #define UART3_TX_DMA_OPT (DMA_OPT_UNUSED)
272 #ifndef UART3_RX_DMA_OPT
273 #define UART3_RX_DMA_OPT (DMA_OPT_UNUSED)
278 #ifndef UART4_TX_DMA_OPT
279 #define UART4_TX_DMA_OPT (DMA_OPT_UNUSED)
281 #ifndef UART4_RX_DMA_OPT
282 #define UART4_RX_DMA_OPT (DMA_OPT_UNUSED)
287 #ifndef UART5_TX_DMA_OPT
288 #define UART5_TX_DMA_OPT (DMA_OPT_UNUSED)
290 #ifndef UART5_RX_DMA_OPT
291 #define UART5_RX_DMA_OPT (DMA_OPT_UNUSED)
296 #ifndef UART6_TX_DMA_OPT
297 #define UART6_TX_DMA_OPT (DMA_OPT_UNUSED)
299 #ifndef UART6_RX_DMA_OPT
300 #define UART6_RX_DMA_OPT (DMA_OPT_UNUSED)
305 #ifndef UART7_TX_DMA_OPT
306 #define UART7_TX_DMA_OPT (DMA_OPT_UNUSED)
308 #ifndef UART7_RX_DMA_OPT
309 #define UART7_RX_DMA_OPT (DMA_OPT_UNUSED)
314 #ifndef UART8_TX_DMA_OPT
315 #define UART8_TX_DMA_OPT (DMA_OPT_UNUSED)
317 #ifndef UART8_RX_DMA_OPT
318 #define UART8_RX_DMA_OPT (DMA_OPT_UNUSED)
323 #ifndef UART9_TX_DMA_OPT
324 #define UART9_TX_DMA_OPT (DMA_OPT_UNUSED)
326 #ifndef UART9_RX_DMA_OPT
327 #define UART9_RX_DMA_OPT (DMA_OPT_UNUSED)
332 #ifndef UART10_TX_DMA_OPT
333 #define UART10_TX_DMA_OPT (DMA_OPT_UNUSED)
335 #ifndef UART10_RX_DMA_OPT
336 #define UART10_RX_DMA_OPT (DMA_OPT_UNUSED)
340 #ifndef RTC6705_CS_PIN
341 #define RTC6705_CS_PIN NONE
344 #ifndef RTC6705_POWER_PIN
345 #define RTC6705_POWER_PIN NONE
348 #ifndef RTC6705_SPICLK_PIN
349 #define RTC6705_SPICLK_PIN NONE
352 #ifndef RTC6705_SPI_SDO_PIN
353 #define RTC6705_SPI_SDO_PIN NONE
356 #ifndef RTC6705_SPI_INSTANCE
357 #define RTC6705_SPI_INSTANCE NULL
360 #if defined(USE_QUAD_MIXER_ONLY)
361 #define MAX_SUPPORTED_MOTORS 4
362 #define MAX_SUPPORTED_SERVOS 1
364 #ifndef MAX_SUPPORTED_MOTORS
365 #define MAX_SUPPORTED_MOTORS 8
367 #define MAX_SUPPORTED_SERVOS 8