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 TARGET_BOARD_IDENTIFIER "SP7D"
24 #define USE_TARGET_CONFIG
26 #ifndef SPRACINGF7DUAL_REV
27 #define SPRACINGF7DUAL_REV 2
30 #define USBD_PRODUCT_STRING "SP Racing F7 DUAL"
37 #define BEEPER_INVERTED
39 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
41 #define USE_IMU_MPU6500
42 #define IMU_1_ALIGN IMU_MPU6500_1_ALIGN
43 #define IMU_2_ALIGN IMU_MPU6500_2_ALIGN
45 #if (SPRACINGF7DUAL_REV >= 2)
46 #define IMU_MPU6500_1_ALIGN CW0_DEG
47 #define IMU_MPU6500_2_ALIGN CW270_DEG
49 #define IMU_MPU6500_1_ALIGN CW180_DEG
50 #define IMU_MPU6500_2_ALIGN CW270_DEG
54 #define BARO_I2C_BUS BUS_I2C1
55 #define USE_BARO_BMP280
56 #define USE_BARO_MS5611
58 #define MAG_I2C_BUS BUS_I2C1
62 #define TEMPERATURE_I2C_BUS BUS_I2C1
70 #define SERIAL_PORT_COUNT 6
72 #define UART1_TX_PIN PA9
73 #define UART1_RX_PIN PA10
75 #define UART2_TX_PIN PA2
76 #define UART2_RX_PIN PA3
78 #define UART3_TX_PIN PB10
79 #define UART3_RX_PIN PB11
81 #define UART4_TX_PIN PC10
82 #define UART4_RX_PIN PC11
84 #define UART5_TX_PIN PC12
85 #define UART5_RX_PIN PD2
87 #if (SPRACINGF7DUAL_REV <= 1)
88 #define TARGET_USART_CONFIG
92 // #define USE_ESCSERIAL
93 // #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
96 #define USE_I2C_DEVICE_1
97 #define I2C_DEVICE (I2CDEV_1)
103 #define USE_SPI_DEVICE_1 // 2xMPU
104 #define SPI1_NSS_PIN PA15
105 #define SPI1_SCK_PIN PA5
106 #define SPI1_MISO_PIN PA6
107 #define SPI1_MOSI_PIN PA7
109 #define USE_SPI_DEVICE_2 // MAX7456
110 #define SPI2_NSS_PIN PB12
111 #define SPI2_SCK_PIN PB13
112 #define SPI2_MISO_PIN PB14
113 #define SPI2_MOSI_PIN PB15
116 #define MAX7456_SPI_BUS BUS_SPI2
117 #define MAX7456_CS_PIN SPI2_NSS_PIN
120 #define USE_SDCARD_SPI
122 #define USE_SPI_DEVICE_3 // SDCARD
123 #define SPI3_SCK_PIN PB3
124 #define SPI3_MISO_PIN PB4
125 #define SPI3_MOSI_PIN PB5
126 #define SDCARD_SPI_BUS BUS_SPI3
127 #define SDCARD_CS_PIN PC3
129 #define GYRO_1_CS_PIN SPI1_NSS_PIN
130 #define GYRO_1_SPI_INSTANCE BUS_SPI1
131 #define GYRO_2_CS_PIN PB2
132 #define GYRO_2_SPI_INSTANCE BUS_SPI1
133 #define MPU6500_1_CS_PIN GYRO_1_CS_PIN
134 #define MPU6500_1_SPI_BUS GYRO_1_SPI_INSTANCE
135 #define MPU6500_2_CS_PIN GYRO_2_CS_PIN
136 #define MPU6500_2_SPI_BUS GYRO_2_SPI_INSTANCE
139 // It's possible to use ADC1 or ADC3 on this target, same pins.
140 //#define ADC_INSTANCE ADC1
141 //#define ADC1_DMA_STREAM DMA2_Stream0
143 // Using ADC3 frees up DMA2_Stream0 for SPI1_RX (not necessarily, SPI1_RX has DMA2_Stream2 as well)
144 #define ADC_CHANNEL_1_PIN PC1
145 #define ADC_CHANNEL_2_PIN PC2
146 #define ADC_CHANNEL_3_PIN PC0
149 //#define ADC_INSTANCE ADC3
150 //#define ADC3_DMA_STREAM DMA2_Stream0
151 #define VBAT_ADC_CHANNEL ADC_CHN_1
152 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
153 #define RSSI_ADC_CHANNEL ADC_CHN_3
155 #define CURRENT_METER_SCALE 300
157 #define USE_LED_STRIP
158 #define WS2811_PIN PA1
160 //#define RX_CHANNELS_TAER
161 #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP| FEATURE_VBAT | FEATURE_CURRENT_METER| FEATURE_BLACKBOX)
163 #define GPS_UART SERIAL_PORT_USART3
165 #define SERIALRX_UART SERIAL_PORT_USART2
166 #define SERIALRX_PROVIDER SERIALRX_SBUS
168 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
170 #define TARGET_IO_PORTA 0xffff
171 #define TARGET_IO_PORTB 0xffff
172 #define TARGET_IO_PORTC 0xffff
173 #define TARGET_IO_PORTD (BIT(2))
175 #define MAX_PWM_OUTPUT_PORTS 8
178 #define USE_ESC_SENSOR