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/>.
20 #define USE_TARGET_CONFIG
22 #define TARGET_BOARD_IDENTIFIER "JH45"
23 #define USBD_PRODUCT_STRING "JHEMCUF405WING"
26 #define LED0 PA14 //Blue
27 #define LED1 PA13 //Green
31 #define BEEPER_INVERTED
35 #define USE_SPI_DEVICE_1
36 #define SPI1_SCK_PIN PA5
37 #define SPI1_MISO_PIN PA6
38 #define SPI1_MOSI_PIN PA7
41 #define USE_SPI_DEVICE_2
42 #define SPI2_SCK_PIN PB13
43 #define SPI2_MISO_PIN PC2
44 #define SPI2_MOSI_PIN PC3
47 #define USE_SPI_DEVICE_3
48 #define SPI3_SCK_PIN PB3
49 #define SPI3_MISO_PIN PB4
50 #define SPI3_MOSI_PIN PB5
56 #define UART1_TX_PIN PA9
57 #define UART1_RX_PIN PA10
60 #define UART2_TX_PIN PA2
61 #define UART2_RX_PIN PA3
64 #define UART3_TX_PIN PC10
65 #define UART3_RX_PIN PC11
68 #define UART4_TX_PIN PA0
69 #define UART4_RX_PIN PA1
72 #define UART5_TX_PIN PC12
73 #define UART5_RX_PIN PD2
76 #define UART6_TX_PIN PC6
77 #define UART6_RX_PIN PC7
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
84 #define SERIAL_PORT_COUNT 8
87 #define USE_I2C_DEVICE_1
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
99 #define BARO_I2C_BUS BUS_I2C1
104 #define MAG_I2C_BUS BUS_I2C1
107 #define RANGEFINDER_I2C_BUS BUS_I2C1
108 #define PITOT_I2C_BUS BUS_I2C1
109 #define TEMPERATURE_I2C_BUS BUS_I2C1
113 #define MAX7456_CS_PIN PB12
114 #define MAX7456_SPI_BUS BUS_SPI2
118 #define USE_SDCARD_SPI
119 #define SDCARD_SPI_BUS BUS_SPI3
120 #define SDCARD_CS_PIN PC14
122 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
124 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
125 #define SERIALRX_PROVIDER SERIALRX_CRSF
126 #define SERIALRX_UART SERIAL_PORT_USART1
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
142 #define USE_LED_STRIP
143 #define WS2811_PIN PA8
148 #define PINIO1_PIN PC13 // 2xCamera switcher
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
155 #define USE_ESC_SENSOR
156 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
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))
163 #define MAX_PWM_OUTPUT_PORTS 11