vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / KAKUTEF4WING / target.h
blob70eb125646a5df07bd96a9f939ab65e508e6e28c
1 /*
2 * This file is part of INAV.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
25 #pragma once
27 #define TARGET_BOARD_IDENTIFIER "F4WI"
28 #define USBD_PRODUCT_STRING "KakuteF4Wing"
30 #define USE_TARGET_CONFIG
32 // ******* Status LED*****************
33 #define LED0 PC5
35 // ******* Internal IMU ICM42688******
36 #define USE_IMU_ICM42605
37 #define IMU_ICM42605_ALIGN CW270_DEG
38 #define ICM42605_SPI_BUS BUS_SPI1
39 #define ICM42605_CS_PIN PA4
40 #define ICM42605_EXTI_PIN PB12
42 // *************** I2C ****************
43 #define USE_I2C
44 #define USE_I2C_DEVICE_2
45 #define I2C2_SCL PB10
46 #define I2C2_SDA PB11
48 // ********** External MAG On I2C2******
49 #define USE_MAG
50 #define MAG_I2C_BUS BUS_I2C2
51 #define USE_MAG_ALL
53 // ********** External Devices On I2C2******
54 #define TEMPERATURE_I2C_BUS BUS_I2C2
55 #define PITOT_I2C_BUS BUS_I2C2
56 #define USE_RANGEFINDER
57 #define RANGEFINDER_I2C_BUS BUS_I2C2
59 // ********** Internal BARO On I2C2*********
60 #define USE_BARO
61 #define BARO_I2C_BUS BUS_I2C2
62 #define USE_BARO_BMP280
63 #define USE_BARO_DPS310
64 #define USE_BARO_SPL06
66 // *************** AT7456 OSD ***************
67 #define USE_MAX7456
68 #define MAX7456_SPI_BUS BUS_SPI2
69 #define MAX7456_CS_PIN PC15
71 // *************** SPI FLASH BLACKBOX*********
72 #define USE_FLASHFS
73 #define USE_FLASH_M25P16
74 #define M25P16_CS_PIN PC14
75 #define M25P16_SPI_BUS BUS_SPI3
76 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
78 // *************** USB VCP ********************
79 #define USB_IO
80 #define USE_VCP
81 #define VBUS_SENSING_PIN PA10
82 #define VBUS_SENSING_ENABLED
84 // *************** UART ********************
85 #define USE_UART_INVERTER
86 //UART1
87 #define USE_UART1
88 #define UART1_RX_PIN PB7
89 #define UART1_TX_PIN PB6
91 //UART2
92 #define USE_UART2
93 #define UART2_RX_PIN PA3
94 #define UART2_TX_PIN PA2
96 //The 4V5 pads close to UART3 are powered by both BEC and USB
97 //Config UART3 to serialRX, So Receiver is powered when USB Plug-IN.
98 //UART3: SerialRX by Default
99 #define USE_UART3
100 #define UART3_RX_PIN PC11
101 #define UART3_TX_PIN PC10
102 #define INVERTER_PIN_UART3_RX PC13
104 //UART5
105 #define USE_UART5
106 #define UART5_RX_PIN PD2
107 #define UART5_TX_PIN PC12
109 //UART6
110 #define USE_UART6
111 #define UART6_RX_PIN PC7
112 #define UART6_TX_PIN PC6
114 // # define USE_SOFTSERIAL1
115 # define SERIAL_PORT_COUNT 6
117 // *************** SPI ********************
118 #define USE_SPI
119 // SPI1: Connected to ICM gyro
120 #define USE_SPI_DEVICE_1
121 #define SPI1_NSS_PIN PA4
122 #define SPI1_SCK_PIN PA5
123 #define SPI1_MISO_PIN PA6
124 #define SPI1_MOSI_PIN PA7
126 // SPI2: Connected to OSD
127 #define USE_SPI_DEVICE_2
128 #define SPI2_NSS_PIN PC15
129 #define SPI2_SCK_PIN PB13
130 #define SPI2_MISO_PIN PC2
131 #define SPI2_MOSI_PIN PC3
133 // SPI3: Connected to flash memory
134 #define USE_SPI_DEVICE_3
135 #define SPI3_NSS_PIN PC14
136 #define SPI3_SCK_PIN PB3
137 #define SPI3_MISO_PIN PB4
138 #define SPI3_MOSI_PIN PB5
140 // *************** Battery Voltage Sense***********
141 #define USE_ADC
142 #define ADC_INSTANCE ADC1
143 #define ADC1_DMA_STREAM DMA2_Stream0
144 #define ADC_CHANNEL_1_PIN PC0
145 #define ADC_CHANNEL_2_PIN PC1
146 #define VBAT_ADC_CHANNEL ADC_CHN_1
147 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
148 #define CURRENT_METER_SCALE 250 // Current_Meter 1V=40A
149 #define VBAT_SCALE_DEFAULT 1100 // VBAT_ADC 1V=11V
151 // *************** LED_STRIP **********************
152 #define USE_LED_STRIP
153 #define WS2811_PIN PA1
154 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST6_HANDLER
155 #define WS2811_DMA_STREAM DMA1_Stream6
156 #define WS2811_DMA_CHANNEL DMA_Channel_3
158 // *************** PINIO ***************************
159 #define USE_PINIO
160 #define USE_PINIOBOX
161 #define PINIO1_PIN PB14 // USER1
162 #define PINIO2_PIN PB15 // USER2
164 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_GPS)
166 // ***********Set rx type and procotol***************
167 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
168 #define SERIALRX_PROVIDER SERIALRX_SBUS
169 #define SERIALRX_UART SERIAL_PORT_USART3
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 USE_DSHOT
179 #define USE_ESC_SENSOR
181 #define MAX_PWM_OUTPUT_PORTS 6