vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / HAKRCF722V2 / target.h
blob52c07b6545ae99894ff3d0f89b259568e1d22a8c
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 "HK7V2"
21 #define USBD_PRODUCT_STRING "HAKRCF722V2"
23 #define USE_TARGET_CONFIG
25 /*** Indicators ***/
26 #define LED0 PC14
27 #define LED1 PC15
29 #define BEEPER PC13
30 #define BEEPER_INVERTED
32 // *** SPI & I2C ***
33 #define USE_SPI
35 #define USE_SPI_DEVICE_1
36 #define SPI1_NSS1_PIN PA4
37 #define SPI1_NSS2_PIN PB2
38 #define SPI1_SCK_PIN PA5
39 #define SPI1_MISO_PIN PA6
40 #define SPI1_MOSI_PIN PA7
42 #define USE_SPI_DEVICE_2
43 #define SPI2_NSS_PIN PB12
44 #define SPI2_SCK_PIN PB13
45 #define SPI2_MISO_PIN PB14
46 #define SPI2_MOSI_PIN PB15
48 #define USE_SPI_DEVICE_3
49 #define SPI3_NSS_PIN PA15
50 #define SPI3_SCK_PIN PC10
51 #define SPI3_MISO_PIN PC11
52 #define SPI3_MOSI_PIN PB5
54 #define USE_I2C
55 #define USE_I2C_DEVICE_1
56 #define I2C1_SCL PB8
57 #define I2C1_SDA PB9
59 // *** IMU sensors ***
61 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
62 #define USE_DUAL_GYRO
64 #define GYRO_SPI_BUS BUS_SPI1
65 #define GYRO1_CS_PIN SPI1_NSS1_PIN
66 #define GYRO2_CS_PIN SPI1_NSS2_PIN
68 // MPU6000
69 #define USE_IMU_MPU6000
70 #define IMU_MPU6000_ALIGN CW90_DEG
72 // ICM42605/ICM42688P
73 #define USE_IMU_ICM42605
74 #define IMU_ICM42605_ALIGN CW90_DEG
76 //BMI270
77 #define USE_IMU_BMI270
78 #define IMU_BMI270_ALIGN CW90_DEG
80 // *** SPI2 OSD ***
81 #define USE_MAX7456
82 #define MAX7456_SPI_BUS BUS_SPI2
83 #define MAX7456_CS_PIN SPI2_NSS_PIN
85 // *** SPI3 FLASH ***
86 #define USE_FLASHFS
87 #define USE_FLASH_M25P16
88 #define M25P16_CS_PIN SPI3_NSS_PIN
89 #define M25P16_SPI_BUS BUS_SPI3
90 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
91 // *** UART ***
92 #define USE_VCP
94 #define USE_UART1
95 #define USE_UART2
96 #define USE_UART3
97 #define USE_UART4
98 #define USE_UART5
99 #define USE_UART6
101 #define UART1_TX_PIN PB6
102 #define UART1_RX_PIN PB7
104 #define UART2_TX_PIN PA2
105 #define UART2_RX_PIN PA3
107 #define UART3_TX_PIN NONE
108 #define UART3_RX_PIN PB11
110 #define UART4_TX_PIN PA0
111 #define UART4_RX_PIN PA1
113 #define UART5_TX_PIN PC12
114 #define UART5_RX_PIN PD2
116 #define UART6_TX_PIN PC6
117 #define UART6_RX_PIN PC7
119 #define SERIAL_PORT_COUNT 7
122 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
123 #define SERIALRX_PROVIDER SERIALRX_SBUS
124 #define SERIALRX_UART SERIAL_PORT_USART2
126 // *** I2C/Baro/Mag/Pitot ***
127 #define DEFAULT_I2C_BUS BUS_I2C1
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 TEMPERATURE_I2C_BUS BUS_I2C1
136 #define BNO055_I2C_BUS BUS_I2C1
138 #define USE_MAG
139 #define MAG_I2C_BUS BUS_I2C1
140 #define USE_MAG_ALL
142 #define PITOT_I2C_BUS BUS_I2C1
144 // *** PINIO ***
145 #define USE_PINIO
146 #define USE_PINIOBOX
147 #define PINIO1_PIN PC0
148 #define PINIO2_PIN PC2
150 // *** ADC ***
151 #define USE_ADC
152 //#define ADC_INSTANCE ADC3
153 //#define ADC1_DMA_STREAM DMA2_Stream0
154 #define ADC_CHANNEL_1_PIN PC1
155 #define ADC_CHANNEL_2_PIN PC3
156 #define VBAT_ADC_CHANNEL ADC_CHN_1
157 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
160 // *** LED2812 ***
161 #define USE_LED_STRIP
162 #define WS2811_PIN PB3
164 // *** OTHERS ***
165 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
168 #define USE_DSHOT
169 #define USE_ESC_SENSOR
171 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
173 #define TARGET_IO_PORTA 0xffff
174 #define TARGET_IO_PORTB 0xffff
175 #define TARGET_IO_PORTC 0xffff
176 #define TARGET_IO_PORTD (BIT(2))
178 #define MAX_PWM_OUTPUT_PORTS 8