Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / target / MATEKF722PX / target.h
blobae034074478f25af99176971fd74296a1c1a13d3
1 /*
2 * This file is part of INAV.
4 * INAV 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 * INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
19 #pragma once
21 #define TARGET_BOARD_IDENTIFIER "MF7P"
22 #define USBD_PRODUCT_STRING "MATEKF722PX"
24 #define LED0 PA14 //Blue SWCLK
25 #define LED1 PA13 //Green SWDIO
27 #define BEEPER PC13
28 #define BEEPER_INVERTED
30 // *************** SPI1 Gyro & ACC *******************
31 #define USE_SPI
32 #define USE_SPI_DEVICE_1
33 #define SPI1_SCK_PIN PA5
34 #define SPI1_MISO_PIN PA6
35 #define SPI1_MOSI_PIN PA7
37 #define USE_IMU_MPU6000
38 #define IMU_MPU6000_ALIGN CW180_DEG_FLIP
39 #define MPU6000_CS_PIN PB2
40 #define MPU6000_SPI_BUS BUS_SPI1
42 // *************** I2C /Baro/Mag *********************
43 #define USE_I2C
44 #define USE_I2C_DEVICE_1
45 #define I2C1_SCL PB8
46 #define I2C1_SDA PB9
48 #define USE_BARO
49 #define BARO_I2C_BUS BUS_I2C1
50 #define USE_BARO_BMP280
51 #define USE_BARO_MS5611
52 #define USE_BARO_DPS310
53 #define USE_BARO_SPL06
55 #define USE_MAG
56 #define MAG_I2C_BUS BUS_I2C1
57 #define USE_MAG_ALL
59 #define TEMPERATURE_I2C_BUS BUS_I2C1
60 #define PITOT_I2C_BUS BUS_I2C1
62 #define USE_RANGEFINDER
63 #define RANGEFINDER_I2C_BUS BUS_I2C1
65 // *************** SPI2 Flash ***********************
66 #define USE_SPI_DEVICE_2
67 #define SPI2_SCK_PIN PB13
68 #define SPI2_MISO_PIN PB14
69 #define SPI2_MOSI_PIN PC3
71 //F722-PX,F722-HD
72 #if defined(MATEKF722PX)
73 #define USE_FLASHFS
74 #define USE_FLASH_M25P16
75 #define M25P16_SPI_BUS BUS_SPI2
76 #define M25P16_CS_PIN PB12
77 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
78 #else
79 //F722-WPX
80 #define USE_SDCARD
81 #define USE_SDCARD_SPI
82 #define SDCARD_SPI_BUS BUS_SPI2
83 #define SDCARD_CS_PIN PC15
84 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
85 #endif
87 // *************** UART *****************************
88 #define USE_VCP
89 #define USB_DETECT_PIN PC14
90 #define USE_USB_DETECT
92 #define USE_UART1
93 #define UART1_TX_PIN PA9
94 #define UART1_RX_PIN PA10
96 #define USE_UART2
97 #define UART2_TX_PIN PA2
98 #define UART2_RX_PIN PA3
100 #define USE_UART3
101 #define UART3_TX_PIN PC10
102 #define UART3_RX_PIN PC11
104 #define USE_UART4
105 #define UART4_TX_PIN PA0
106 #define UART4_RX_PIN PA1
108 #ifndef MATEKF722PX_PINIO
109 #define USE_UART5
110 #define UART5_TX_PIN PC12
111 #define UART5_RX_PIN PD2
112 #endif
114 #define USE_UART6
115 #define UART6_TX_PIN PC6
116 #define UART6_RX_PIN PC7
118 #define USE_SOFTSERIAL1
119 #define SOFTSERIAL_1_TX_PIN PA2 //TX2 pad
120 #define SOFTSERIAL_1_RX_PIN NONE
122 #ifdef MATEKF722PX_PINIO
123 #define SERIAL_PORT_COUNT 7
124 #else
125 #define SERIAL_PORT_COUNT 8
126 #endif
128 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
129 #define SERIALRX_PROVIDER SERIALRX_SBUS
130 #define SERIALRX_UART SERIAL_PORT_USART2
132 // *************** ADC *****************************
133 #define USE_ADC
134 #define ADC_INSTANCE ADC1
135 #define ADC1_DMA_STREAM DMA2_Stream0
137 #define ADC_CHANNEL_1_PIN PC2
138 #define ADC_CHANNEL_2_PIN PC1
139 #define ADC_CHANNEL_3_PIN PC0
140 #define ADC_CHANNEL_4_PIN PA4
142 #define VBAT_ADC_CHANNEL ADC_CHN_1
143 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
144 #define RSSI_ADC_CHANNEL ADC_CHN_3
145 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
147 // *************** PINIO ***************************
148 #define USE_PINIO
149 #define USE_PINIOBOX
150 #define PINIO1_PIN PA15 // Power switch
151 #define PINIO2_PIN PB3 // Camera switch
153 #ifdef MATEKF722PX_PINIO
154 #define PINIO3_PIN PC12 // UART 5 TX - USER 3 PINIO
155 #define PINIO4_PIN PD2 // UART 5 RX - USER 4 PINIO
156 #endif
158 // *************** LEDSTRIP ************************
159 #define USE_LED_STRIP
160 #define WS2811_PIN PA8
162 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_SOFTSERIAL)
163 #define CURRENT_METER_SCALE 250
165 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
167 #define TARGET_IO_PORTA 0xffff
168 #define TARGET_IO_PORTB 0xffff
169 #define TARGET_IO_PORTC 0xffff
170 #define TARGET_IO_PORTD 0xffff
172 #define MAX_PWM_OUTPUT_PORTS 10
173 #define USE_DSHOT
174 #define USE_ESC_SENSOR