vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / HAKRCF405V2 / target.h
blob85cc164230b201101a7ea0fe441bdeb275fc273e
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 "HK4V2"
21 #define USBD_PRODUCT_STRING "HAKRCF405V2"
23 #define USE_TARGET_CONFIG
25 /*** Indicators ***/
26 #define LED0 PC15
27 #define LED1 PC14
28 #define BEEPER PC13
29 #define BEEPER_INVERTED
31 /*** SPI/I2C bus ***/
32 #define USE_SPI
33 #define USE_SPI_DEVICE_1
34 #define SPI1_NSS_PIN PA4
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 PB12
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 PA15
47 #define SPI3_SCK_PIN PC10
48 #define SPI3_MISO_PIN PC11
49 #define SPI3_MOSI_PIN PB5
51 #define USE_I2C
52 #define USE_I2C_DEVICE_1
53 #define I2C1_SCL PB8
54 #define I2C1_SDA PB9
57 /*** IMU sensors ***/
59 // MPU6000
60 #define USE_IMU_MPU6000
61 #define IMU_MPU6000_ALIGN CW90_DEG
62 #define MPU6000_SPI_BUS BUS_SPI1
63 #define MPU6000_CS_PIN SPI1_NSS_PIN
66 // ICM42605/ICM42688P
67 #define USE_IMU_ICM42605
68 #define IMU_ICM42605_ALIGN CW90_DEG
69 #define ICM42605_SPI_BUS BUS_SPI1
70 #define ICM42605_CS_PIN SPI1_NSS_PIN
72 //BMI270
73 #define USE_IMU_BMI270
74 #define IMU_BMI270_ALIGN CW90_DEG
75 #define BMI270_SPI_BUS BUS_SPI1
76 #define BMI270_CS_PIN SPI1_NSS_PIN
79 /*** OSD ***/
80 #define USE_MAX7456
81 #define MAX7456_SPI_BUS BUS_SPI2
82 #define MAX7456_CS_PIN SPI2_NSS_PIN
84 /*** Onboard flash ***/
85 #define USE_FLASHFS
86 #define USE_FLASH_M25P16
87 #define M25P16_CS_PIN SPI3_NSS_PIN
88 #define M25P16_SPI_BUS BUS_SPI3
90 // *** PINIO ***
92 #define USE_PINIO
93 #define USE_PINIOBOX
94 #define PINIO1_PIN PC2
95 #define PINIO2_PIN PC5
97 /*** Serial ports ***/
98 #define USE_VCP
99 #define USE_UART_INVERTER
101 #define USE_UART1
102 #define UART1_RX_PIN PB7
103 #define UART1_TX_PIN PB6
105 #define USE_UART2
106 #define UART2_RX_PIN PA3
107 #define UART2_TX_PIN PA2
108 #define INVERTER_PIN_UART2_RX PC0
110 #define USE_UART3
111 #define UART3_RX_PIN PB11
112 #define UART3_TX_PIN PB10
114 #define USE_UART4
115 #define UART4_RX_PIN PA1
116 #define UART4_TX_PIN PA0
118 #define USE_UART5
119 #define UART5_RX_PIN PD2
120 #define UART5_TX_PIN PC12
122 #define USE_UART6
123 #define UART6_RX_PIN PC7
124 #define UART6_TX_PIN PC6
126 #define SERIAL_PORT_COUNT 7
128 /*** BARO & MAG ***/
129 #define USE_BARO
130 #define BARO_I2C_BUS BUS_I2C1
131 #define USE_BARO_BMP280
132 #define USE_BARO_SPL06
133 #define USE_BARO_DPS310
135 #define USE_MAG
136 #define MAG_I2C_BUS BUS_I2C1
137 #define USE_MAG_ALL
139 /*** ADC ***/
140 #define USE_ADC
141 #define ADC_CHANNEL_1_PIN PC1
142 #define ADC_CHANNEL_2_PIN PC3
145 #define VBAT_ADC_CHANNEL ADC_CHN_1
146 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
149 /*** LED STRIP ***/
150 #define USE_LED_STRIP
151 #define WS2811_PIN PB3
153 /*** Default settings ***/
154 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
155 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
156 #define SERIALRX_PROVIDER SERIALRX_SBUS
157 #define CURRENT_METER_SCALE 250
160 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
162 /*** Timer/PWM output ***/
163 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
164 #define MAX_PWM_OUTPUT_PORTS 8
165 #define USE_DSHOT
166 #define USE_ESC_SENSOR
168 // ********** Optical Flow and Lidar **************
169 #define USE_RANGEFINDER
170 #define USE_RANGEFINDER_MSP
171 #define USE_OPFLOW
172 #define USE_OPFLOW_MSP
174 /*** Used pins ***/
175 #define TARGET_IO_PORTA 0xffff
176 #define TARGET_IO_PORTB 0xffff
177 #define TARGET_IO_PORTC 0xffff
178 #define TARGET_IO_PORTD (BIT(2))