add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / MATEKF765 / target.h
blob4e68912e86567d4555dc5baaf0fa6da6dec4b7c2
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 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
29 #else
30 #define TARGET_BOARD_IDENTIFIER "M765"
31 #define USBD_PRODUCT_STRING "MATEKF765"
32 #endif
34 #define LED0 PD10
35 #define LED1 PD11
37 #define BEEPER PB9
38 #define BEEPER_INVERTED
40 // *************** SPI1 Gyro & ACC *******************
41 #define USE_SPI
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
52 #define USE_DUAL_GYRO
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
58 #define MPU6000_EXTI_PIN PB2
60 #define USE_IMU_MPU6500
61 #define IMU_MPU6500_ALIGN CW270_DEG_FLIP
62 #define MPU6500_SPI_BUS BUS_SPI3
63 #define MPU6500_CS_PIN PD7
64 #define MPU6500_EXTI_PIN PD4
66 #if defined(MATEKF765SE)
67 #define USE_IMU_ICM42605
68 #define IMU_ICM42605_ALIGN CW0_DEG_FLIP
69 #define ICM42605_SPI_BUS BUS_SPI4
70 #define ICM42605_CS_PIN PE11
71 #define ICM42605_EXTI_PIN PC13
72 #endif
74 #define USE_EXTI
75 #define USE_MPU_DATA_READY_SIGNAL
77 // *************** I2C /Baro/Mag *********************
78 #define USE_I2C
79 #define USE_I2C_DEVICE_1
80 #define I2C1_SCL PB6
81 #define I2C1_SDA PB7
83 #define USE_I2C_DEVICE_2
84 #define I2C2_SCL PB10
85 #define I2C2_SDA PB11
87 #define USE_BARO
88 #define BARO_I2C_BUS BUS_I2C2
89 #define USE_BARO_BMP280
90 #define USE_BARO_MS5611
91 #define USE_BARO_DPS310
92 #define USE_BARO_SPL06
94 #define USE_MAG
95 #define MAG_I2C_BUS BUS_I2C1
96 #define USE_MAG_HMC5883
97 #define USE_MAG_QMC5883
98 #define USE_MAG_IST8310
99 #define USE_MAG_IST8308
100 #define USE_MAG_MAG3110
101 #define USE_MAG_LIS3MDL
103 #define TEMPERATURE_I2C_BUS BUS_I2C2
104 #define BNO055_I2C_BUS BUS_I2C2
105 #define PITOT_I2C_BUS BUS_I2C2
107 #define USE_RANGEFINDER
108 #define RANGEFINDER_I2C_BUS BUS_I2C2
110 // *************** SPI2 OSD ***********************
111 #define USE_SPI_DEVICE_2
112 #define SPI2_SCK_PIN PB13
113 #define SPI2_MISO_PIN PB14
114 #define SPI2_MOSI_PIN PB15
116 #define USE_MAX7456
117 #define MAX7456_SPI_BUS BUS_SPI2
118 #define MAX7456_CS_PIN PB12
120 // *************** SPI4 ******************************
121 #define USE_SPI_DEVICE_4
122 #define SPI4_SCK_PIN PE12
123 #define SPI4_MISO_PIN PE13
124 #define SPI4_MOSI_PIN PE14
126 // *************** UART *****************************
127 #define USE_VCP
128 #define USB_DETECT_PIN PA15
129 #define USE_USB_DETECT
131 #define USE_UART1
132 #define UART1_TX_PIN PA9
133 #define UART1_RX_PIN PA10
135 #define USE_UART2
136 #define UART2_TX_PIN PD5
137 #define UART2_RX_PIN PD6
139 #define USE_UART3
140 #define UART3_TX_PIN PD8
141 #define UART3_RX_PIN PD9
143 #define USE_UART5
144 #define UART5_TX_PIN NONE
145 #define UART5_RX_PIN PB8
146 #define UART5_AF 7
148 #define USE_UART6
149 #define UART6_TX_PIN PC6
150 #define UART6_RX_PIN PC7
152 #define USE_UART7
153 #define UART7_TX_PIN PE8
154 #define UART7_RX_PIN PE7
156 #define USE_UART8
157 #define UART8_TX_PIN PE1
158 #define UART8_RX_PIN PE0
161 #define USE_SOFTSERIAL1
162 #define SOFTSERIAL_1_TX_PIN PC6 //TX6 pad
163 #define SOFTSERIAL_1_RX_PIN PC6 //TX6 pad
165 #if defined(MATEKF765SE)
166 #define SERIAL_PORT_COUNT 9
167 // PD1 and PD0 are used for CAN
168 #else
169 #define USE_UART4
170 #define UART4_TX_PIN PD1
171 #define UART4_RX_PIN PD0
172 #define SERIAL_PORT_COUNT 10
173 #endif
175 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
176 #define SERIALRX_PROVIDER SERIALRX_SBUS
177 #define SERIALRX_UART SERIAL_PORT_USART6
179 // *************** SPI3 SD BLACKBOX*******************
180 #define USE_SDCARD
181 #define USE_SDCARD_SDIO
182 #define SDCARD_SDIO_DMA DMA_TAG(2,3,4)
183 #define SDCARD_SDIO_4BIT
184 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
186 // *************** ADC *****************************
187 #define USE_ADC
188 #define ADC_INSTANCE ADC1
190 #define ADC_CHANNEL_1_PIN PC2
191 #define ADC_CHANNEL_2_PIN PC3
192 #define ADC_CHANNEL_3_PIN PC1
193 #define ADC_CHANNEL_4_PIN PC0
194 #define ADC_CHANNEL_5_PIN PA4 //VBAT2
195 #define ADC_CHANNEL_6_PIN PC5 //CURR2
197 #define VBAT_ADC_CHANNEL ADC_CHN_1
198 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
199 #define RSSI_ADC_CHANNEL ADC_CHN_3
200 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
202 // *************** PINIO ***************************
203 #define USE_PINIO
204 #define USE_PINIOBOX
205 #define PINIO1_PIN PE4 // VTX power switcher
206 #define PINIO2_PIN PE15 // 2xCamera switcher
208 // *************** LEDSTRIP ************************
209 #define USE_LED_STRIP
210 #define WS2811_PIN PA8
212 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
214 #if defined(MATEKF765SE)
215 #define VBAT_SCALE_DEFAULT 2100
216 #define CURRENT_METER_SCALE 150
217 #else
218 #define VBAT_SCALE_DEFAULT 1100
219 #define CURRENT_METER_SCALE 250
220 #endif
222 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
224 #define TARGET_IO_PORTA 0xffff
225 #define TARGET_IO_PORTB 0xffff
226 #define TARGET_IO_PORTC 0xffff
227 #define TARGET_IO_PORTD 0xffff
228 #define TARGET_IO_PORTE 0xffff
230 #define MAX_PWM_OUTPUT_PORTS 16
231 #define USE_DSHOT
232 #define USE_ESC_SENSOR