Merge pull request #10558 from iNavFlight/MrD_Correct-comments-on-OSD-symbols
[inav.git] / src / main / target / KAKUTEF4 / target.h
blob92cbcf1341440b1822f9020ab9e896b85970efa2
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
26 #if defined(KAKUTEF4V2)
27 # define TARGET_BOARD_IDENTIFIER "KTV2"
28 # define USBD_PRODUCT_STRING "KakuteF4-V2"
29 #elif defined(KAKUTEF4V23)
30 # define TARGET_BOARD_IDENTIFIER "KT23"
31 # define USBD_PRODUCT_STRING "KakuteF4-V2.3"
32 #elif defined(KAKUTEF4V24)
33 # define TARGET_BOARD_IDENTIFIER "KT24"
34 # define USBD_PRODUCT_STRING "KakuteF4-V2.4"
35 #else
36 # define TARGET_BOARD_IDENTIFIER "KTV1"
37 # define USBD_PRODUCT_STRING "KakuteF4-V1"
38 #endif
40 #define LED0 PB5
41 #define LED1 PB4
43 #if defined(KAKUTEF4) || defined(KAKUTEF4V2)
44 # define LED2 PB6
45 #endif
47 #define BEEPER PC9
48 #define BEEPER_INVERTED
50 #define USE_IMU_MPU6500
51 #define IMU_MPU6500_ALIGN CW270_DEG
52 #define MPU6500_CS_PIN PC4
53 #define MPU6500_SPI_BUS BUS_SPI1
55 #define USE_IMU_MPU6000
56 #define IMU_MPU6000_ALIGN CW270_DEG
57 #define MPU6000_CS_PIN PC4
58 #define MPU6000_SPI_BUS BUS_SPI1
60 #define USE_IMU_ICM42605
61 #define IMU_ICM42605_ALIGN CW270_DEG
62 #define ICM42605_CS_PIN PC4
63 #define ICM42605_SPI_BUS BUS_SPI1
65 #if defined(KAKUTEF4V2) || defined(KAKUTEF4V23) || defined(KAKUTEF4V24)
66 # define USE_I2C
67 # define USE_I2C_DEVICE_1
68 # define I2C1_SCL PB8 // SCL pad
69 # define I2C1_SDA PB9 // SDA pad
71 # define USE_MAG
72 # define MAG_I2C_BUS BUS_I2C1
73 # define USE_MAG_ALL
75 # define TEMPERATURE_I2C_BUS BUS_I2C1
77 # define USE_BARO
78 # define BARO_I2C_BUS BUS_I2C1
79 # define USE_BARO_MS5611
80 # define USE_BARO_BMP280
81 # define USE_BARO_DPS310
82 # define USE_BARO_SPL06
83 #else // V1 does not have I2C exposed, common_post.h will pull in USE_*_MSP
84 # define USE_BARO
85 # define USE_MAG
86 #endif
88 #define USE_MAX7456
89 #define MAX7456_SPI_BUS BUS_SPI3
90 #define MAX7456_CS_PIN PB14
92 #define USE_FLASHFS
94 #define USE_FLASH_M25P16
95 #define M25P16_CS_PIN PB3
96 #define M25P16_SPI_BUS BUS_SPI3
97 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
99 #define USB_IO
100 #define USE_VCP
101 #define VBUS_SENSING_PIN PA8
102 #define VBUS_SENSING_ENABLED
104 #define USE_UART_INVERTER
106 #define USE_UART1
107 #define UART1_RX_PIN PA10
108 #define UART1_TX_PIN PA9
110 #define USE_UART3
111 #define UART3_RX_PIN PB11
112 #define UART3_TX_PIN PB10
113 #define INVERTER_PIN_UART3_RX PB15
115 #define USE_UART6
116 #define UART6_RX_PIN PC7
117 #define UART6_TX_PIN PC6
119 #if defined(KAKUTEF4V2) || defined(KAKUTEF4V23) || defined(KAKUTEF4V24)
120 # define USE_UART4
121 # define UART4_RX_PIN PA1
122 # define UART4_TX_PIN PA0
124 # define USE_UART5
125 # define UART5_RX_PIN PD2
126 # define UART5_TX_PIN NONE
128 // # define USE_SOFTSERIAL1
129 # define SERIAL_PORT_COUNT 6
130 #else
131 // # define USE_SOFTSERIAL1
132 // # define USE_SOFTSERIAL2
133 # define SERIAL_PORT_COUNT 4
134 #endif
136 #define USE_SPI
138 // SPI1: Connected to ICM gyro
139 #define USE_SPI_DEVICE_1
140 #define SPI1_NSS_PIN PC4
141 #define SPI1_SCK_PIN PA5
142 #define SPI1_MISO_PIN PA6
143 #define SPI1_MOSI_PIN PA7
145 // SPI3: Connected to flash memory
146 #define USE_SPI_DEVICE_3
147 #define SPI3_NSS_PIN PB3
148 #define SPI3_SCK_PIN PC10
149 #define SPI3_MISO_PIN PC11
150 #define SPI3_MOSI_PIN PC12
152 #define USE_ADC
153 #define ADC_CHANNEL_1_PIN PC3
154 #define ADC_CHANNEL_2_PIN PC2
155 #define ADC_CHANNEL_3_PIN PC1
157 #define USE_LED_STRIP
158 #define WS2811_PIN PC8
159 #define WS2811_DMA_HANDLER_IDENTIFER DMA2_ST4_HANDLER
160 #define WS2811_DMA_STREAM DMA2_Stream4
161 #define WS2811_DMA_CHANNEL DMA_Channel_7
163 #define VBAT_ADC_CHANNEL ADC_CHN_1
164 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
165 #define RSSI_ADC_CHANNEL ADC_CHN_3
167 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_BLACKBOX)
168 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
169 #define SERIALRX_PROVIDER SERIALRX_SBUS
170 #define SERIALRX_UART SERIAL_PORT_USART3
171 #define TELEMETRY_UART SERIAL_PORT_USART1
173 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
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))
180 #define USE_DSHOT
181 #define USE_ESC_SENSOR
183 #ifdef KAKUTEF4V2
184 # define MAX_PWM_OUTPUT_PORTS 4
185 #else
186 # define MAX_PWM_OUTPUT_PORTS 6
187 #endif