Create release.yml
[betaflight.git] / src / main / target / KAKUTEF7 / target.h
blobad46b0453316534e64c75c7be0443601d7cf8bdd
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
23 #define USE_TARGET_CONFIG
25 #ifdef KAKUTEF7V2
26 #define TARGET_BOARD_IDENTIFIER "KT76"
27 #define USBD_PRODUCT_STRING "KakuteF7-V2"
28 #elif defined(KAKUTEF7MINI)
29 #define TARGET_BOARD_IDENTIFIER "KF7M"
30 #define USBD_PRODUCT_STRING "KakuteF7-Mini"
31 #else
32 #define TARGET_BOARD_IDENTIFIER "KTF7"
33 #define USBD_PRODUCT_STRING "KakuteF7"
34 #endif
36 #define LED0_PIN PA2
38 #define USE_BEEPER
39 #define BEEPER_PIN PD15
40 #define BEEPER_INVERTED
42 // XXX CAMERA_CONTROL_PIN is deprecated, so it was moved to PE13 entry in timerHardware[] array,
43 // XXX where it is shared with PPM.
44 // XXX Target maintainer must confirm intended operation under this change.
45 //define camera control
46 //#define CAMERA_CONTROL_PIN PE13
48 #define USE_ACC
49 #define USE_GYRO
50 #define USE_EXTI
52 // MPU6000
53 #define USE_ACC_SPI_MPU6000
54 #define USE_GYRO_SPI_MPU6000
56 // ICM-20689
57 #define USE_ACC_SPI_ICM20689
58 #define USE_GYRO_SPI_ICM20689
59 #define GYRO_1_CS_PIN SPI4_NSS_PIN
60 #define GYRO_1_SPI_INSTANCE SPI4
61 #define GYRO_1_ALIGN CW270_DEG
63 #define USE_GYRO_EXTI
64 #define GYRO_1_EXTI_PIN PE1
65 #define USE_MPU_DATA_READY_SIGNAL
67 #define USE_VCP
68 #define USE_USB_DETECT
69 #define USB_DETECT_PIN PA8
71 #define USE_UART1
72 #define UART1_TX_PIN PA9
73 #define UART1_RX_PIN PA10
75 #define USE_UART2
76 #define UART2_TX_PIN PD5
77 #define UART2_RX_PIN PD6
79 #define USE_UART3
80 #define UART3_TX_PIN PB10
81 #define UART3_RX_PIN PB11
83 #define USE_UART4
84 #define UART4_TX_PIN PA0
85 #define UART4_RX_PIN PA1
87 #define USE_UART6
88 #define UART6_TX_PIN PC6
89 #define UART6_RX_PIN PC7
91 #define USE_UART7
92 #define UART7_TX_PIN NONE
93 #define UART7_RX_PIN PE7
96 #define USE_SOFTSERIAL1
97 #define USE_SOFTSERIAL2
99 #define SERIAL_PORT_COUNT 9 //VCP,UART1,UART2,UART3,UAER4,UART6,UART7
101 #define USE_ESCSERIAL
102 #define ESCSERIAL_TIMER_TX_PIN PE13 // ( Hardware=0)
104 #define USE_SPI
105 #define USE_SPI_DEVICE_1 //SD Card
106 #define USE_SPI_DEVICE_2 //OSD
107 #define USE_SPI_DEVICE_4 //ICM20689
109 #define SPI1_NSS_PIN PA4
110 #define SPI1_SCK_PIN PA5
111 #define SPI1_MISO_PIN PA6
112 #define SPI1_MOSI_PIN PA7
114 #define SPI2_NSS_PIN PB12
115 #define SPI2_SCK_PIN PB13
116 #define SPI2_MISO_PIN PB14
117 #define SPI2_MOSI_PIN PB15
119 #define SPI4_NSS_PIN PE4
120 #define SPI4_SCK_PIN PE2
121 #define SPI4_MISO_PIN PE5
122 #define SPI4_MOSI_PIN PE6
124 #define USE_MAX7456
125 #define MAX7456_SPI_INSTANCE SPI2
126 #define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
128 #if defined(KAKUTEF7MINI)
129 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
130 #define USE_FLASHFS
131 #define USE_FLASH_M25P16
132 #define FLASH_CS_PIN SPI1_NSS_PIN
133 #define FLASH_SPI_INSTANCE SPI1
134 #else
135 #define USE_SDCARD
136 #define USE_SDCARD_SPI
137 #define SDCARD_DETECT_INVERTED
138 #define SDCARD_DETECT_PIN PD8
139 #define SDCARD_SPI_INSTANCE SPI1
140 #define SDCARD_SPI_CS_PIN SPI1_NSS_PIN
141 #define SPI1_TX_DMA_OPT 1 // DMA 2 Stream 5 Channel 3
143 #define SDCARD_DMA_STREAM_TX_FULL DMA2_Stream5
144 #endif
146 #define USE_I2C
147 #define USE_I2C_DEVICE_1
148 #define I2C_DEVICE (I2CDEV_1)
149 #define I2C1_SCL PB6
150 #define I2C1_SDA PB7
152 #define USE_BARO
153 #define USE_BARO_BMP280
154 #define BARO_I2C_INSTANCE I2C_DEVICE
156 #define USE_MAG
157 #define USE_MAG_HMC5883
158 #define USE_MAG_QMC5883
159 #define USE_MAG_LIS3MDL
160 #define MAG_I2C_INSTANCE I2C_DEVICE
162 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
163 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
165 #define USE_ADC
166 #define CURRENT_METER_ADC_PIN PC2
167 #define VBAT_ADC_PIN PC3
168 #define RSSI_ADC_PIN PC5
170 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
172 #define DEFAULT_FEATURES (FEATURE_OSD)
173 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
174 #define SERIALRX_UART SERIAL_PORT_USART6
175 #define SERIALRX_PROVIDER SERIALRX_SBUS
177 #define TARGET_IO_PORTA 0xffff
178 #define TARGET_IO_PORTB 0xffff
179 #define TARGET_IO_PORTC 0xffff
180 #define TARGET_IO_PORTD 0xffff
181 #define TARGET_IO_PORTE 0xffff
183 #define USABLE_TIMER_CHANNEL_COUNT 8
185 #define USED_TIMERS ( TIM_N(1) | TIM_N(5) | TIM_N(3) | TIM_N(4) | TIM_N(8) )