1+ /*
2+ * This file is part of INAV.
3+ *
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.
8+ *
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.
13+ *
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/>.
16+ */
17+
18+ #pragma once
19+
20+ #define USE_TARGET_CONFIG
21+
22+ #define TARGET_BOARD_IDENTIFIER "JH45"
23+ #define USBD_PRODUCT_STRING "JHEMCUF405WING"
24+
25+ // LEDs
26+ #define LED0 PA14 //Blue
27+ #define LED1 PA13 //Green
28+
29+ // Beeper
30+ #define BEEPER PC15
31+ #define BEEPER_INVERTED
32+
33+ // SPI1
34+ #define USE_SPI
35+ #define USE_SPI_DEVICE_1
36+ #define SPI1_SCK_PIN PA5
37+ #define SPI1_MISO_PIN PA6
38+ #define SPI1_MOSI_PIN PA7
39+
40+ // SPI2
41+ #define USE_SPI_DEVICE_2
42+ #define SPI2_SCK_PIN PB13
43+ #define SPI2_MISO_PIN PC2
44+ #define SPI2_MOSI_PIN PC3
45+
46+ // SPI3
47+ #define USE_SPI_DEVICE_3
48+ #define SPI3_SCK_PIN PB3
49+ #define SPI3_MISO_PIN PB4
50+ #define SPI3_MOSI_PIN PB5
51+
52+ // Serial ports
53+ #define USE_VCP
54+
55+ #define USE_UART1
56+ #define UART1_TX_PIN PA9
57+ #define UART1_RX_PIN PA10
58+
59+ #define USE_UART2
60+ #define UART2_TX_PIN PA2
61+ #define UART2_RX_PIN PA3
62+
63+ #define USE_UART3
64+ #define UART3_TX_PIN PC10
65+ #define UART3_RX_PIN PC11
66+
67+ #define USE_UART4
68+ #define UART4_TX_PIN PA0
69+ #define UART4_RX_PIN PA1
70+
71+ #define USE_UART5
72+ #define UART5_TX_PIN PC12
73+ #define UART5_RX_PIN PD2
74+
75+ #define USE_UART6
76+ #define UART6_TX_PIN PC6
77+ #define UART6_RX_PIN PC7
78+
79+ // Optional Softserial on UART2 TX Pin PA2
80+ #define USE_SOFTSERIAL1
81+ #define SOFTSERIAL_1_TX_PIN PA2
82+ #define SOFTSERIAL_1_RX_PIN PA2
83+
84+ #define SERIAL_PORT_COUNT 8
85+
86+ #define USE_I2C
87+ #define USE_I2C_DEVICE_1
88+ #define I2C1_SCL PB8
89+ #define I2C1_SDA PB9
90+
91+ // ICM42605/ICM42688P
92+ #define USE_IMU_ICM42605
93+ #define IMU_ICM42605_ALIGN CW270_DEG
94+ #define ICM42605_CS_PIN PA4
95+ #define ICM42605_SPI_BUS BUS_SPI1
96+
97+ // Baro
98+ #define USE_BARO
99+ #define BARO_I2C_BUS BUS_I2C1
100+ #define USE_BARO_ALL
101+
102+ // Mag
103+ #define USE_MAG
104+ #define MAG_I2C_BUS BUS_I2C1
105+ #define USE_MAG_ALL
106+
107+ #define RANGEFINDER_I2C_BUS BUS_I2C1
108+ #define PITOT_I2C_BUS BUS_I2C1
109+ #define TEMPERATURE_I2C_BUS BUS_I2C1
110+
111+ // OSD
112+ #define USE_MAX7456
113+ #define MAX7456_CS_PIN PB12
114+ #define MAX7456_SPI_BUS BUS_SPI2
115+
116+ // SD Card
117+ #define USE_SDCARD
118+ #define USE_SDCARD_SPI
119+ #define SDCARD_SPI_BUS BUS_SPI3
120+ #define SDCARD_CS_PIN PC14
121+
122+ #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
123+
124+ #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
125+ #define SERIALRX_PROVIDER SERIALRX_CRSF
126+ #define SERIALRX_UART SERIAL_PORT_USART1
127+
128+ // ADC
129+ #define USE_ADC
130+ #define ADC_INSTANCE ADC1
131+ #define ADC1_DMA_STREAM DMA2_Stream0
132+ #define ADC_CHANNEL_1_PIN PC0
133+ #define ADC_CHANNEL_2_PIN PC1
134+ #define ADC_CHANNEL_3_PIN PC5
135+ #define ADC_CHANNEL_4_PIN PC4
136+ #define VBAT_ADC_CHANNEL ADC_CHN_1
137+ #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
138+ #define RSSI_ADC_CHANNEL ADC_CHN_4
139+ #define AIRSPEED_ADC_CHANNEL ADC_CHN_3
140+
141+ // LED2812
142+ #define USE_LED_STRIP
143+ #define WS2811_PIN PA8
144+
145+ // PINIO
146+ #define USE_PINIO
147+ #define USE_PINIOBOX
148+ #define PINIO1_PIN PC13 // 2xCamera switcher
149+
150+ // OTHERS
151+ #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_BLACKBOX | FEATURE_AIRMODE)
152+ #define CURRENT_METER_SCALE 175
153+
154+ #define USE_DSHOT
155+ #define USE_ESC_SENSOR
156+ #define USE_SERIAL_4WAY_BLHELI_INTERFACE
157+
158+ #define TARGET_IO_PORTA 0xffff
159+ #define TARGET_IO_PORTB 0xffff
160+ #define TARGET_IO_PORTC 0xffff
161+ #define TARGET_IO_PORTD (BIT(2))
162+
163+ #define MAX_PWM_OUTPUT_PORTS 11
0 commit comments