FIX CONFIG: MATEKF405TEMINI SPI3 + CONFIG DEFAULT_VOLTAGE_METER_SCALE + SYSTEM_HSE_MH...
[betaflight.git] / src / config / MATEKH743 / config.h
blob218c500c54aebe6beb97c936fc7e621669913057
1 /*
2 * This file is part of Betaflight.
4 * Betaflight is free software. You can redistribute this software
5 * and/or modify this software under the terms of the GNU General
6 * Public License as published by the Free Software Foundation,
7 * either version 3 of the License, or (at your option) any later
8 * version.
10 * Betaflight is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this software.
19 * If not, see <http://www.gnu.org/licenses/>.
22 #pragma once
24 #define FC_TARGET_MCU STM32H743
26 #define BOARD_NAME MATEKH743
27 #define MANUFACTURER_ID MTKS
29 #define USE_ACC
30 #define USE_ACC_SPI_MPU6000
31 #define USE_ACC_SPI_MPU6500
32 #define USE_ACC_SPI_ICM42605
33 #define USE_ACC_SPI_ICM42688P
34 #define USE_GYRO
35 #define USE_GYRO_SPI_MPU6000
36 #define USE_GYRO_SPI_MPU6500
37 #define USE_GYRO_SPI_ICM42605
38 #define USE_GYRO_SPI_ICM42688P
39 #define USE_BARO
40 #define USE_BARO_BMP280
41 #define USE_BARO_DPS310
42 #define USE_MAX7456
43 #define USE_SDCARD
45 #define BEEPER_PIN PA15
46 #define MOTOR1_PIN PB0
47 #define MOTOR2_PIN PB1
48 #define MOTOR3_PIN PA0
49 #define MOTOR4_PIN PA1
50 #define MOTOR5_PIN PA2
51 #define MOTOR6_PIN PA3
52 #define MOTOR7_PIN PD12
53 #define MOTOR8_PIN PD13
54 #define SERVO1_PIN PE5
55 #define SERVO2_PIN PE6
56 #define RX_PPM_PIN PC7
57 #define LED_STRIP_PIN PA8
58 #define UART1_TX_PIN PA9
59 #define UART2_TX_PIN PD5
60 #define UART3_TX_PIN PD8
61 #define UART4_TX_PIN PB9
62 #define UART6_TX_PIN PC6
63 #define UART7_TX_PIN PE8
64 #define UART8_TX_PIN PE1
65 #define UART1_RX_PIN PA10
66 #define UART2_RX_PIN PD6
67 #define UART3_RX_PIN PD9
68 #define UART4_RX_PIN PB8
69 #define UART6_RX_PIN PC7
70 #define UART7_RX_PIN PE7
71 #define UART8_RX_PIN PE0
72 #define I2C1_SCL_PIN PB6
73 #define I2C2_SCL_PIN PB10
74 #define I2C1_SDA_PIN PB7
75 #define I2C2_SDA_PIN PB11
76 #define LED0_PIN PE3
77 #define LED1_PIN PE4
78 #define SPI1_SCK_PIN PA5
79 #define SPI2_SCK_PIN PB13
80 #define SPI3_SCK_PIN PB3
81 #define SPI4_SCK_PIN PE12
82 #define SPI1_MISO_PIN PA6
83 #define SPI2_MISO_PIN PB14
84 #define SPI3_MISO_PIN PB4
85 #define SPI4_MISO_PIN PE13
86 #define SPI1_MOSI_PIN PD7
87 #define SPI2_MOSI_PIN PB15
88 #define SPI3_MOSI_PIN PB5
89 #define SPI4_MOSI_PIN PE14
90 #define ADC_VBAT_PIN PC0
91 #define ADC_RSSI_PIN PC5
92 #define ADC_CURR_PIN PC1
93 #define ADC_EXTERNAL1_PIN PC4 //ADC12 AirS
94 #define ADC_EXTERNAL2_PIN PA4 //ADC12 VB2
95 #define ADC_EXTERNAL3_PIN PA7 //ADC12 CU2
96 #define SDIO_CK_PIN PC12
97 #define SDIO_CMD_PIN PD2
98 #define SDIO_D0_PIN PC8
99 #define SDIO_D1_PIN PC9
100 #define SDIO_D2_PIN PC10
101 #define SDIO_D3_PIN PC11
102 #define PINIO1_PIN PD10
103 #define PINIO2_PIN PD11
104 #define MAX7456_SPI_CS_PIN PB12
105 #define GYRO_1_EXTI_PIN PB2
106 #define GYRO_2_EXTI_PIN PE15
107 #define GYRO_1_CS_PIN PC15
108 #define GYRO_2_CS_PIN PE11
109 #define USB_DETECT_PIN PE2
110 #define VBAT_ADC_PIN PC0 //ADC123 VBAT1
111 #define CURRENT_METER_ADC_PIN PC1 //ADC123 CURR1
112 #define RSSI_ADC_PIN PC5 //ADC12 RSSI
115 #define TIMER_PIN_MAPPING \
116 TIMER_PIN_MAP( 0, PB0 , 2, 0) \
117 TIMER_PIN_MAP( 1, PB1 , 2, 1) \
118 TIMER_PIN_MAP( 2, PA0 , 2, 2) \
119 TIMER_PIN_MAP( 3, PA1 , 2, 3) \
120 TIMER_PIN_MAP( 4, PA2 , 2, 4) \
121 TIMER_PIN_MAP( 5, PA3 , 2, 5) \
122 TIMER_PIN_MAP( 6, PD12, 1, 6) \
123 TIMER_PIN_MAP( 7, PD13, 1, 7) \
124 TIMER_PIN_MAP( 8, PD14, 1, 12) \
125 TIMER_PIN_MAP( 9, PD15, 1, -1) \
126 TIMER_PIN_MAP(10, PE5 , 1, 0) \
127 TIMER_PIN_MAP(11, PE6 , 1, -1) \
128 TIMER_PIN_MAP(12, PA8 , 1, 14) \
129 TIMER_PIN_MAP(13, PA15, 1, 0) \
130 TIMER_PIN_MAP(14, PC7 , 2, 0) \
131 TIMER_PIN_MAP(15, PC6 , 2, 0) \
132 TIMER_PIN_MAP(16, PB8 , 1, 0) \
133 TIMER_PIN_MAP(17, PB9 , 1, 0)
137 #define ADC1_DMA_OPT 8
138 #define ADC3_DMA_OPT 9
139 #define TIMUP1_DMA_OPT 0
140 #define TIMUP2_DMA_OPT 0
141 #define TIMUP3_DMA_OPT 2
142 #define TIMUP4_DMA_OPT 1
143 #define TIMUP5_DMA_OPT 0
144 #define TIMUP8_DMA_OPT 0
146 #define BARO_I2C_INSTANCE (I2CDEV_2)
147 #define MAG_I2C_INSTANCE (I2CDEV_1)
149 #define USE_SOFTSERIAL1
150 #define SOFTSERIAL1_TX_PIN PC6 // TX6 Pad
151 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
152 // #define SERIALRX_PROVIDER SERIALRX_SBUS
153 #define SERIALRX_UART SERIAL_PORT_USART6
155 #define USE_BLACKBOX
156 #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_SDCARD
157 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
158 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
159 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
160 #define DEFAULT_VOLTAGE_METER_SCALE_DEFAULT 110
161 #define DEFAULT_CURRENT_METER_SCALE 250
162 #define BEEPER_INVERTED
163 #define BEEPER_PWM_HZ 2500
165 #define SDCARD_DETECT_PIN NONE
166 #define SDIO_DEVICE SDIODEV_1
167 #define SDIO_USE_4BIT 1
168 #define MAX7456_SPI_INSTANCE SPI2
170 //TODO #define PINIO_BOX 40,41,255,255
171 #define USE_SPI_GYRO
172 #define GYRO_1_SPI_INSTANCE SPI1
173 #define GYRO_1_ALIGN CW0_DEG_FLIP
174 #define GYRO_1_ALIGN_PITCH 1800
175 #define GYRO_2_SPI_INSTANCE SPI4
176 #define GYRO_2_ALIGN CW0_DEG_FLIP
177 #define GYRO_2_ALIGN_PITCH 1800
178 #define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
180 #define USE_MPU_DATA_READY_SIGNAL
181 #define ENSURE_MPU_DATA_READY_IS_LOW