Drop Betaflight PIDc support for OPBL
[betaflight.git] / src / main / target / CC3D / target.h
blobcdf8ceab1648fc64813089d8662082c73243eaf7
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
20 #define LED0 PB3
22 #define INVERTER PB2 // PB2 (BOOT1) used as inverter select GPIO
23 #define INVERTER_USART USART1
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
75 #define USE_SOFTSERIAL1
76 #define SERIAL_PORT_COUNT 4
78 #ifdef USE_UART1_RX_DMA
79 #undef USE_UART1_RX_DMA
80 #endif
82 #define SOFTSERIAL_1_TIMER TIM3
83 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 1 // PWM 2
84 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 2 // PWM 3
86 #define UART3_RX_PIN PB11
87 #define UART3_TX_PIN PB10
89 #define USE_ADC
90 #define CURRENT_METER_ADC_PIN PB1
91 #define VBAT_ADC_PIN PA0
92 #define RSSI_ADC_PIN PB0
94 #define LED_STRIP
95 #define WS2811_PIN PB4
96 #define WS2811_TIMER TIM3
97 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC6
98 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH6_HANDLER
100 #define SPEKTRUM_BIND
101 // USART3, PB11 (Flexport)
102 #define BIND_PIN PB11
104 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
106 //#define SONAR
107 //#define SONAR_ECHO_PIN PB0
108 //#define SONAR_TRIGGER_PIN PB5
110 #undef GPS
111 #define CLI_MINIMAL_VERBOSITY
112 #undef MAG
114 #ifdef CC3D_OPBL
115 #define SKIP_CLI_COMMAND_HELP
116 #define SKIP_PID_FLOAT
117 #undef BARO
118 #undef SONAR
119 #undef USE_SOFTSERIAL1
120 #undef LED_STRIP
121 #define SKIP_PID_FLOAT
122 #endif
124 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
126 // IO - from schematics
127 #define TARGET_IO_PORTA 0xffff
128 #define TARGET_IO_PORTB 0xffff
129 #define TARGET_IO_PORTC ( BIT(14) )
131 #define USABLE_TIMER_CHANNEL_COUNT 12
132 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )