Merge pull request #10592 from iNavFlight/MrD_Update-parameter-description
[inav.git] / src / main / target / HAKRCF405D / target.h
blobd47ec61dc9949acd35de506a1333fe8a5c47c27a
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 "H40D"
21 #define USBD_PRODUCT_STRING "HAKRCF405D"
23 #define USE_TARGET_CONFIG
25 /*** Indicators ***/
26 #define LED0 PB9
27 #define LED1 PA14
28 #define BEEPER PC13
29 #define BEEPER_INVERTED
31 /*** SPI & I2C ***/
32 #define USE_SPI
33 #define USE_SPI_DEVICE_1
34 #define SPI1_NSS_PIN PC2
35 #define SPI1_SCK_PIN PA5
36 #define SPI1_MISO_PIN PA6
37 #define SPI1_MOSI_PIN PA7
39 #define USE_SPI_DEVICE_2
40 #define SPI2_NSS_PIN PB10
41 #define SPI2_SCK_PIN PB13
42 #define SPI2_MISO_PIN PB14
43 #define SPI2_MOSI_PIN PB15
45 #define USE_SPI_DEVICE_3
46 #define SPI3_NSS_PIN PC0
47 #define SPI3_SCK_PIN PB3
48 #define SPI3_MISO_PIN PB4
49 #define SPI3_MOSI_PIN PB5
51 #define USE_I2C
52 #define USE_I2C_DEVICE_1
53 #define I2C1_SCL PB6
54 #define I2C1_SDA PB7
56 /*** IMU sensors ***/
57 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
59 // MPU6000
60 #define USE_IMU_MPU6000
61 #define IMU_MPU6000_ALIGN CW270_DEG
62 #define MPU6000_SPI_BUS BUS_SPI1
63 #define MPU6000_CS_PIN SPI1_NSS_PIN
65 // ICM42605/ICM42688P
66 #define USE_IMU_ICM42605
67 #define IMU_ICM42605_ALIGN CW270_DEG
68 #define ICM42605_SPI_BUS BUS_SPI1
69 #define ICM42605_CS_PIN SPI1_NSS_PIN
71 //BMI270
72 #define USE_IMU_BMI270
73 #define IMU_BMI270_ALIGN CW270_DEG
74 #define BMI270_SPI_BUS BUS_SPI1
75 #define BMI270_CS_PIN SPI1_NSS_PIN
77 /*** OSD ***/
78 #define USE_MAX7456
79 #define MAX7456_SPI_BUS BUS_SPI2
80 #define MAX7456_CS_PIN SPI2_NSS_PIN
82 /*** Onboard flash ***/
83 #define USE_FLASHFS
84 #define USE_FLASH_M25P16
85 #define M25P16_CS_PIN SPI3_NSS_PIN
86 #define M25P16_SPI_BUS BUS_SPI3
88 /*** PINIO ***/
89 #define USE_PINIO
90 #define USE_PINIOBOX
91 #define PINIO1_PIN PC14
92 #define PINIO2_PIN PC15
94 /*** Serial ports ***/
95 #define USE_VCP
96 #define USB_DETECT_PIN PB12
97 #define USE_USB_DETECT
99 #define USE_UART1
100 #define UART1_RX_PIN PA10
101 #define UART1_TX_PIN PA9
103 #define USE_UART2
104 #define UART2_RX_PIN PA3
105 #define UART2_TX_PIN PA2
107 #define USE_UART3
108 #define UART3_RX_PIN PC11
109 #define UART3_TX_PIN PC10
111 #define USE_UART4
112 #define UART4_RX_PIN PA1
113 #define UART4_TX_PIN PA0
115 #define USE_UART5
116 #define UART5_RX_PIN PD2
117 #define UART5_TX_PIN PC12
119 #define SERIAL_PORT_COUNT 6
121 /*** BARO & MAG ***/
122 #define USE_BARO
123 #define BARO_I2C_BUS BUS_I2C1
124 #define USE_BARO_BMP280
125 #define USE_BARO_SPL06
126 #define USE_BARO_DPS310
128 #define USE_MAG
129 #define MAG_I2C_BUS BUS_I2C1
130 #define USE_MAG_ALL
132 /*** ADC ***/
133 #define USE_ADC
134 #define ADC_CHANNEL_1_PIN PC5
135 #define ADC_CHANNEL_2_PIN PB1
136 #define ADC_CHANNEL_3_PIN PC4
138 #define VBAT_ADC_CHANNEL ADC_CHN_1
139 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
140 #define RSSI_METER_ADC_CHANNEL ADC_CHN_2
142 /*** LED STRIP ***/
143 #define USE_LED_STRIP
144 #define WS2811_PIN PB8
146 /*** Default settings ***/
147 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
148 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
149 #define SERIALRX_PROVIDER SERIALRX_SBUS
150 #define CURRENT_METER_SCALE 179
153 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
155 /*** Timer/PWM output ***/
156 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
157 #define MAX_PWM_OUTPUT_PORTS 6
158 #define USE_DSHOT
159 #define USE_ESC_SENSOR
161 /*** Optical Flow & Lidar ***/
162 #define USE_RANGEFINDER
163 #define USE_RANGEFINDER_MSP
164 #define USE_OPFLOW
165 #define USE_OPFLOW_MSP
167 /*** Misc ***/
168 #define TARGET_IO_PORTA 0xffff
169 #define TARGET_IO_PORTB 0xffff
170 #define TARGET_IO_PORTC 0xffff
171 #define TARGET_IO_PORTD (BIT(2))