Merge pull request #10592 from iNavFlight/MrD_Update-parameter-description
[inav.git] / src / main / target / MATEKF722SE / target.h
blob0679d3f531d729dcf13fb2decfa9ac9380f5f836
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 #if defined(MATEKF722MINI)
22 # define TARGET_BOARD_IDENTIFIER "MF7M"
23 # define USBD_PRODUCT_STRING "MatekF722Mini"
24 #else
25 # define TARGET_BOARD_IDENTIFIER "MF7S"
26 # define USBD_PRODUCT_STRING "MatekF722SE"
27 #endif
29 #define LED0 PA14 //Blue SWCLK
30 #define LED1 PA13 //Green SWDIO
32 #define BEEPER PC13
33 #define BEEPER_INVERTED
35 // *************** SPI1 Gyro & ACC *******************
36 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
38 #define USE_SPI
39 #define USE_SPI_DEVICE_1
40 #define SPI1_SCK_PIN PA5
41 #define SPI1_MISO_PIN PA6
42 #define SPI1_MOSI_PIN PA7
44 #define USE_DUAL_GYRO
46 #define USE_IMU_MPU6000
47 #define IMU_MPU6000_ALIGN CW180_DEG_FLIP
48 #define MPU6000_CS_PIN PB2
49 #define MPU6000_SPI_BUS BUS_SPI1
51 #define USE_IMU_MPU6500
52 #define IMU_MPU6500_ALIGN CW90_DEG
53 #define MPU6500_CS_PIN PC15
54 #define MPU6500_SPI_BUS BUS_SPI1
56 // *************** I2C /Baro/Mag *********************
57 #define USE_I2C
58 #define USE_I2C_DEVICE_1
59 #define I2C1_SCL PB8
60 #define I2C1_SDA PB9
62 #define USE_BARO
63 #define BARO_I2C_BUS BUS_I2C1
64 #define USE_BARO_BMP280
65 #define USE_BARO_MS5611
66 #define USE_BARO_DPS310
67 #define USE_BARO_SPL06
69 #define USE_MAG
70 #define MAG_I2C_BUS BUS_I2C1
71 #define USE_MAG_ALL
73 #define TEMPERATURE_I2C_BUS BUS_I2C1
75 #define PITOT_I2C_BUS BUS_I2C1
77 #define USE_RANGEFINDER
78 #define RANGEFINDER_I2C_BUS BUS_I2C1
80 // *************** SPI2 OSD ***********************
81 #define USE_SPI_DEVICE_2
82 #define SPI2_SCK_PIN PB13
83 #define SPI2_MISO_PIN PB14
84 #define SPI2_MOSI_PIN PB15
86 #define USE_MAX7456
87 #define MAX7456_SPI_BUS BUS_SPI2
88 #define MAX7456_CS_PIN PB12
90 // *************** SPI3 SD BLACKBOX*******************
91 #define USE_SPI_DEVICE_3
92 #define SPI3_SCK_PIN PC10
93 #define SPI3_MISO_PIN PC11
94 #define SPI3_MOSI_PIN PC12
96 #if defined(MATEKF722MINI)
97 # define USE_FLASHFS
98 # define USE_FLASH_M25P16
99 # define M25P16_SPI_BUS BUS_SPI3
100 # define M25P16_CS_PIN PD2
101 # define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
102 #else
103 # define USE_SDCARD
104 # define USE_SDCARD_SPI
105 # define SDCARD_SPI_BUS BUS_SPI3
106 # define SDCARD_CS_PIN PD2
107 # define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
108 #endif
110 // *************** UART *****************************
111 #define USE_VCP
112 #define USB_DETECT_PIN PC14
113 #define USE_USB_DETECT
115 #define USE_UART1
116 #define UART1_TX_PIN PA9
117 #define UART1_RX_PIN PA10
119 #define USE_UART2
120 #define UART2_TX_PIN PA2
121 #define UART2_RX_PIN PA3
123 #define USE_UART3
124 #define UART3_TX_PIN PB10
125 #define UART3_RX_PIN PB11
127 #define USE_UART4
128 #define UART4_TX_PIN PA0
129 #define UART4_RX_PIN PA1
131 #define USE_UART6
132 #define UART6_TX_PIN PC6
133 #define UART6_RX_PIN PC7
135 #define USE_SOFTSERIAL1
136 #define SOFTSERIAL_1_TX_PIN PA2
137 #define SOFTSERIAL_1_RX_PIN PA2
139 #define SERIAL_PORT_COUNT 7
141 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
142 #define SERIALRX_PROVIDER SERIALRX_SBUS
143 #define SERIALRX_UART SERIAL_PORT_USART2
145 // *************** ADC *****************************
146 #define USE_ADC
147 #define ADC_INSTANCE ADC1
148 #define ADC1_DMA_STREAM DMA2_Stream0
150 #define ADC_CHANNEL_1_PIN PC2
151 #define ADC_CHANNEL_2_PIN PC1
152 #define ADC_CHANNEL_3_PIN PC0
153 #define ADC_CHANNEL_4_PIN PA4
155 #define VBAT_ADC_CHANNEL ADC_CHN_1
156 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
157 #define RSSI_ADC_CHANNEL ADC_CHN_3
158 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
160 // *************** PINIO ***************************
161 #define USE_PINIO
162 #define USE_PINIOBOX
163 #define PINIO1_PIN PC8 // VTX power switcher
164 #define PINIO2_PIN PC9 // 2xCamera switcher
166 // *************** LEDSTRIP ************************
167 #define USE_LED_STRIP
168 #define WS2811_PIN PA8
170 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
171 #define CURRENT_METER_SCALE 179
173 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
175 #define TARGET_IO_PORTA 0xffff
176 #define TARGET_IO_PORTB 0xffff
177 #define TARGET_IO_PORTC 0xffff
178 #define TARGET_IO_PORTD 0xffff
180 #define MAX_PWM_OUTPUT_PORTS 8
181 #define USE_DSHOT
182 #define USE_ESC_SENSOR