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 #if defined(STM32F405)
24 #define TARGET_BOARD_IDENTIFIER "S405"
26 #define USBD_PRODUCT_STRING "Betaflight STM32F405"
28 #define USE_I2C_DEVICE_1
29 #define USE_I2C_DEVICE_2
30 #define USE_I2C_DEVICE_3
39 #define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6)
43 #define USE_SPI_DEVICE_1
44 #define USE_SPI_DEVICE_2
45 #define USE_SPI_DEVICE_3
47 #define TARGET_IO_PORTA 0xffff
48 #define TARGET_IO_PORTB 0xffff
49 #define TARGET_IO_PORTC 0xffff
50 #define TARGET_IO_PORTD 0xffff
51 #define TARGET_IO_PORTE 0xffff
52 #define TARGET_IO_PORTF 0xffff
54 #elif defined(STM32F411)
55 #define TARGET_BOARD_IDENTIFIER "S411"
57 #define USBD_PRODUCT_STRING "Betaflight STM32F411"
59 #define USE_I2C_DEVICE_1
60 #define USE_I2C_DEVICE_2
61 #define USE_I2C_DEVICE_3
67 #define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 3)
71 #define USE_SPI_DEVICE_1
72 #define USE_SPI_DEVICE_2
73 #define USE_SPI_DEVICE_3
75 #define TARGET_IO_PORTA 0xffff
76 #define TARGET_IO_PORTB 0xffff
77 #define TARGET_IO_PORTC 0xffff
78 #define TARGET_IO_PORTD 0xffff
79 #define TARGET_IO_PORTE 0xffff
81 #elif defined(STM32F7X2)
82 #define TARGET_BOARD_IDENTIFIER "S7X2"
84 #define USBD_PRODUCT_STRING "Betaflight STM32F7x2"
86 #define USE_I2C_DEVICE_1
87 #define USE_I2C_DEVICE_2
88 #define USE_I2C_DEVICE_3
97 #define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6)
99 #define USE_SPI_DEVICE_1
100 #define USE_SPI_DEVICE_2
101 #define USE_SPI_DEVICE_3
103 #define TARGET_IO_PORTA 0xffff
104 #define TARGET_IO_PORTB 0xffff
105 #define TARGET_IO_PORTC 0xffff
106 #define TARGET_IO_PORTD 0xffff
107 #define TARGET_IO_PORTE 0xffff
108 #define TARGET_IO_PORTF 0xffff
110 #elif defined(STM32F745)
111 #define TARGET_BOARD_IDENTIFIER "S745"
113 #define USBD_PRODUCT_STRING "Betaflight STM32F745"
115 #define USE_I2C_DEVICE_1
116 #define USE_I2C_DEVICE_2
117 #define USE_I2C_DEVICE_3
118 #define USE_I2C_DEVICE_4
129 #define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 8)
131 #define USE_SPI_DEVICE_1
132 #define USE_SPI_DEVICE_2
133 #define USE_SPI_DEVICE_3
134 #define USE_SPI_DEVICE_4
136 #define TARGET_IO_PORTA 0xffff
137 #define TARGET_IO_PORTB 0xffff
138 #define TARGET_IO_PORTC 0xffff
139 #define TARGET_IO_PORTD 0xffff
140 #define TARGET_IO_PORTE 0xffff
141 #define TARGET_IO_PORTF 0xffff
143 #elif defined(STM32G47X)
144 #define TARGET_BOARD_IDENTIFIER "SG47"
146 #define USBD_PRODUCT_STRING "Betaflight STM32G47x"
148 #define USE_I2C_DEVICE_1
149 #define USE_I2C_DEVICE_2
150 #define USE_I2C_DEVICE_3
151 #define USE_I2C_DEVICE_4
160 #define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6)
162 #define USE_SPI_DEVICE_1
163 #define USE_SPI_DEVICE_2
164 #define USE_SPI_DEVICE_3
165 #define USE_SPI_DEVICE_4
167 #define TARGET_IO_PORTA 0xffff
168 #define TARGET_IO_PORTB 0xffff
169 #define TARGET_IO_PORTC 0xffff
170 #define TARGET_IO_PORTD 0xffff
171 #define TARGET_IO_PORTE 0xffff
172 #define TARGET_IO_PORTF 0xffff
174 #elif defined(STM32H743)
175 #define TARGET_BOARD_IDENTIFIER "SH74"
177 #define USBD_PRODUCT_STRING "Betaflight STM32H743"
179 #define USE_I2C_DEVICE_1
180 #define USE_I2C_DEVICE_2
181 #define USE_I2C_DEVICE_3
182 #define USE_I2C_DEVICE_4
194 #define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 9)
196 #define USE_SPI_DEVICE_1
197 #define USE_SPI_DEVICE_2
198 #define USE_SPI_DEVICE_3
199 #define USE_SPI_DEVICE_4
200 #define USE_SPI_DEVICE_5
201 #define USE_SPI_DEVICE_6
203 #define TARGET_IO_PORTA 0xffff
204 #define TARGET_IO_PORTB 0xffff
205 #define TARGET_IO_PORTC 0xffff
206 #define TARGET_IO_PORTD 0xffff
207 #define TARGET_IO_PORTE 0xffff
208 #define TARGET_IO_PORTF 0xffff
209 #define TARGET_IO_PORTG 0xffff
211 #elif !defined(UNIT_TEST)
213 #error "No resources defined for this Unified Target."
217 // Treat the target as unified, and expect manufacturer id / board name
218 // to be supplied when the board is configured for the first time
219 #define USE_UNIFIED_TARGET
225 #define USE_MPU_DATA_READY_SIGNAL
226 #define USE_GYRO_EXTI
231 #define USE_ACC_MPU6500
232 #define USE_GYRO_MPU6500
233 #define USE_ACC_SPI_MPU6000
234 #define USE_GYRO_SPI_MPU6000
235 #define USE_ACC_SPI_MPU6500
236 #define USE_GYRO_SPI_MPU6500
237 #define USE_ACC_SPI_ICM20689
238 #define USE_GYRO_SPI_ICM20689
239 #define USE_ACCGYRO_LSM6DSO
240 #define USE_ACCGYRO_BMI270
242 #if !defined(STM32F411xE)
243 #define USE_GYRO_SPI_ICM42605
244 #define USE_GYRO_SPI_ICM42688P
245 #define USE_ACC_SPI_ICM42605
246 #define USE_ACC_SPI_ICM42688P
250 #define USE_MAG_DATA_READY_SIGNAL
251 #define USE_MAG_HMC5883
252 #define USE_MAG_SPI_HMC5883
253 #define USE_MAG_QMC5883
254 #define USE_MAG_LIS3MDL
255 #define USE_MAG_AK8963
256 #define USE_MAG_MPU925X_AK8963
257 #define USE_MAG_SPI_AK8963
258 #define USE_MAG_AK8975
261 #define USE_BARO_MS5611
262 #define USE_BARO_SPI_MS5611
263 #define USE_BARO_BMP280
264 #define USE_BARO_SPI_BMP280
265 #define USE_BARO_BMP388
266 #define USE_BARO_SPI_BMP388
268 #define USE_BARO_SPI_LPS
269 #define USE_BARO_QMP6988
270 #define USE_BARO_SPI_QMP6988
271 #define USE_BARO_DPS310
272 #define USE_BARO_SPI_DPS310
275 #define USE_SDCARD_SPI
276 #if !defined(STM32G4)
277 // G4 support needs fixing
278 #define USE_SDCARD_SDIO
282 #define USE_FLASH_TOOLS
283 #define USE_FLASH_M25P16
284 #define USE_FLASH_W25N01G // 1Gb NAND flash support
285 #define USE_FLASH_W25M // Stacked die support
286 #define USE_FLASH_W25M512 // 512Kb (256Kb x 2 stacked) NOR flash support
287 #define USE_FLASH_W25M02G // 2Gb (1Gb x 2 stacked) NAND flash support
288 #define USE_FLASH_W25Q128FV // 16MB Winbond 25Q128
293 #define SPI_FULL_RECONFIGURABILITY
296 #define I2C_FULL_RECONFIGURABILITY
300 #define USE_SOFTSERIAL1
301 #define USE_SOFTSERIAL2
303 #define UNIFIED_SERIAL_PORT_COUNT 3
305 #define USE_USB_DETECT
307 #define USE_ESCSERIAL
313 #define USE_RX_FRSKY_SPI_D
314 #define USE_RX_FRSKY_SPI_X
315 #define USE_RX_SFHSS_SPI
316 #define USE_RX_REDPINE_SPI
317 #define USE_RX_FRSKY_SPI_TELEMETRY
318 #define USE_RX_CC2500_SPI_PA_LNA
319 #define USE_RX_CC2500_SPI_DIVERSITY
321 #define USE_RX_FLYSKY
322 #define USE_RX_FLYSKY_SPI_LED
324 #define USE_RX_SPEKTRUM
325 #define USE_RX_SPEKTRUM_TELEMETRY
327 #define USE_CUSTOM_DEFAULTS
329 // Additional drivers included for targets with > 512KB of flash
330 #if (TARGET_FLASH_SIZE > 512)
331 #define USE_ACC_MPU6050
332 #define USE_GYRO_MPU6050
334 #define USE_BARO_BMP085
336 #define USE_VTX_RTC6705
337 #define USE_VTX_RTC6705_SOFTSPI
339 #define USE_TRANSPONDER
341 #define USE_RANGEFINDER
342 #define USE_RANGEFINDER_HCSR04
343 #define USE_RANGEFINDER_TF
345 #define USE_RX_EXPRESSLRS
346 #define USE_RX_SX1280
347 #define USE_RX_SX127X