Removed more target specific conditionals from the main codebase
[betaflight.git] / src / main / target / CC3D / target.h
blob2eea75aafe545c714eb19bd5625413dacbba5585
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 #define TARGET_BOARD_IDENTIFIER "CC3D" // CopterControl 3D
19 #define TARGET_VALIDATECONFIG
21 #define LED0 PB3
23 #define INVERTER_PIN_USART1 PB2 // PB2 (BOOT1) used as inverter select GPIO
25 #define BEEPER PA15
26 #define BEEPER_OPT PA2
28 #define USE_EXTI
29 #define MPU_INT_EXTI PA3
30 #define USE_MPU_DATA_READY_SIGNAL
31 //#define DEBUG_MPU_DATA_READY_INTERRUPT
33 #define USE_SPI
34 #define USE_SPI_DEVICE_1
35 #define USE_SPI_DEVICE_2
37 #define USE_I2C
38 #define I2C_DEVICE (I2CDEV_2) // Flex port - SCL/PB10, SDA/PB11
40 #define MPU6000_CS_GPIO GPIOA
41 #define MPU6000_CS_PIN PA4
42 #define MPU6000_SPI_INSTANCE SPI1
44 #define M25P16_CS_GPIO GPIOB
45 #define M25P16_CS_PIN PB12
46 #define M25P16_SPI_INSTANCE SPI2
48 #define USE_FLASHFS
49 #define USE_FLASH_M25P16
51 #define GYRO
52 #define USE_GYRO_SPI_MPU6000
53 #define GYRO_MPU6000_ALIGN CW270_DEG
55 #define ACC
56 #define USE_ACC_SPI_MPU6000
57 #define ACC_MPU6000_ALIGN CW270_DEG
59 // MPU6000 interrupts
60 #define USE_MPU_DATA_READY_SIGNAL
62 // External I2C BARO
63 //#define BARO
64 //#define USE_BARO_MS5611
65 //#define USE_BARO_BMP085
66 //#define USE_BARO_BMP280
68 // External I2C MAG
69 //#define MAG
70 //#define USE_MAG_HMC5883
72 #define USE_VCP
73 #define USE_UART1
74 #define USE_UART3
76 #ifdef CC3D_OPBL
77 #define SERIAL_PORT_COUNT 3
78 #else
79 #define USE_SOFTSERIAL1
80 #define SERIAL_PORT_COUNT 4
81 #endif
83 #ifdef USE_UART1_RX_DMA
84 #undef USE_UART1_RX_DMA
85 #endif
87 #define SOFTSERIAL_1_TIMER TIM3
88 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 1 // PWM 2
89 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 2 // PWM 3
91 #define UART3_RX_PIN PB11
92 #define UART3_TX_PIN PB10
94 #define USE_ADC
95 #define CURRENT_METER_ADC_PIN PB1
96 #define VBAT_ADC_PIN PA0
97 #define RSSI_ADC_PIN PB0
99 #define SPEKTRUM_BIND
100 // USART3, PB11 (Flexport)
101 #define BIND_PIN PB11
103 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
105 //#define SONAR
106 //#define SONAR_ECHO_PIN PB0
107 //#define SONAR_TRIGGER_PIN PB5
109 #undef GPS
110 #undef MAG
112 #ifdef CC3D_OPBL
113 #define SKIP_CLI_COMMAND_HELP
114 //#undef USE_SERVOS
115 #undef BARO
116 #undef SONAR
117 #undef LED_STRIP
118 #undef USE_SERIAL_4WAY_BLHELI_INTERFACE
119 //#undef USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol
120 //#undef USE_SERIALRX_SBUS // Frsky and Futaba receivers
121 //#undef USE_SERIALRX_IBUS // FlySky and Turnigy receivers
122 #undef USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol
123 #undef USE_SERIALRX_SUMD // Graupner Hott protocol
124 #undef USE_SERIALRX_SUMH // Graupner legacy protocol
125 #undef USE_SERIALRX_XBUS // JR
126 #endif
128 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
130 // IO - from schematics
131 #define TARGET_IO_PORTA 0xffff
132 #define TARGET_IO_PORTB 0xffff
133 #define TARGET_IO_PORTC ( BIT(14) )
135 #define USABLE_TIMER_CHANNEL_COUNT 12
136 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )