vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / MATEKH743 / target.h
blobf2e21b0ee86e54758fe0711f3a834a92387cd03e
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 TARGET_BOARD_IDENTIFIER "H743"
23 #if defined(MATEKH743HD)
24 #define USBD_PRODUCT_STRING "MATEKH743HD"
25 #else
26 #define USBD_PRODUCT_STRING "MATEKH743"
27 #endif
29 #define USE_TARGET_CONFIG
31 #define LED0 PE3
32 #define LED1 PE4
34 #define BEEPER PA15
35 #define BEEPER_INVERTED
36 #define BEEPER_PWM_FREQUENCY 2500
38 // *************** IMU generic ***********************
39 #define USE_DUAL_GYRO
40 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
44 // *************** SPI1 IMU0 MPU6000 ****************
45 #define USE_SPI
46 #define USE_SPI_DEVICE_1
47 #define SPI1_SCK_PIN PA5
48 #define SPI1_MISO_PIN PA6
49 #define SPI1_MOSI_PIN PD7
51 #define USE_IMU_MPU6000
53 #define IMU_MPU6000_ALIGN CW0_DEG_FLIP
54 #define MPU6000_SPI_BUS BUS_SPI1
55 #define MPU6000_CS_PIN PC15
57 // *************** SPI4 IMU1 ICM20602 **************
58 #define USE_SPI_DEVICE_4
59 #define SPI4_SCK_PIN PE12
60 #define SPI4_MISO_PIN PE13
61 #define SPI4_MOSI_PIN PE14
63 #define USE_IMU_MPU6500
65 #define IMU_MPU6500_ALIGN CW0_DEG_FLIP
66 #define MPU6500_SPI_BUS BUS_SPI4
67 #define MPU6500_CS_PIN PE11
69 // *************** SPI4 IMU2 ICM42605 **************
70 #define USE_IMU_ICM42605
72 #define IMU_ICM42605_ALIGN CW90_DEG_FLIP
73 #define ICM42605_SPI_BUS BUS_SPI4
74 #define ICM42605_CS_PIN PC13
76 // *************** SPI2 OSD ***********************
77 #define USE_SPI_DEVICE_2
78 #define SPI2_SCK_PIN PB13
79 #define SPI2_MISO_PIN PB14
80 #define SPI2_MOSI_PIN PB15
82 #if defined(MATEKH743)
83 #define USE_MAX7456
84 #define MAX7456_SPI_BUS BUS_SPI2
85 #define MAX7456_CS_PIN PB12
86 #endif
88 // *************** SPI3 SPARE for external RM3100 ***********
89 #define USE_SPI_DEVICE_3
90 #define SPI3_SCK_PIN PB3
91 #define SPI3_MISO_PIN PB4
92 #define SPI3_MOSI_PIN PB5
94 #define USE_MAG_RM3100
95 #define RM3100_CS_PIN PE2 //CS2 pad
96 // PD4 //CS1 pad
97 #define RM3100_SPI_BUS BUS_SPI3
99 // *************** I2C /Baro/Mag *********************
100 #define USE_I2C
101 #define USE_I2C_DEVICE_1
102 #define I2C1_SCL PB6
103 #define I2C1_SDA PB7
105 #define USE_I2C_DEVICE_2
106 #define I2C2_SCL PB10
107 #define I2C2_SDA PB11
109 #define USE_BARO
110 #define BARO_I2C_BUS BUS_I2C2
111 #define USE_BARO_BMP280
112 #define USE_BARO_MS5611
113 #define USE_BARO_DPS310
114 #define USE_BARO_SPL06
116 #define USE_MAG
117 #define MAG_I2C_BUS BUS_I2C1
118 #define USE_MAG_ALL
120 #define TEMPERATURE_I2C_BUS BUS_I2C2
121 #define PITOT_I2C_BUS BUS_I2C2
123 #define USE_RANGEFINDER
124 #define RANGEFINDER_I2C_BUS BUS_I2C1
126 // *************** UART *****************************
127 #define USE_VCP
129 #define USE_UART1
130 #define UART1_TX_PIN PA9
131 #define UART1_RX_PIN PA10
133 #define USE_UART2
134 #define UART2_TX_PIN PD5
135 #define UART2_RX_PIN PD6
137 #define USE_UART3
138 #define UART3_TX_PIN PD8
139 #define UART3_RX_PIN PD9
141 #define USE_UART4
142 #define UART4_TX_PIN PB9
143 #define UART4_RX_PIN PB8
145 #define USE_UART6
146 #define UART6_TX_PIN PC6
147 #define UART6_RX_PIN PC7
149 #define USE_UART7
150 #define UART7_TX_PIN PE8
151 #define UART7_RX_PIN PE7
153 #define USE_UART8
154 #define UART8_TX_PIN PE1
155 #define UART8_RX_PIN PE0
157 #define USE_SOFTSERIAL1
158 #define SOFTSERIAL_1_TX_PIN PC6 //TX6 pad
159 #define SOFTSERIAL_1_RX_PIN PC6 //TX6 pad
161 #define SERIAL_PORT_COUNT 9
163 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
164 #define SERIALRX_PROVIDER SERIALRX_CRSF
165 #define SERIALRX_UART SERIAL_PORT_USART6
167 // *************** SDIO SD BLACKBOX*******************
168 #define USE_SDCARD
169 #define USE_SDCARD_SDIO
170 #define SDCARD_SDIO_DEVICE SDIODEV_1
171 #define SDCARD_SDIO_4BIT
173 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
175 // *************** ADC *****************************
176 #define USE_ADC
177 #define ADC_INSTANCE ADC1
179 #define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1
180 #define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1
181 #define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI
182 #define ADC_CHANNEL_4_PIN PC4 //ADC12 AirS
183 #define ADC_CHANNEL_5_PIN PA4 //ADC12 VB2
184 #define ADC_CHANNEL_6_PIN PA7 //ADC12 CU2
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 ***************************
192 #define USE_PINIO
193 #define USE_PINIOBOX
194 #define PINIO1_PIN PD10 // VTX power switcher
195 #define PINIO2_PIN PD11 // 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)
202 #define CURRENT_METER_SCALE 250
204 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
206 #define TARGET_IO_PORTA 0xffff
207 #define TARGET_IO_PORTB 0xffff
208 #define TARGET_IO_PORTC 0xffff
209 #define TARGET_IO_PORTD 0xffff
210 #define TARGET_IO_PORTE 0xffff
212 #define MAX_PWM_OUTPUT_PORTS 15
213 #define USE_DSHOT
214 #define USE_ESC_SENSOR