Fix KISSCC orientation // Remove unsupported softserial
[betaflight.git] / src / main / target / KISSFC / target.h
blob55bf3263974d2f95daddd3e4f13d2cb3212b6a16
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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 * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "KISS"
22 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE
24 #define SBUS_PORT_OPTIONS (SERIAL_STOPBITS_2 | SERIAL_PARITY_EVEN | SERIAL_INVERTED | SERIAL_BIDIR)
26 #define USE_ESC_SENSOR
28 #define USE_ESCSERIAL
29 #define ESCSERIAL_TIMER_TX_HARDWARE 6
30 #define REMAP_TIM17_DMA
32 #define LED0 PB1
34 #define BEEPER PB13
35 #define BEEPER_INVERTED
37 #define USE_EXTI
38 #define MPU_INT_EXTI PB2
39 #define USE_MPU_DATA_READY_SIGNAL
40 #define ENSURE_MPU_DATA_READY_IS_LOW
41 #ifdef KISSCC
42 #define TARGET_CONFIG
44 #define GYRO
45 #define USE_GYRO_MPU6050
46 #define GYRO_MPU6050_ALIGN CW90_DEG
48 #define ACC
49 #define USE_ACC_MPU6050
50 #define ACC_MPU6050_ALIGN CW90_DEG
51 #else
52 #define GYRO
53 #define USE_GYRO_MPU6050
54 #define GYRO_MPU6050_ALIGN CW180_DEG
56 #define ACC
57 #define USE_ACC_MPU6050
58 #define ACC_MPU6050_ALIGN CW180_DEG
59 #endif
61 #define USE_SOFTSERIAL
62 #define USE_VCP
63 #define USE_UART1
64 #define USE_UART2
65 #define USE_UART3
66 #define SERIAL_PORT_COUNT 4
68 #define UART1_TX_PIN PA9
69 #define UART1_RX_PIN PA10
71 #define UART2_TX_PIN PB3
72 #define UART2_RX_PIN PB4
74 #define UART3_TX_PIN PB10 // PB10 (AF7)
75 #define UART3_RX_PIN PB11 // PB11 (AF7)
77 /* Fix this when Softserial is supported on single pin and add 1 more serial port
78 #ifdef KISSCC
79 #define SOFTSERIAL_1_TIMER TIM16
80 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 11
81 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 11
82 #endif
85 #define USE_I2C
86 #define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA
88 #define USE_ADC
89 #define VBAT_SCALE_DEFAULT 160
90 #define ADC_INSTANCE ADC1
91 #define VBAT_ADC_PIN PA0
92 //#define CURRENT_METER_ADC_PIN PA5
93 //#define RSSI_ADC_PIN PB2
95 #define DEFAULT_FEATURES FEATURE_VBAT
96 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
97 #define SERIALRX_PROVIDER SERIALRX_SBUS
98 #define SERIALRX_UART SERIAL_PORT_USART2
100 #define AVOID_UART2_FOR_PWM_PPM
102 #define SPEKTRUM_BIND
103 #define BIND_PIN PB4
105 #define TARGET_IO_PORTA 0xffff
106 #define TARGET_IO_PORTB 0xffff
107 #define TARGET_IO_PORTC 0xffff
108 #define TARGET_IO_PORTD 0xffff
109 #define TARGET_IO_PORTF (BIT(4))
111 #define USABLE_TIMER_CHANNEL_COUNT 10
112 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(15) | TIM_N(16) | TIM_N(17))