2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
22 #if defined(KAKUTEF4V2)
23 #define TARGET_BOARD_IDENTIFIER "KTV2"
24 #define USBD_PRODUCT_STRING "KakuteF4-V2"
26 #define TARGET_BOARD_IDENTIFIER "KTV1"
27 #define USBD_PRODUCT_STRING "KakuteF4-V1"
30 #define USE_TARGET_CONFIG
37 #define BEEPER_PIN PC9
38 #define BEEPER_INVERTED
39 #define INVERTER_PIN_UART3 PB15
43 #define MPU_INT_EXTI PC5
44 //#define DEBUG_MPU_DATA_READY_INTERRUPT
45 #define USE_MPU_DATA_READY_SIGNAL
46 #define ENSURE_MPU_DATA_READY_IS_LOW
48 #define ICM20689_CS_PIN PC4
49 #define ICM20689_SPI_INSTANCE SPI1
52 #define USE_ACC_SPI_ICM20689
53 #define ACC_ICM20689_ALIGN CW270_DEG
56 #define USE_GYRO_SPI_ICM20689
57 #define GYRO_ICM20689_ALIGN CW270_DEG
59 #ifdef KAKUTEF4V2 // There is invertor on RXD3(PB11), so PB10/PB11 can't be used as I2C2.
60 #define USE_I2C //No other I2C pins are fanned out, So V1 don't support I2C peripherals.
61 #define USE_I2C_DEVICE_1
62 #define I2C_DEVICE (I2CDEV_1)
63 #define I2C1_SCL PB8 // SCL pad
64 #define I2C1_SDA PB9 // SDA pad
65 #define BARO_I2C_INSTANCE I2C_DEVICE
66 #define MAG_I2C_INSTANCE I2C_DEVICE
69 #define USE_MAG_HMC5883 //External, connect to I2C1
70 #define USE_MAG_QMC5883
71 #define MAG_HMC5883_ALIGN CW180_DEG
74 #define USE_BARO_MS5611 //External, connect to I2C1
75 #define USE_BARO_BMP280 //onboard
79 #define MAX7456_SPI_INSTANCE SPI3
80 #define MAX7456_SPI_CS_PIN PB14
81 #define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD)
82 #define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
84 #define M25P16_CS_PIN PB3
85 #define M25P16_SPI_INSTANCE SPI3
88 #define USE_FLASH_M25P16
91 #define USB_DETECT_PIN PA8
92 #define USE_USB_DETECT
95 #define UART1_RX_PIN PA10
96 #define UART1_TX_PIN PA9
97 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
100 #define UART3_RX_PIN PB11
101 #define UART3_TX_PIN PB10
104 #define UART6_RX_PIN PC7
105 #define UART6_TX_PIN PC6
107 #ifdef KAKUTEF4V2 // Uart4 and Uart5 are fanned out on v2
108 #define USE_UART4 // Uart4 can be used for GPS or RunCam Split
109 #define UART4_RX_PIN PA1
110 #define UART4_TX_PIN PA0
112 #define USE_UART5 //Uart5 can be used for ESC sensor
113 #define UART5_RX_PIN PD2
114 #define UART5_TX_PIN NONE
116 #define USE_SOFTSERIAL1 //M1~M4 and LedTrip can be redefined as Softserial
117 #define SERIAL_PORT_COUNT 7 //vcp, uart1, uart3, uart4, uart5, uart6, softSerial1
119 #define USE_SOFTSERIAL1
120 #define USE_SOFTSERIAL2
121 #define SERIAL_PORT_COUNT 6 //vcp, uart1, uart3,, uart6, softSerial1, softSerial2
124 #define USE_ESCSERIAL
125 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
129 #define USE_SPI_DEVICE_1 //ICM20689
130 #define SPI1_NSS_PIN PC4
131 #define SPI1_SCK_PIN PA5
132 #define SPI1_MISO_PIN PA6
133 #define SPI1_MOSI_PIN PA7
135 #define USE_SPI_DEVICE_3 //dataflash
136 #define SPI3_NSS_PIN PB3
137 #define SPI3_SCK_PIN PC10
138 #define SPI3_MISO_PIN PC11
139 #define SPI3_MOSI_PIN PC12
141 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
143 #define ADC1_DMA_STREAM DMA2_Stream0
144 #define VBAT_ADC_PIN PC3
145 #define CURRENT_METER_ADC_PIN PC2
146 #define RSSI_ADC_PIN PC1
148 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD )
149 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
150 #define SERIALRX_PROVIDER SERIALRX_SBUS
151 #define SERIALRX_UART SERIAL_PORT_USART3
153 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
155 #define TARGET_IO_PORTA 0xffff
156 #define TARGET_IO_PORTB 0xffff
157 #define TARGET_IO_PORTC 0xffff
158 #define TARGET_IO_PORTD (BIT(2))
161 #define USABLE_TIMER_CHANNEL_COUNT 6
162 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(8))
164 #define USABLE_TIMER_CHANNEL_COUNT 8
165 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8))