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/>.
22 #define TARGET_BOARD_IDENTIFIER "KTH7"
23 #define USBD_PRODUCT_STRING "KAKUTEH7"
25 #define TARGET_BOARD_IDENTIFIER "KH7M"
26 #define USBD_PRODUCT_STRING "KAKUTEH7MINI"
30 #define USE_TARGET_CONFIG
35 #define BEEPER_INVERTED
37 // *************** IMU generic ***********************
42 // *************** SPI1 ****************
44 #define USE_SPI_DEVICE_1
45 #define SPI1_SCK_PIN PA5
46 #define SPI1_MISO_PIN PA6
47 #define SPI1_MOSI_PIN PA7
49 #if defined(KAKUTEH7MINI)
52 #define USE_FLASH_M25P16
53 #define M25P16_CS_PIN PA4
54 #define M25P16_SPI_BUS BUS_SPI1
56 #define USE_FLASH_W25N01G
57 #define W25N01G_SPI_BUS BUS_SPI1
58 #define W25N01G_CS_PIN PA4
60 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
62 #elif defined(KAKUTEH7V2)
65 #define USE_FLASH_W25N01G
66 #define W25N01G_SPI_BUS BUS_SPI1
67 #define W25N01G_CS_PIN PA4
69 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
76 #define USE_SDCARD_SPI
77 #define SDCARD_SPI_BUS BUS_SPI1
78 #define SDCARD_CS_PIN PA4
79 #define SDCARD_DETECT_INVERTED
80 #define SDCARD_DETECT_PIN PA3
82 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
87 // *************** SPI2 ***********************
88 #define USE_SPI_DEVICE_2
89 #define SPI2_SCK_PIN PB13
90 #define SPI2_MISO_PIN PB14
91 #define SPI2_MOSI_PIN PB15
93 // *************** SPI4 ***************
94 #define USE_SPI_DEVICE_4
95 #define SPI4_SCK_PIN PE2
96 #define SPI4_MISO_PIN PE5
97 #define SPI4_MOSI_PIN PE6
100 #define USE_IMU_MPU6000
101 #define IMU_MPU6000_ALIGN CW270_DEG
102 #define MPU6000_SPI_BUS BUS_SPI4
103 #define MPU6000_CS_PIN PE4
106 #define USE_IMU_BMI270
107 #define BMI270_SPI_BUS BUS_SPI4
108 #define BMI270_CS_PIN PE4
111 #define IMU_BMI270_ALIGN CW270_DEG
113 #define IMU_BMI270_ALIGN CW0_DEG
116 #define USE_IMU_ICM42605
117 #define IMU_ICM42605_ALIGN CW270_DEG
118 #define ICM42605_CS_PIN PE4
119 #define ICM42605_SPI_BUS BUS_SPI4
122 #define MAX7456_SPI_BUS BUS_SPI2
123 #define MAX7456_CS_PIN PB12
125 // *************** I2C /Baro/Mag *********************
127 #define USE_I2C_DEVICE_1
132 #define BARO_I2C_BUS BUS_I2C1
133 #define USE_BARO_BMP280
134 #define USE_BARO_MS5611
135 #define USE_BARO_DPS310
136 #define USE_BARO_SPL06
139 #define MAG_I2C_BUS BUS_I2C1
142 #define TEMPERATURE_I2C_BUS BUS_I2C1
143 #define PITOT_I2C_BUS BUS_I2C1
145 #define USE_RANGEFINDER
146 #define RANGEFINDER_I2C_BUS BUS_I2C1
148 // *************** UART *****************************
152 #define UART1_TX_PIN PA9
153 #define UART1_RX_PIN PA10
156 #define UART2_TX_PIN PD5
157 #define UART2_RX_PIN PD6
160 #define UART3_TX_PIN PD8
161 #define UART3_RX_PIN PD9
164 #define UART4_TX_PIN PD1
165 #define UART4_RX_PIN PD0
168 #define UART6_TX_PIN PC6
169 #define UART6_RX_PIN PC7
172 #define UART7_RX_PIN PE7
174 #define SERIAL_PORT_COUNT 7
176 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
177 #define SERIALRX_PROVIDER SERIALRX_SBUS
178 #define SERIALRX_UART SERIAL_PORT_USART1
180 // *************** ADC *****************************
182 #define ADC_INSTANCE ADC1
184 #define ADC_CHANNEL_1_PIN PC0
185 #define ADC_CHANNEL_2_PIN PC5
186 #define ADC_CHANNEL_3_PIN PC1
188 #define VBAT_ADC_CHANNEL ADC_CHN_1
189 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
190 #define RSSI_ADC_CHANNEL ADC_CHN_2
192 // *************** PINIO ***************************
197 #define PINIO1_PIN PB11
198 #define PINIO1_FLAGS PINIO_FLAGS_INVERTED
200 #elif defined(KAKUTEH7V2)
202 #define PINIO1_PIN PE13
203 #define PINIO2_PIN PB11
204 #define PINIO1_FLAGS PINIO_FLAGS_INVERTED
205 #define PINIO2_FLAGS PINIO_FLAGS_INVERTED
208 #define PINIO1_PIN PE13
211 // *************** LEDSTRIP ************************
212 #define USE_LED_STRIP
213 #define WS2811_PIN PD12
215 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
216 #define CURRENT_METER_SCALE 250
218 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
220 #define TARGET_IO_PORTA 0xffff
221 #define TARGET_IO_PORTB 0xffff
222 #define TARGET_IO_PORTC 0xffff
223 #define TARGET_IO_PORTD 0xffff
224 #define TARGET_IO_PORTE 0xffff
226 #define MAX_PWM_OUTPUT_PORTS 8
228 #define USE_ESC_SENSOR