Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / target / ZEEZF7 / target.h
blob2ab83104d3aaea04aa08d99970ea2e8cc1498fd3
1 /*
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/>.
18 #pragma once
20 #ifdef ZEEZF7V3
21 #define TARGET_BOARD_IDENTIFIER "ZEF7V3"
22 #define USBD_PRODUCT_STRING "ZEEZF7V3"
23 #endif
24 #ifdef ZEEZF7V2
25 #define TARGET_BOARD_IDENTIFIER "ZEF7V2"
26 #define USBD_PRODUCT_STRING "ZEEZF7V2"
27 #endif
28 #ifdef ZEEZF7
29 #define TARGET_BOARD_IDENTIFIER "ZEF7"
30 #define USBD_PRODUCT_STRING "ZEEZF7"
31 #endif
33 #define USE_TARGET_CONFIG
35 #define LED0 PC14
36 #define LED1 PC15
38 #ifdef ZEEZF7V3
39 #define BEEPER PC4
40 #define BEEPER_INVERTED
41 #else
42 #define BEEPER PB2
43 #define BEEPER_INVERTED
44 #endif
46 // *************** Gyro & ACC **********************
47 #define USE_SPI
49 #ifdef ZEEZF7V3
51 #define USE_SPI_DEVICE_3
53 #define SPI3_NSS_PIN PA15
54 #define SPI3_SCK_PIN PC10
55 #define SPI3_MISO_PIN PC11
56 #define SPI3_MOSI_PIN PB5
58 // *************** SPI3 IMU0 ICM42688P **************
59 #define USE_IMU_ICM42605
61 #define IMU_ICM42605_ALIGN CW0_DEG
62 #define ICM42605_SPI_BUS BUS_SPI3
63 #define ICM42605_CS_PIN SPI3_NSS_PIN
65 // *************** SPI3 IMU0 BMI270 **************
66 #define USE_IMU_BMI270
68 #define IMU_BMI270_ALIGN CW270_DEG
69 #define BMI270_SPI_BUS BUS_SPI3
70 #define BMI270_CS_PIN SPI3_NSS_PIN
71 #endif
73 #ifdef ZEEZF7V2
74 #define USE_SPI_DEVICE_1
75 #define SPI1_NSS_PIN PA4
76 #define SPI1_SCK_PIN PA5
77 #define SPI1_MISO_PIN PA6
78 #define SPI1_MOSI_PIN PA7
80 #define MPU6000_CS_PIN SPI1_NSS_PIN
81 #define MPU6000_SPI_BUS BUS_SPI1
82 #define IMU_MPU6000_ALIGN CW0_DEG
83 #define USE_IMU_MPU6000
84 #endif
87 #ifdef ZEEZF7
88 #define USE_SPI_DEVICE_2
89 #define SPI2_NSS_PIN PB12
90 #define SPI2_SCK_PIN PB13
91 #define SPI2_MISO_PIN PB14
92 #define SPI2_MOSI_PIN PB15
94 #define MPU6000_CS_PIN SPI2_NSS_PIN
95 #define MPU6000_SPI_BUS BUS_SPI2
97 #define IMU_MPU6000_ALIGN CW0_DEG_FLIP
98 #define USE_IMU_MPU6000
99 #endif
101 // *************** I2C/Baro/Mag *********************
103 #ifdef ZEEZF7
104 // Target has no I2C but can use MSP devices, such as those provided on Mateksys MQ8-CAN/MSP
105 // Which contains: GPS SAM-M8Q, Compass QMC5883L, Barometer DPS310
106 // See: http://www.mateksys.com/?portfolio=m8q-can
107 #define USE_BARO
108 #define USE_BARO_DPS310
110 #define USE_MAG
111 #define USE_MAG_ALL
113 #endif
115 #if defined ZEEZF7V2 || defined ZEEZF7V3
116 #define USE_I2C
117 #define USE_BARO
118 #define USE_BARO_BMP280
119 #define USE_BARO_BMP388
120 #define USE_BARO_DPS310
122 #define BARO_I2C_BUS BUS_I2C1
124 #define USE_I2C_DEVICE_1
125 #define I2C1_SCL PB8
126 #define I2C1_SDA PB9
128 // External I2C Pads -- I2C3
129 #define USE_I2C_DEVICE_3
130 #define I2C3_SCL PA8
131 #define I2C3_SDA PC9
133 #define USE_MAG
134 #define MAG_I2C_BUS BUS_I2C3
135 #define USE_MAG_ALL
136 #endif
138 // *************** Flash ****************************
140 #if defined ZEEZF7V2 || defined ZEEZF7V3
141 #define USE_SPI_DEVICE_2
142 #define SPI2_NSS_PIN PB12
143 #define SPI2_SCK_PIN PB13
144 #define SPI2_MISO_PIN PC2
145 #define SPI2_MOSI_PIN PC3
147 #define M25P16_SPI_BUS BUS_SPI2
148 #define M25P16_CS_PIN SPI2_NSS_PIN
150 #define W25N01G_SPI_BUS BUS_SPI2
151 #define W25N01G_CS_PIN SPI2_NSS_PIN
152 #ifdef ZEEZF7V3
153 #define SDCARD_SPI_BUS BUS_SPI2
154 #define SDCARD_CS_PIN SPI2_NSS_PIN
156 #define USE_SDCARD
157 #define USE_SDCARD_SPI
158 #endif
160 #endif
162 #ifdef ZEEZF7
163 #define USE_SPI_DEVICE_1
164 #define SPI1_NSS_PIN PA4
165 #define SPI1_SCK_PIN PA5
166 #define SPI1_MISO_PIN PA6
167 #define SPI1_MOSI_PIN PA7
169 #define M25P16_SPI_BUS BUS_SPI1
170 #define M25P16_CS_PIN SPI1_NSS_PIN
172 #define W25N01G_SPI_BUS BUS_SPI1
173 #define W25N01G_CS_PIN SPI1_NSS_PIN
175 #endif
177 #define USE_FLASHFS
178 #define USE_FLASH_M25P16
179 #define USE_FLASH_W25N01G
180 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
182 // *************** OSD *****************************
183 #define USE_MAX7456
185 #if defined ZEEZF7 || defined ZEEZF7V2
186 #define USE_SPI_DEVICE_3
187 #define SPI3_NSS_PIN PA15
188 #define SPI3_SCK_PIN PC10
189 #define SPI3_MISO_PIN PC11
190 #define SPI3_MOSI_PIN PB5
192 #define MAX7456_SPI_BUS BUS_SPI3
193 #define MAX7456_CS_PIN SPI3_NSS_PIN
194 #else
195 #define USE_SPI_DEVICE_1
196 #define SPI1_NSS_PIN PA4
197 #define SPI1_SCK_PIN PA5
198 #define SPI1_MISO_PIN PA6
199 #define SPI1_MOSI_PIN PA7
201 #define MAX7456_SPI_BUS BUS_SPI1
202 #define MAX7456_CS_PIN SPI1_NSS_PIN
203 #endif
205 // *************** PINIO ***************************
207 #ifdef ZEEZF7
208 #define USE_PINIO
209 #define USE_PINIOBOX
210 #define PINIO1_PIN PB11 // VTX power switcher
211 #endif
213 // *************** UART *****************************
215 #define USE_VCP
217 #define USE_UART1
218 #define UART1_RX_PIN PA10
219 #define UART1_TX_PIN PA9
221 #define USE_UART2
222 #define UART2_RX_PIN PA3
223 #define UART2_TX_PIN PA2
225 #define USE_UART3
226 #define UART3_RX_PIN PB11
227 #define UART3_TX_PIN PB10
229 #define USE_UART4
230 #define UART4_RX_PIN PA1
231 #define UART4_TX_PIN PA0
233 #define USE_UART5
234 #define UART5_RX_PIN PD2
235 #define UART5_TX_PIN PC12
237 #if defined ZEEZF7V2 || defined ZEEZF7V3
238 #define SERIAL_PORT_COUNT 6
239 #else
240 #define USE_UART6
241 #define UART6_RX_PIN PC7
242 #define UART6_TX_PIN PC6
243 #define SERIAL_PORT_COUNT 7
244 #endif
246 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
247 #define SERIALRX_PROVIDER SERIALRX_SBUS
248 #define SERIALRX_UART SERIAL_PORT_USART4
250 // *************** ADC *****************************
251 #define USE_ADC
252 #define ADC_INSTANCE ADC1
253 #define ADC1_DMA_STREAM DMA2_Stream0
255 #if defined ZEEZF7V2 || defined ZEEZF7V3
256 #define ADC_CHANNEL_1_PIN PC0
257 #define ADC_CHANNEL_2_PIN PC1
258 #else
259 #define ADC_CHANNEL_1_PIN PC2
260 #define ADC_CHANNEL_2_PIN PC3
261 #endif
263 #define VBAT_ADC_CHANNEL ADC_CHN_1
264 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
266 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_CURRENT_METER | FEATURE_TELEMETRY | FEATURE_VBAT | FEATURE_OSD | FEATURE_LED_STRIP)
268 #if defined ZEEZF7V2 || defined ZEEZF7V3
269 #define CURRENT_METER_SCALE 250
270 #endif
272 // ********** Optical Flow and Lidar **************
274 #define USE_RANGEFINDER
275 #define USE_RANGEFINDER_MSP
276 #define USE_OPFLOW
277 #define USE_OPFLOW_MSP
279 // *************** LED *****************************
281 #define USE_LED_STRIP
282 #define WS2811_PIN PB0
284 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
286 #define TARGET_IO_PORTA 0xffff
287 #define TARGET_IO_PORTB 0xffff
288 #define TARGET_IO_PORTC 0xffff
289 #define TARGET_IO_PORTD (BIT(2))
291 #if defined ZEEZF7V2 || defined ZEEZF7V3
292 #define MAX_PWM_OUTPUT_PORTS 8
293 #else
294 #define MAX_PWM_OUTPUT_PORTS 4
295 #endif
297 #define USE_DSHOT
298 #define USE_ESC_SENSOR