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/>.
23 #define USE_LATE_TASK_STATISTICS
26 #define TARGET_BOARD_IDENTIFIER "AIR4"
27 #define USBD_PRODUCT_STRING "AirbotF4"
29 #elif defined(AIRBOTF4SD)
30 #define TARGET_BOARD_IDENTIFIER "A4SD"
31 #define USBD_PRODUCT_STRING "AirbotF4SD"
34 #define TARGET_BOARD_IDENTIFIER "SOUL"
35 #define USBD_PRODUCT_STRING "DemonSoulF4"
37 #elif defined(PODIUMF4)
38 #define TARGET_BOARD_IDENTIFIER "PODI"
39 #define USBD_PRODUCT_STRING "PodiumF4"
41 #elif defined(ELINF405)
42 #define TARGET_BOARD_IDENTIFIER "ELIN"
43 #define USBD_PRODUCT_STRING "ElinF405"
46 #define TARGET_BOARD_IDENTIFIER "REVO"
47 #define USBD_PRODUCT_STRING "Revolution"
50 #define USBD_SERIALNUMBER_STRING "0x8020000"
61 // Disable LED1, conflicts with AirbotF4/Flip32F4 beeper
62 #if defined(AIRBOTF4) || defined(AIRBOTF4SD)
64 #define BEEPER_PIN PB4
65 #define BEEPER_INVERTED
68 #define BEEPER_PIN PB6
69 #define BEEPER_INVERTED
70 #elif defined(ELINF405)
72 #define BEEPER_PIN PB4
75 // Leave beeper here but with none as io - so disabled unless mapped.
77 #define BEEPER_PIN NONE
81 // PC0 used as inverter select GPIO
83 #define INVERTER_PIN_UART6 PD2
85 #define INVERTER_PIN_UART1 PC0
92 #define USE_GYRO_SPI_MPU6000
93 #define USE_ACC_SPI_MPU6000
94 #define USE_GYRO_SPI_MPU6500
95 #define USE_ACC_SPI_MPU6500
97 #define GYRO_1_CS_PIN PB13
98 #define GYRO_2_CS_PIN PA4
99 #define GYRO_1_SPI_INSTANCE SPI1
100 #define GYRO_2_SPI_INSTANCE SPI1
102 #define GYRO_1_ALIGN CW270_DEG
103 #define GYRO_2_ALIGN CW270_DEG
105 #elif defined(SOULF4)
107 #define USE_GYRO_SPI_MPU6000
108 #define GYRO_1_ALIGN CW180_DEG
110 #define USE_ACC_SPI_MPU6000
112 #define GYRO_1_CS_PIN PA4
113 #define GYRO_1_SPI_INSTANCE SPI1
115 #elif defined(PODIUMF4)
117 #define USE_GYRO_SPI_MPU6500
118 #define GYRO_1_ALIGN CW0_DEG
120 #define USE_ACC_SPI_MPU6500
122 #define GYRO_1_CS_PIN PA4
123 #define GYRO_1_SPI_INSTANCE SPI1
125 #elif defined(ELINF405)
127 #define USE_GYRO_SPI_MPU6500
128 #define GYRO_1_ALIGN CW0_DEG
129 #define GYRO_1_CS_PIN PA4
130 #define GYRO_1_SPI_INSTANCE SPI1
132 #define USE_ACC_SPI_MPU6500
137 #define USE_GYRO_SPI_MPU6000
138 #define USE_GYRO_SPI_MPU6500
139 #define USE_ACC_SPI_MPU6000
140 #define USE_ACC_SPI_MPU6500
141 #define GYRO_1_CS_PIN PA4
142 #define GYRO_1_SPI_INSTANCE SPI1
143 #define GYRO_1_ALIGN CW270_DEG
147 // MPU6000 interrupts
149 #define USE_GYRO_EXTI
150 #define GYRO_1_EXTI_PIN PC4
151 #define USE_MPU_DATA_READY_SIGNAL
153 #if defined(ELINF405)
156 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_SOFTSERIAL)
158 #define MAX7456_SPI_INSTANCE SPI2
159 #define MAX7456_SPI_CS_PIN PC8
162 #define USE_BARO_MS5611
163 #define USE_BARO_BMP085
164 #define USE_BARO_BMP280
167 #define USE_MAG_HMC5883
168 #define USE_MAG_QMC5883
169 #define USE_MAG_AK8963
170 #define USE_MAG_AK8975
174 #define GYRO_2_EXTI_PIN NONE
176 // Configure MAG and BARO unconditionally.
178 #define USE_MAG_HMC5883
179 #define USE_MAG_QMC5883
180 #define MAG_HMC5883_ALIGN CW90_DEG
183 #define USE_BARO_MS5611
184 #define USE_BARO_BMP085
185 #define USE_BARO_BMP280
189 #if defined(AIRBOTF4) || defined(AIRBOTF4SD)
190 #define USE_BARO_SPI_BMP280
191 #define BARO_SPI_INSTANCE SPI1
192 #define BARO_CS_PIN PC13
195 #if defined(AIRBOTF4SD)
196 // SDCARD support for AIRBOTF4SD
197 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
199 #define USE_SDCARD_SPI
200 #define SDCARD_DETECT_INVERTED
201 #define SDCARD_DETECT_PIN PC0
202 #define SDCARD_SPI_INSTANCE SPI3
203 #define SDCARD_SPI_CS_PIN SPI3_NSS_PIN
204 #define SPI3_TX_DMA_OPT 0 // DMA 1 Stream 5 Channel 0
208 #define FLASH_CS_PIN PB3
209 #define FLASH_SPI_INSTANCE SPI3
211 #define USE_FLASH_M25P16
217 #if defined(PODIUMF4)
218 #define USE_USB_DETECT
219 #define USB_DETECT_PIN PA8
221 #define USE_USB_DETECT
222 #define USB_DETECT_PIN PC5
226 #define UART1_RX_PIN PA10
227 #define UART1_TX_PIN PA9
230 #define UART3_RX_PIN PB11
231 #define UART3_TX_PIN PB10
233 #if defined(REVO) || defined(ELINF405)
235 #define UART4_RX_PIN PA1
236 #define UART4_TX_PIN PA0
240 #define UART6_RX_PIN PC7
241 #define UART6_TX_PIN PC6
243 #if defined(ELINF405)
244 #define PINIO1_PIN PC13
245 #define PINIO2_PIN PC14
247 #define DEFAULT_MIXER MIXER_QUADX
248 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
249 #define USE_TARGET_CONFIG
250 #define SOFTSERIAL1_TX_PIN PC9
251 #define SOFTSERIAL2_RX_PIN PA8
255 #define PINIO1_PIN PC8 // DTR pin
259 #define USE_SOFTSERIAL1
260 #define USE_SOFTSERIAL2
262 #if defined(REVO) || defined(ELINF405)
263 #define SERIAL_PORT_COUNT 7 //VCP, USART1, USART3, UART4, USART6, SOFTSERIAL x 2
265 #define SERIAL_PORT_COUNT 6 //VCP, USART1, USART3, USART6, SOFTSERIAL x 2
268 #define USE_ESCSERIAL
269 #if defined(ELINF405)
270 #define ESCSERIAL_TIMER_TX_PIN PB6
272 #define ESCSERIAL_TIMER_TX_PIN PB14 // (HARDARE=0,PPM)
277 #if defined(ELINF405)
278 #define USE_SPI_DEVICE_1
279 #define SPI1_NSS_PIN PA4
280 #define SPI1_SCK_PIN PA5
281 #define SPI1_MISO_PIN PA6
282 #define SPI1_MOSI_PIN PA7
284 #define USE_SPI_DEVICE_2
285 #define SPI2_NSS_PIN PB12
286 #define SPI2_SCK_PIN PB13
287 #define SPI2_MISO_PIN PB14
288 #define SPI2_MOSI_PIN PB15
291 #define USE_SPI_DEVICE_1
295 #define USE_SPI_DEVICE_3
296 #define SPI3_NSS_PIN PB3
297 #define SPI3_SCK_PIN PC10
298 #define SPI3_MISO_PIN PC11
299 #define SPI3_MOSI_PIN PC12
302 #if defined(AIRBOTF4) || defined(AIRBOTF4SD)
303 // On AIRBOTF4 and AIRBOTF4SD, I2C2 and I2C3 are configurable
304 #define USE_I2C_DEVICE_2
305 #define I2C2_SCL NONE // PB10, shared with UART3TX
306 #define I2C2_SDA NONE // PB11, shared with UART3RX
307 #define USE_I2C_DEVICE_3
308 #define I2C3_SCL NONE // PA8, PWM6
309 #define I2C3_SDA NONE // PC9, CH6
310 #define I2C_DEVICE (I2CDEV_2)
312 #define USE_I2C_DEVICE_1
313 #define I2C_DEVICE (I2CDEV_1)
319 #if !defined(PODIUMF4)
320 #define CURRENT_METER_ADC_PIN PC1
321 #define VBAT_ADC_PIN PC2
323 #define VBAT_ADC_PIN PC3
326 #if defined(ELINF405)
327 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
328 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
331 #if defined(AIRBOTF4SD)
332 #define RSSI_ADC_PIN PA0
335 #define USE_TRANSPONDER
337 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
338 #if defined(PODIUMF4)
339 #define SERIALRX_PROVIDER SERIALRX_SBUS
340 #define SERIALRX_UART SERIAL_PORT_USART6
341 #define DEFAULT_FEATURES FEATURE_TELEMETRY
342 #elif defined(ELINF405)
343 #define SERIALRX_PROVIDER SERIALRX_SBUS
344 #define SERIALRX_UART SERIAL_PORT_USART1
347 #define TARGET_IO_PORTA 0xffff
348 #define TARGET_IO_PORTB 0xffff
349 #define TARGET_IO_PORTC 0xffff
350 #define TARGET_IO_PORTD (BIT(2))
352 #if defined(AIRBOTF4) || defined(AIRBOTF4SD)
353 #define USABLE_TIMER_CHANNEL_COUNT 13
354 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(12) )
355 #elif defined(ELINF405)
356 #define USABLE_TIMER_CHANNEL_COUNT 9
357 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(11) )
359 #define USABLE_TIMER_CHANNEL_COUNT 12
360 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(12) )