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 "SP4E"
22 #ifndef SPRACINGF4EVO_REV
23 #define SPRACINGF4EVO_REV 2
26 #define USBD_PRODUCT_STRING "SP Racing F4 EVO"
31 #define BEEPER_INVERTED
33 #define USE_MAG_DATA_READY_SIGNAL
34 #define ENSURE_MAG_DATA_READY_IS_HIGH
36 #define USE_IMU_MPU6500
37 #define IMU_MPU6500_ALIGN CW0_DEG
39 #define USE_IMU_MPU9250
40 #define IMU_MPU9250_ALIGN CW0_DEG
43 #define BARO_I2C_BUS BUS_I2C1
44 #define USE_BARO_BMP280
45 #define USE_BARO_MS5611
48 #define MAG_I2C_BUS BUS_I2C1
51 #define TEMPERATURE_I2C_BUS BUS_I2C1
55 #define USE_UART_INVERTER
62 #define SERIAL_PORT_COUNT 6
64 #define UART1_TX_PIN PA9
65 #define UART1_RX_PIN PA10
67 #define UART2_TX_PIN PA2
68 #define UART2_RX_PIN PA3
69 #define INVERTER_PIN_UART2_RX PB2
71 #define UART3_TX_PIN PB10
72 #define UART3_RX_PIN PB11
74 #define UART4_TX_PIN PC10
75 #define UART4_RX_PIN PC11
77 #define UART5_TX_PIN PC12
78 #define UART5_RX_PIN PD2
81 #define USE_I2C_DEVICE_1
83 #if (SPRACINGF4EVO_REV >= 2)
92 #define USE_SPI_DEVICE_1 // MPU
93 #define USE_SPI_DEVICE_2 // SDCard
94 #define USE_SPI_DEVICE_3 // External
96 #define SPI1_NSS_PIN PA4
97 #define SPI1_SCK_PIN PA5
98 #define SPI1_MISO_PIN PA6
99 #define SPI1_MOSI_PIN PA7
101 #define SPI2_NSS_PIN PB12
102 #define SPI2_SCK_PIN PB13
103 #define SPI2_MISO_PIN PB14
104 #define SPI2_MOSI_PIN PB15
106 #define SPI3_NSS_PIN PA15 // NC
107 #define SPI3_SCK_PIN PB3 // NC
108 #define SPI3_MISO_PIN PB4 // NC
109 #define SPI3_MOSI_PIN PB5 // NC
112 #define USE_SDCARD_SPI
113 #define SDCARD_DETECT_INVERTED
114 #define SDCARD_DETECT_PIN PC14
115 #define SDCARD_SPI_BUS BUS_SPI2
116 #define SDCARD_CS_PIN SPI2_NSS_PIN
118 #define MPU6500_CS_PIN SPI1_NSS_PIN
119 #define MPU6500_SPI_BUS BUS_SPI1
121 #define MPU9250_CS_PIN SPI1_NSS_PIN
122 #define MPU9250_SPI_BUS BUS_SPI1
125 #define ADC_CHANNEL_1_PIN PC1
126 #define ADC_CHANNEL_2_PIN PC2
127 #define ADC_CHANNEL_3_PIN PC0
128 #define VBAT_ADC_CHANNEL ADC_CHN_1
129 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
130 #define RSSI_ADC_CHANNEL ADC_CHN_3
132 // PC4 - NC - Free for ADC12_IN14 / VTX CS
133 // PC5 - NC - Free for ADC12_IN15 / VTX Enable / OSD VSYNC
135 //#define USE_MAX7456
136 //#define USE_OSD_OVER_MSP_DISPLAYPORT
138 #define USE_LED_STRIP
139 #define WS2811_PIN PA1
141 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
143 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
144 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_LED_STRIP)
145 #define SERIALRX_UART SERIAL_PORT_USART2
146 #define TELEMETRY_UART SERIAL_PORT_USART5
147 #define SERIALRX_PROVIDER SERIALRX_SBUS
149 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
151 #define TARGET_IO_PORTA 0xffff
152 #define TARGET_IO_PORTB 0xffff
153 #define TARGET_IO_PORTC 0xffff
154 #define TARGET_IO_PORTD (BIT(2))
156 #define MAX_PWM_OUTPUT_PORTS 8