2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #define USE_TARGET_CONFIG
25 #define TARGET_BOARD_IDENTIFIER "M743"
26 #define USBD_PRODUCT_STRING "MATEK-H743"
28 #define LED0_PIN PE3 //Blue
29 #define LED1_PIN PE4 //Green
32 #define BEEPER_PIN PA15
33 #define BEEPER_INVERTED
34 #define BEEPER_PWM_HZ 2500
36 // *************** SPI1 & SPI4, Gyro & ACC *******************
44 #define USE_SPI_DEVICE_1
45 #define GYRO_1_SPI_INSTANCE SPI1 //MPU6000
46 #define SPI1_SCK_PIN PA5
47 #define SPI1_MISO_PIN PA6
48 #define SPI1_MOSI_PIN PD7
49 #define GYRO_1_CS_PIN PC15
50 #define GYRO_1_EXTI_PIN PB2
52 #define USE_GYRO_SPI_MPU6000
53 #define USE_ACC_SPI_MPU6000
54 #define GYRO_1_ALIGN CW0_DEG_FLIP
56 #define USE_SPI_DEVICE_4
57 #define GYRO_2_SPI_INSTANCE SPI4 //ICM20602
58 #define SPI4_SCK_PIN PE12
59 #define SPI4_MISO_PIN PE13
60 #define SPI4_MOSI_PIN PE14
61 #define GYRO_2_CS_PIN PE11
62 #define GYRO_2_EXTI_PIN PE15
64 #define USE_GYRO_SPI_MPU6500
65 #define USE_ACC_SPI_MPU6500
66 #define GYRO_2_ALIGN CW0_DEG_FLIP
68 #define USE_MPU_DATA_READY_SIGNAL
69 #define ENSURE_MPU_DATA_READY_IS_LOW
70 #define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
72 // *************** SPI2 OSD ***********************
74 #define USE_SPI_DEVICE_2
75 #define SPI2_SCK_PIN PB13
76 #define SPI2_MISO_PIN PB14
77 #define SPI2_MOSI_PIN PB15
80 #define MAX7456_SPI_INSTANCE SPI2
81 #define MAX7456_SPI_CS_PIN PB12
83 // *************** SPI3 ***************************
85 #define USE_SPI_DEVICE_3
86 #define SPI3_SCK_PIN PB3
87 #define SPI3_MISO_PIN PB4
88 #define SPI3_MOSI_PIN PB5
89 //#define xxx_CS_PIN PD4
91 // *************** I2C /Baro/Mag *********************
95 #define USE_I2C_DEVICE_1
96 #define I2C_DEVICE_1 (I2CDEV_1)
100 #define MAG_I2C_INSTANCE (I2CDEV_1)
102 #define USE_MAG_HMC5883
103 #define USE_MAG_QMC5883
104 #define USE_MAG_LIS3MDL
106 #define USE_I2C_DEVICE_2
107 #define I2C_DEVICE_2 (I2CDEV_2)
108 #define I2C2_SCL PB10
109 #define I2C2_SDA PB11
111 #define BARO_I2C_INSTANCE (I2CDEV_2)
113 #define DEFAULT_BARO_MS5611
114 #define USE_BARO_MS5611
115 #define USE_BARO_BMP280
116 #define USE_BARO_DPS310
118 // *************** UART *****************************
121 #define USB_DETECT_PIN PE2
122 #define USE_USB_DETECT
125 #define UART1_TX_PIN PA9
126 #define UART1_RX_PIN PA10
129 #define UART2_TX_PIN PD5
130 #define UART2_RX_PIN PD6
133 #define UART3_TX_PIN PD8
134 #define UART3_RX_PIN PD9
137 #define UART4_TX_PIN PB9
138 #define UART4_RX_PIN PB8
141 #define UART6_TX_PIN PC6
142 #define UART6_RX_PIN PC7 //PPM
145 #define UART7_TX_PIN PE8
146 #define UART7_RX_PIN PE7
149 #define UART8_TX_PIN PE1
150 #define UART8_RX_PIN PE0
152 #define USE_SOFTSERIAL1
153 #define SOFTSERIAL1_TX_PIN PC6 // TX6 Pad
155 #define SERIAL_PORT_COUNT 9
157 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
158 #define SERIALRX_PROVIDER SERIALRX_SBUS
159 #define SERIALRX_UART SERIAL_PORT_USART6
161 // *************** SDIO BLACKBOX*******************
164 #define USE_SDCARD_SDIO
165 #define SDCARD_DETECT_PIN NONE
166 #define SDIO_DEVICE SDIODEV_1
167 #define SDIO_USE_4BIT true
168 #define SDIO_CK_PIN PC12
169 #define SDIO_CMD_PIN PD2
170 #define SDIO_D0_PIN PC8
171 #define SDIO_D1_PIN PC9
172 #define SDIO_D2_PIN PC10
173 #define SDIO_D3_PIN PC11
176 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
178 // *************** ADC *****************************
180 #define ADC1_DMA_OPT 8
181 #define ADC3_DMA_OPT 9
184 #define USE_ADC_INTERNAL // ADC3
186 #define VBAT_ADC_PIN PC0 //ADC123 VBAT1
187 #define CURRENT_METER_ADC_PIN PC1 //ADC123 CURR1
188 #define RSSI_ADC_PIN PC5 //ADC12 RSSI
189 #define EXTERNAL1_ADC_PIN PC4 //ADC12 AirS
190 #define EXTERNAL2_ADC_PIN PA4 //ADC12 VB2
191 #define EXTERNAL3_ADC_PIN PA7 //ADC12 CU2
193 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
194 #define VBAT_SCALE_DEFAULT 110
195 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
196 #define CURRENT_METER_SCALE_DEFAULT 250
198 // *************** PINIO ***************************
201 #define PINIO1_PIN PD10 // Vsw power switch
202 #define PINIO2_PIN PD11 // Camera switch
205 // *************** Others ***************************
207 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY )
209 //#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
211 #define USE_ESCSERIAL
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
218 #define TARGET_IO_PORTF 0xffff
219 #define TARGET_IO_PORTG 0xffff
221 #define USABLE_TIMER_CHANNEL_COUNT 18
222 #define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(8)|TIM_N(15)|TIM_N(16)|TIM_N(17))