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/>.
21 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
22 #define USE_TARGET_CONFIG
24 #if defined(MATEKF765SE)
25 #define TARGET_BOARD_IDENTIFIER "M7SE"
26 #define USBD_PRODUCT_STRING "MATEKF765SE"
28 #define BEEPER_PWM_FREQUENCY 2500
30 #define TARGET_BOARD_IDENTIFIER "M765"
31 #define USBD_PRODUCT_STRING "MATEKF765"
38 #define BEEPER_INVERTED
40 // *************** SPI1 Gyro & ACC *******************
42 #define USE_SPI_DEVICE_1
43 #define SPI1_SCK_PIN PA5
44 #define SPI1_MISO_PIN PA6
45 #define SPI1_MOSI_PIN PA7
47 #define USE_SPI_DEVICE_3
48 #define SPI3_SCK_PIN PB3
49 #define SPI3_MISO_PIN PB4
50 #define SPI3_MOSI_PIN PB5
54 #define USE_IMU_MPU6000
55 #define IMU_MPU6000_ALIGN CW90_DEG_FLIP
56 #define MPU6000_SPI_BUS BUS_SPI1
57 #define MPU6000_CS_PIN PC4
59 #define USE_IMU_MPU6500
60 #define IMU_MPU6500_ALIGN CW270_DEG_FLIP
61 #define MPU6500_SPI_BUS BUS_SPI3
62 #define MPU6500_CS_PIN PD7
64 #if defined(MATEKF765SE)
65 #define USE_IMU_ICM42605
66 #define IMU_ICM42605_ALIGN CW0_DEG_FLIP
67 #define ICM42605_SPI_BUS BUS_SPI4
68 #define ICM42605_CS_PIN PE11
71 // *************** I2C /Baro/Mag *********************
73 #define USE_I2C_DEVICE_1
77 #define USE_I2C_DEVICE_2
82 #define BARO_I2C_BUS BUS_I2C2
83 #define USE_BARO_BMP280
84 #define USE_BARO_MS5611
85 #define USE_BARO_DPS310
86 #define USE_BARO_SPL06
89 #define MAG_I2C_BUS BUS_I2C1
92 #define TEMPERATURE_I2C_BUS BUS_I2C2
93 #define PITOT_I2C_BUS BUS_I2C2
95 #define USE_RANGEFINDER
96 #define RANGEFINDER_I2C_BUS BUS_I2C2
98 // *************** SPI2 OSD ***********************
99 #define USE_SPI_DEVICE_2
100 #define SPI2_SCK_PIN PB13
101 #define SPI2_MISO_PIN PB14
102 #define SPI2_MOSI_PIN PB15
105 #define MAX7456_SPI_BUS BUS_SPI2
106 #define MAX7456_CS_PIN PB12
108 // *************** SPI4 ******************************
109 #define USE_SPI_DEVICE_4
110 #define SPI4_SCK_PIN PE12
111 #define SPI4_MISO_PIN PE13
112 #define SPI4_MOSI_PIN PE14
114 // *************** UART *****************************
116 #define USB_DETECT_PIN PA15
117 #define USE_USB_DETECT
120 #define UART1_TX_PIN PA9
121 #define UART1_RX_PIN PA10
124 #define UART2_TX_PIN PD5
125 #define UART2_RX_PIN PD6
128 #define UART3_TX_PIN PD8
129 #define UART3_RX_PIN PD9
132 #define UART5_TX_PIN NONE
133 #define UART5_RX_PIN PB8
137 #define UART6_TX_PIN PC6
138 #define UART6_RX_PIN PC7
141 #define UART7_TX_PIN PE8
142 #define UART7_RX_PIN PE7
145 #define UART8_TX_PIN PE1
146 #define UART8_RX_PIN PE0
149 #define USE_SOFTSERIAL1
150 #define SOFTSERIAL_1_TX_PIN PC6 //TX6 pad
151 #define SOFTSERIAL_1_RX_PIN PC6 //TX6 pad
153 #if defined(MATEKF765SE)
154 #define SERIAL_PORT_COUNT 9
155 // PD1 and PD0 are used for CAN
158 #define UART4_TX_PIN PD1
159 #define UART4_RX_PIN PD0
160 #define SERIAL_PORT_COUNT 10
163 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
164 #define SERIALRX_PROVIDER SERIALRX_SBUS
165 #define SERIALRX_UART SERIAL_PORT_USART6
167 // *************** SPI3 SD BLACKBOX*******************
169 #define USE_SDCARD_SDIO
170 #define SDCARD_SDIO_DMA DMA_TAG(2,3,4)
171 #define SDCARD_SDIO_4BIT
172 #define SDCARD_SDIO_DEVICE SDIODEV_1
173 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
175 // *************** ADC *****************************
177 #define ADC_INSTANCE ADC1
179 #define ADC_CHANNEL_1_PIN PC2
180 #define ADC_CHANNEL_2_PIN PC3
181 #define ADC_CHANNEL_3_PIN PC1
182 #define ADC_CHANNEL_4_PIN PC0
183 #define ADC_CHANNEL_5_PIN PA4 //VBAT2
184 #define ADC_CHANNEL_6_PIN PC5 //CURR2
186 #define VBAT_ADC_CHANNEL ADC_CHN_1
187 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
188 #define RSSI_ADC_CHANNEL ADC_CHN_3
189 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
191 // *************** PINIO ***************************
194 #define PINIO1_PIN PE4 // VTX power switcher
195 #define PINIO2_PIN PE15 // 2xCamera switcher
197 // *************** LEDSTRIP ************************
198 #define USE_LED_STRIP
199 #define WS2811_PIN PA8
201 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
203 #if defined(MATEKF765SE)
204 #define VBAT_SCALE_DEFAULT 2100
205 #define CURRENT_METER_SCALE 150
207 #define VBAT_SCALE_DEFAULT 1100
208 #define CURRENT_METER_SCALE 250
211 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
213 #define TARGET_IO_PORTA 0xffff
214 #define TARGET_IO_PORTB 0xffff
215 #define TARGET_IO_PORTC 0xffff
216 #define TARGET_IO_PORTD 0xffff
217 #define TARGET_IO_PORTE 0xffff
219 #define MAX_PWM_OUTPUT_PORTS 16
221 #define USE_ESC_SENSOR