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/.
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"
36 # define TARGET_BOARD_IDENTIFIER "KTV1"
37 # define USBD_PRODUCT_STRING "KakuteF4-V1"
43 #if defined(KAKUTEF4) || defined(KAKUTEF4V2)
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)
67 # define USE_I2C_DEVICE_1
68 # define I2C1_SCL PB8 // SCL pad
69 # define I2C1_SDA PB9 // SDA pad
72 # define MAG_I2C_BUS BUS_I2C1
75 # define TEMPERATURE_I2C_BUS BUS_I2C1
78 # define BARO_I2C_BUS BUS_I2C1
79 # define USE_BARO_MS5611
80 # define USE_BARO_BMP280
81 #else // V1 does not have I2C exposed, common_post.h will pull in USE_*_MSP
87 #define MAX7456_SPI_BUS BUS_SPI3
88 #define MAX7456_CS_PIN PB14
92 #define USE_FLASH_M25P16
93 #define M25P16_CS_PIN PB3
94 #define M25P16_SPI_BUS BUS_SPI3
95 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
99 #define VBUS_SENSING_PIN PA8
100 #define VBUS_SENSING_ENABLED
102 #define USE_UART_INVERTER
105 #define UART1_RX_PIN PA10
106 #define UART1_TX_PIN PA9
109 #define UART3_RX_PIN PB11
110 #define UART3_TX_PIN PB10
111 #define INVERTER_PIN_UART3_RX PB15
114 #define UART6_RX_PIN PC7
115 #define UART6_TX_PIN PC6
117 #if defined(KAKUTEF4V2) || defined(KAKUTEF4V23) || defined(KAKUTEF4V24)
119 # define UART4_RX_PIN PA1
120 # define UART4_TX_PIN PA0
123 # define UART5_RX_PIN PD2
124 # define UART5_TX_PIN NONE
126 // # define USE_SOFTSERIAL1
127 # define SERIAL_PORT_COUNT 6
129 // # define USE_SOFTSERIAL1
130 // # define USE_SOFTSERIAL2
131 # define SERIAL_PORT_COUNT 4
136 // SPI1: Connected to ICM gyro
137 #define USE_SPI_DEVICE_1
138 #define SPI1_NSS_PIN PC4
139 #define SPI1_SCK_PIN PA5
140 #define SPI1_MISO_PIN PA6
141 #define SPI1_MOSI_PIN PA7
143 // SPI3: Connected to flash memory
144 #define USE_SPI_DEVICE_3
145 #define SPI3_NSS_PIN PB3
146 #define SPI3_SCK_PIN PC10
147 #define SPI3_MISO_PIN PC11
148 #define SPI3_MOSI_PIN PC12
151 #define ADC_CHANNEL_1_PIN PC3
152 #define ADC_CHANNEL_2_PIN PC2
153 #define ADC_CHANNEL_3_PIN PC1
155 #define USE_LED_STRIP
156 #define WS2811_PIN PC8
157 #define WS2811_DMA_HANDLER_IDENTIFER DMA2_ST4_HANDLER
158 #define WS2811_DMA_STREAM DMA2_Stream4
159 #define WS2811_DMA_CHANNEL DMA_Channel_7
161 #define VBAT_ADC_CHANNEL ADC_CHN_1
162 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
163 #define RSSI_ADC_CHANNEL ADC_CHN_3
165 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_BLACKBOX)
166 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
167 #define SERIALRX_PROVIDER SERIALRX_SBUS
168 #define SERIALRX_UART SERIAL_PORT_USART3
169 #define TELEMETRY_UART SERIAL_PORT_USART1
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))
179 #define USE_ESC_SENSOR
182 # define MAX_PWM_OUTPUT_PORTS 4
184 # define MAX_PWM_OUTPUT_PORTS 6