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/>.
21 #define TARGET_BOARD_IDENTIFIER "ZEF7V3"
22 #define USBD_PRODUCT_STRING "ZEEZF7V3"
25 #define TARGET_BOARD_IDENTIFIER "ZEF7V2"
26 #define USBD_PRODUCT_STRING "ZEEZF7V2"
29 #define TARGET_BOARD_IDENTIFIER "ZEF7"
30 #define USBD_PRODUCT_STRING "ZEEZF7"
33 #define USE_TARGET_CONFIG
40 #define BEEPER_INVERTED
43 #define BEEPER_INVERTED
46 // *************** Gyro & ACC **********************
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
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
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
101 // *************** I2C/Baro/Mag *********************
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
108 #define USE_BARO_DPS310
111 #define USE_MAG_QMC5883
114 #if defined ZEEZF7V2 || defined ZEEZF7V3
117 #define USE_BARO_BMP280
118 #define USE_BARO_BMP388
119 #define USE_BARO_DPS310
121 #define BARO_I2C_BUS BUS_I2C1
123 #define USE_I2C_DEVICE_1
127 // External I2C Pads -- I2C3
128 #define USE_I2C_DEVICE_3
133 #define MAG_I2C_BUS BUS_I2C3
137 // *************** Flash ****************************
139 #if defined ZEEZF7V2 || defined ZEEZF7V3
140 #define USE_SPI_DEVICE_2
141 #define SPI2_NSS_PIN PB12
142 #define SPI2_SCK_PIN PB13
143 #define SPI2_MISO_PIN PC2
144 #define SPI2_MOSI_PIN PC3
146 #define M25P16_SPI_BUS BUS_SPI2
147 #define M25P16_CS_PIN SPI2_NSS_PIN
149 #define W25N01G_SPI_BUS BUS_SPI2
150 #define W25N01G_CS_PIN SPI2_NSS_PIN
152 #define SDCARD_SPI_BUS BUS_SPI2
153 #define SDCARD_CS_PIN SPI2_NSS_PIN
156 #define USE_SDCARD_SPI
162 #define USE_SPI_DEVICE_1
163 #define SPI1_NSS_PIN PA4
164 #define SPI1_SCK_PIN PA5
165 #define SPI1_MISO_PIN PA6
166 #define SPI1_MOSI_PIN PA7
168 #define M25P16_SPI_BUS BUS_SPI1
169 #define M25P16_CS_PIN SPI1_NSS_PIN
171 #define W25N01G_SPI_BUS BUS_SPI1
172 #define W25N01G_CS_PIN SPI1_NSS_PIN
177 #define USE_FLASH_M25P16
178 #define USE_FLASH_W25N01G
179 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
181 // *************** OSD *****************************
184 #if defined ZEEZF7 || defined ZEEZF7V2
185 #define USE_SPI_DEVICE_3
186 #define SPI3_NSS_PIN PA15
187 #define SPI3_SCK_PIN PC10
188 #define SPI3_MISO_PIN PC11
189 #define SPI3_MOSI_PIN PB5
191 #define MAX7456_SPI_BUS BUS_SPI3
192 #define MAX7456_CS_PIN SPI3_NSS_PIN
194 #define USE_SPI_DEVICE_1
195 #define SPI1_NSS_PIN PA4
196 #define SPI1_SCK_PIN PA5
197 #define SPI1_MISO_PIN PA6
198 #define SPI1_MOSI_PIN PA7
200 #define MAX7456_SPI_BUS BUS_SPI1
201 #define MAX7456_CS_PIN SPI1_NSS_PIN
204 // *************** PINIO ***************************
209 #define PINIO1_PIN PB11 // VTX power switcher
212 // *************** UART *****************************
217 #define UART1_RX_PIN PA10
218 #define UART1_TX_PIN PA9
221 #define UART2_RX_PIN PA3
222 #define UART2_TX_PIN PA2
225 #define UART3_RX_PIN PB11
226 #define UART3_TX_PIN PB10
229 #define UART4_RX_PIN PA1
230 #define UART4_TX_PIN PA0
233 #define UART5_RX_PIN PD2
234 #define UART5_TX_PIN PC12
236 #if defined ZEEZF7V2 || defined ZEEZF7V3
237 #define SERIAL_PORT_COUNT 6
240 #define UART6_RX_PIN PC7
241 #define UART6_TX_PIN PC6
242 #define SERIAL_PORT_COUNT 7
245 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
246 #define SERIALRX_PROVIDER SERIALRX_SBUS
247 #define SERIALRX_UART SERIAL_PORT_USART4
249 // *************** ADC *****************************
251 #define ADC_INSTANCE ADC1
252 #define ADC1_DMA_STREAM DMA2_Stream0
254 #if defined ZEEZF7V2 || defined ZEEZF7V3
255 #define ADC_CHANNEL_1_PIN PC0
256 #define ADC_CHANNEL_2_PIN PC1
258 #define ADC_CHANNEL_1_PIN PC2
259 #define ADC_CHANNEL_2_PIN PC3
262 #define VBAT_ADC_CHANNEL ADC_CHN_1
263 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
265 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_CURRENT_METER | FEATURE_TELEMETRY | FEATURE_VBAT | FEATURE_OSD | FEATURE_LED_STRIP)
267 #if defined ZEEZF7V2 || defined ZEEZF7V3
268 #define CURRENT_METER_SCALE 250
271 // ********** Optical Flow and Lidar **************
273 #define USE_RANGEFINDER
274 #define USE_RANGEFINDER_MSP
276 #define USE_OPFLOW_MSP
278 // *************** LED *****************************
280 #define USE_LED_STRIP
281 #define WS2811_PIN PB0
283 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
285 #define TARGET_IO_PORTA 0xffff
286 #define TARGET_IO_PORTB 0xffff
287 #define TARGET_IO_PORTC 0xffff
288 #define TARGET_IO_PORTD (BIT(2))
290 #if defined ZEEZF7V2 || defined ZEEZF7V3
291 #define MAX_PWM_OUTPUT_PORTS 8
293 #define MAX_PWM_OUTPUT_PORTS 4
297 #define USE_ESC_SENSOR