Merge pull request #10542 from iNavFlight/mmosca-bmp390
[inav.git] / src / main / target / JHEMCUH743HD / target.h
blob92300b52564c7c1caddb9eebd18297531b7efc63
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/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "JHEH743HD"
21 #define USBD_PRODUCT_STRING "JHEMCUH743HD"
23 #define USE_TARGET_CONFIG
25 #define LED0 PE5
26 #define LED1 PE4
28 #define BEEPER PE3
29 #define BEEPER_INVERTED
31 // *************** IMU generic ***********************
32 #define USE_DUAL_GYRO
33 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
35 // *************** SPI1 IMU0 MPU6000 ****************
36 #define USE_SPI
37 #define USE_SPI_DEVICE_1
38 #define SPI1_SCK_PIN PA5
39 #define SPI1_MISO_PIN PA6
40 #define SPI1_MOSI_PIN PA7
42 #define USE_IMU_MPU6000
43 #define IMU_MPU6000_ALIGN CW180_DEG
44 #define MPU6000_SPI_BUS BUS_SPI1
45 #define MPU6000_CS_PIN PA4
47 #define USE_IMU_BMI270
48 #define IMU_BMI270_ALIGN CW180_DEG
49 #define BMI270_SPI_BUS BUS_SPI1
50 #define BMI270_CS_PIN PA4
52 #define USE_IMU_ICM42605
53 #define IMU_ICM42605_ALIGN CW180_DEG
54 #define ICM42605_SPI_BUS BUS_SPI1
55 #define ICM42605_CS_PIN PA4
57 // *************** SPI2 OSD ***********************
58 #define USE_SPI_DEVICE_2
59 #define SPI2_SCK_PIN PB13
60 #define SPI2_MISO_PIN PB14
61 #define SPI2_MOSI_PIN PB15
63 #define USE_MAX7456
64 #define MAX7456_SPI_BUS BUS_SPI2
65 #define MAX7456_CS_PIN PB12
67 // *************** SPI3 FLASH ***********************
68 #define USE_SPI_DEVICE_3
69 #define SPI3_SCK_PIN PC10
70 #define SPI3_MISO_PIN PC11
71 #define SPI3_MOSI_PIN PB2
72 #define SPI3_NSS_PIN PA15
73 #define SPI3_SCK_AF GPIO_AF6_SPI3
74 #define SPI3_MISO_AF GPIO_AF6_SPI3
75 #define SPI3_MOSI_AF GPIO_AF7_SPI3
77 #define M25P16_SPI_BUS BUS_SPI3
78 #define M25P16_CS_PIN SPI3_NSS_PIN
80 #define W25N01G_SPI_BUS BUS_SPI3
81 #define W25N01G_CS_PIN SPI3_NSS_PIN
83 #define USE_BLACKBOX
84 #define USE_FLASHFS
85 #define USE_FLASH_M25P16
86 #define USE_FLASH_W25N01G
87 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
89 // *************** I2C /Baro/Mag *********************
90 #define USE_I2C
91 #define USE_I2C_DEVICE_1
92 #define I2C1_SCL PB6
93 #define I2C1_SDA PB7
95 #define USE_I2C_DEVICE_2
96 #define I2C2_SCL PB10
97 #define I2C2_SDA PB11
99 #define USE_BARO
100 #define BARO_I2C_BUS BUS_I2C1
101 #define USE_BARO_ALL
103 #define USE_MAG
104 #define MAG_I2C_BUS BUS_I2C1
105 #define USE_MAG_ALL
107 #define TEMPERATURE_I2C_BUS BUS_I2C1
108 #define PITOT_I2C_BUS BUS_I2C1
110 #define USE_RANGEFINDER
111 #define RANGEFINDER_I2C_BUS BUS_I2C1
113 // *************** UART *****************************
114 #define USE_VCP
116 #define USE_UART1
117 #define UART1_TX_PIN PA9
118 #define UART1_RX_PIN PA10
120 #define USE_UART2
121 #define UART2_TX_PIN PD5
122 #define UART2_RX_PIN PD6
124 #define USE_UART3
125 #define UART3_TX_PIN PD8
126 #define UART3_RX_PIN PD9
128 #define USE_UART4
129 #define UART4_TX_PIN PD1
130 #define UART4_RX_PIN PD0
132 #define USE_UART5
133 #define UART5_TX_PIN PC12
134 #define UART5_RX_PIN PD2
136 #define USE_UART6
137 #define UART6_TX_PIN PC6
138 #define UART6_RX_PIN PC7
140 #define USE_UART7
141 #define UART7_TX_PIN PE8
142 #define UART7_RX_PIN PE7
144 #define USE_UART8
145 #define UART8_TX_PIN PE1
146 #define UART8_RX_PIN PE0
148 #define SERIAL_PORT_COUNT 9
150 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
151 #define SERIALRX_PROVIDER SERIALRX_SBUS
153 // *************** ADC *****************************
154 #define USE_ADC
155 #define ADC_INSTANCE ADC3
157 #ifdef MAMBAH743_2022B
159 #define ADC_CHANNEL_1_PIN PC1
160 #define ADC_CHANNEL_2_PIN PC3
161 #define ADC_CHANNEL_3_PIN PC0
163 #define VBAT_ADC_CHANNEL ADC_CHN_1
164 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
165 #define AIRSPEED_ADC_CHANNEL ADC_CHN_3
167 #else
169 #define ADC_CHANNEL_1_PIN PC1
170 #define ADC_CHANNEL_2_PIN PC3
171 #define ADC_CHANNEL_3_PIN PC2
172 #define ADC_CHANNEL_4_PIN PC0
174 #define VBAT_ADC_CHANNEL ADC_CHN_1
175 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
176 #define RSSI_ADC_CHANNEL ADC_CHN_3
177 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
179 #endif
181 // *************** PINIO ***************************
182 #define USE_PINIO
183 #define USE_PINIOBOX
185 #define PINIO1_PIN PC2
186 #define PINIO2_PIN PC5
188 // *************** LEDSTRIP ************************
189 #define USE_LED_STRIP
190 #define WS2811_PIN PA8
192 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL)
193 #define CURRENT_METER_SCALE 250
195 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
197 #define TARGET_IO_PORTA 0xffff
198 #define TARGET_IO_PORTB 0xffff
199 #define TARGET_IO_PORTC 0xffff
200 #define TARGET_IO_PORTD 0xffff
201 #define TARGET_IO_PORTE 0xffff
203 #define MAX_PWM_OUTPUT_PORTS 8
204 #define USE_DSHOT
205 #define USE_ESC_SENSOR