Merge pull request #10558 from iNavFlight/MrD_Correct-comments-on-OSD-symbols
[inav.git] / src / main / target / JHEMCUF405 / target.h
blob3cd6fd1e3ea9484227559db7e26da29c7dde455a
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 "JH45"
21 #define USBD_PRODUCT_STRING "JHEMCUF405"
23 #define LED0 PC14 //Green
24 #define BEEPER PC13
25 #define BEEPER_INVERTED
27 // *************** SPI1 Gyro & ACC *******************
28 #define USE_SPI
29 #define USE_SPI_DEVICE_1
31 #define SPI1_SCK_PIN PA5
32 #define SPI1_MISO_PIN PA6
33 #define SPI1_MOSI_PIN PA7
35 #define USE_IMU_MPU6000
36 #define IMU_MPU6000_ALIGN CW90_DEG
37 #define MPU6000_CS_PIN PB12
38 #define MPU6000_SPI_BUS BUS_SPI1
40 #define USE_IMU_BMI270
41 #define IMU_BMI270_ALIGN CW90_DEG
42 #define BMI270_SPI_BUS BUS_SPI1
43 #define BMI270_CS_PIN PB12
44 #define BMI270_EXTI_PIN GYRO_INT_EXTI
46 #define USE_IMU_ICM42605
47 #define IMU_ICM42605_ALIGN CW90_DEG
48 #define ICM42605_CS_PIN PB12
49 #define ICM42605_SPI_BUS BUS_SPI1
51 #define USE_EXTI
52 #define GYRO_INT_EXTI PB13
53 #define USE_MPU_DATA_READY_SIGNAL
55 // *************** I2C /Baro/Mag *********************
56 #define USE_I2C
57 #define USE_I2C_DEVICE_1
58 #define I2C1_SCL PB8
59 #define I2C1_SDA PB9
61 #define USE_BARO
62 #define BARO_I2C_BUS BUS_I2C1
63 #define USE_BARO_BMP280
64 #define USE_BARO_MS5611
65 #define USE_BARO_BMP085
66 #define USE_BARO_DPS310
67 #define USE_BARO_SPL06
69 #define USE_MAG
70 #define MAG_I2C_BUS BUS_I2C1
71 #define USE_MAG_ALL
73 #define USE_RANGEFINDER
74 #define USE_RANGEFINDER_HCSR04_I2C
75 #define RANGEFINDER_I2C_BUS BUS_I2C1
76 #define PITOT_I2C_BUS BUS_I2C1
77 #define TEMPERATURE_I2C_BUS BUS_I2C1
79 // *************** SPI2 OSD ***************************
80 #define USE_SPI_DEVICE_3
81 #define SPI3_SCK_PIN PC10
82 #define SPI3_MISO_PIN PC11
83 #define SPI3_MOSI_PIN PC12
85 #define USE_OSD
86 #define USE_MAX7456
87 #define MAX7456_SPI_BUS BUS_SPI3
88 #define MAX7456_CS_PIN PB14
90 // *************** Onboard flash ********************
91 #define USE_FLASHFS
92 #define USE_FLASH_M25P16
93 #define M25P16_CS_PIN PB3
94 #define M25P16_SPI_BUS BUS_SPI3
95 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
97 // *************** UART *****************************
98 #define USB_IO
99 #define USE_VCP
100 #define VBUS_SENSING_PIN PA8
101 #define VBUS_SENSING_ENABLED
103 #define USE_UART1
104 #define UART1_TX_PIN PB6
105 #define UART1_RX_PIN PA10
107 #define USE_UART2
108 #define UART2_TX_PIN PD5
109 #define UART2_RX_PIN PD6
111 #define USE_UART3
112 #define UART3_TX_PIN PB10
113 #define UART3_RX_PIN PB11
115 #define USE_UART4
116 #define UART4_TX_PIN PA0
117 #define UART4_RX_PIN PA1
119 #define USE_UART6
120 #define UART6_TX_PIN PC6
121 #define UART6_RX_PIN PC7
123 #define SERIAL_PORT_COUNT 6
125 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
126 #define SERIALRX_PROVIDER SERIALRX_SBUS
127 #define SERIALRX_UART SERIAL_PORT_USART2
129 // *************** ADC ***************************
130 #define USE_ADC
131 #define ADC_INSTANCE ADC1
132 #define ADC1_DMA_STREAM DMA2_Stream0
133 #define ADC_CHANNEL_1_PIN PC3
134 #define ADC_CHANNEL_2_PIN PC2
135 #define ADC_CHANNEL_3_PIN PC0
136 #define VBAT_ADC_CHANNEL ADC_CHN_1
137 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
138 #define RSSI_ADC_CHANNEL ADC_CHN_3
140 // *************** LED2812 ************************
141 #define USE_LED_STRIP
142 #define WS2811_PIN PA9
144 // *************** OTHERS *************************
145 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
146 #define CURRENT_METER_SCALE 250
148 #define USE_DSHOT
149 #define USE_ESC_SENSOR
151 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
153 #define TARGET_IO_PORTA 0xffff
154 #define TARGET_IO_PORTB 0xffff
155 #define TARGET_IO_PORTC 0xffff
156 #define TARGET_IO_PORTD 0xffff
158 #define MAX_PWM_OUTPUT_PORTS 8