2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
20 #define TARGET_BOARD_IDENTIFIER "IF4T"
21 #define USBD_PRODUCT_STRING "IFLIGHTF4_TWING"
26 #define BEEPER_INVERTED
28 // *************** Gyro & ACC **********************
29 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS // Don't use common busdev descriptors for IMU
32 #define USE_SPI_DEVICE_1
33 #define SPI1_SCK_PIN PA5
34 #define SPI1_MISO_PIN PA6
35 #define SPI1_MOSI_PIN PA7
39 #define USE_IMU_MPU6500
40 #define IMU_0_ALIGN CW0_DEG
41 #define IMU_1_ALIGN CW0_DEG
43 #define MPU6500_0_CS_PIN PA4
44 #define MPU6500_0_SPI_BUS BUS_SPI1
46 #define MPU6500_1_CS_PIN PC3
47 #define MPU6500_1_SPI_BUS BUS_SPI1
49 // *************** I2C/Baro/Mag *********************
51 #define USE_I2C_DEVICE_1
56 #define BARO_I2C_BUS BUS_I2C1
57 #define USE_BARO_BMP280
58 #define USE_BARO_DPS310
61 #define MAG_I2C_BUS BUS_I2C1
64 #define TEMPERATURE_I2C_BUS BUS_I2C1
66 #define PITOT_I2C_BUS BUS_I2C1
68 #define USE_RANGEFINDER
69 #define RANGEFINDER_I2C_BUS BUS_I2C1
71 // *************** OSD *****************************
72 #define USE_SPI_DEVICE_2
73 #define SPI2_SCK_PIN PB13
74 #define SPI2_MISO_PIN PB14
75 #define SPI2_MOSI_PIN PB15
78 #define MAX7456_SPI_BUS BUS_SPI2
79 #define MAX7456_CS_PIN PB12
81 // *************** FLASH **************************
82 #define USE_SPI_DEVICE_3
83 #define SPI3_SCK_PIN PC10
84 #define SPI3_MISO_PIN PC11
85 #define SPI3_MOSI_PIN PC12
87 #define M25P16_CS_PIN PA15
88 #define M25P16_SPI_BUS BUS_SPI3
91 #define USE_FLASH_M25P16
92 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
94 // *************** UART *****************************
96 #define VBUS_SENSING_PIN PC5
97 #define VBUS_SENSING_ENABLED
99 #define USE_UART_INVERTER
102 #define UART1_RX_PIN PA10
103 #define UART1_TX_PIN PA9
104 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
107 #define UART2_RX_PIN PA3
108 #define UART2_TX_PIN PA2
109 // PC13 used as inverter select GPIO for UART2
110 #define INVERTER_PIN_UART2_RX PC13
113 #define UART3_RX_PIN PB11
114 #define UART3_TX_PIN PB10
117 #define UART6_RX_PIN PC7
118 #define UART6_TX_PIN PC6
120 #define SERIAL_PORT_COUNT 5 // VCP, USART1, USART2, USART3, USART6
122 // *************** ADC *****************************
124 #define ADC_CHANNEL_1_PIN PC1
125 #define ADC_CHANNEL_2_PIN PC2
126 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
127 #define VBAT_ADC_CHANNEL ADC_CHN_2
129 // *************** OTHERS *****************************
130 #define USE_LED_STRIP
131 #define WS2811_PIN PB6
133 #define SERIALRX_PROVIDER SERIALRX_SBUS
134 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
135 #define SERIALRX_UART SERIAL_PORT_USART2
137 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_BLACKBOX)
139 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
141 #define TARGET_IO_PORTA (0xffff & ~(BIT(14)|BIT(13)))
142 #define TARGET_IO_PORTB (0xffff & ~(BIT(2)))
143 #define TARGET_IO_PORTC (0xffff & ~(BIT(15)|BIT(14)))
144 #define TARGET_IO_PORTD BIT(2)
146 #define MAX_PWM_OUTPUT_PORTS 4