New SPI API supporting DMA
[betaflight.git] / src / main / target / CC3D / target.h
blob25c37df36a93fd91cb1aa5b6fc382571967a4244
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 TARGET_BOARD_IDENTIFIER "CC3D" // CopterControl 3D
25 #define LED0_PIN PB3
27 #define INVERTER_PIN_UART1 PB2 // PB2 (BOOT1) used as inverter select GPIO
29 #define USE_BEEPER
30 #define BEEPER_PIN PA15
32 #define USE_EXTI
33 #define USE_GYRO_EXTI
34 #define GYRO_1_EXTI_PIN PA3
35 #define USE_MPU_DATA_READY_SIGNAL
36 //#define DEBUG_MPU_DATA_READY_INTERRUPT
38 #define USE_SPI
39 #define USE_SPI_DEVICE_1
40 #define USE_SPI_DEVICE_2
42 #define GYRO_1_CS_PIN PA4
43 #define GYRO_1_SPI_INSTANCE SPI1
45 #define FLASH_CS_PIN PB12
46 #define FLASH_SPI_INSTANCE SPI2
48 #define USE_FLASHFS
49 #define USE_FLASH_M25P16
51 #define USE_GYRO
52 #define USE_GYRO_SPI_MPU6000
53 #define GYRO_1_ALIGN CW270_DEG
55 #define USE_ACC
56 #define USE_ACC_SPI_MPU6000
58 // MPU6000 interrupts
59 #define USE_MPU_DATA_READY_SIGNAL
61 //#define USE_I2C
62 //#define I2C_DEVICE (I2CDEV_2) // Flex port - SCL/PB10, SDA/PB11
64 // External I2C BARO
65 //#define USE_BARO
66 //#define USE_BARO_MS5611
67 //#define USE_BARO_BMP085
68 //#define USE_BARO_BMP280
70 // External I2C MAG
71 //#define USE_MAG
72 //#define USE_MAG_HMC5883
74 #define USE_VCP
75 #define USE_UART1
76 #define USE_UART3
77 #define USE_SOFTSERIAL1
78 #define USE_SOFTSERIAL2
80 #define SERIAL_PORT_COUNT 5
82 #ifndef CC3D_OPBL
83 #define SOFTSERIAL1_TX_PIN PB5 // PWM 2
84 #define SOFTSERIAL1_RX_PIN PB0 // PWM 3
85 #endif
87 #ifdef USE_UART1_RX_DMA
88 #undef USE_UART1_RX_DMA
89 #endif
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 USE_RANGEFINDER
100 //#define USE_RANGEFINDER_HCSR04
101 //#define RANGEFINDER_HCSR04_ECHO_PIN PB0
102 //#define RANGEFINDER_HCSR04_TRIGGER_PIN PB5
104 #undef USE_MAG
106 #ifdef CC3D_OPBL
107 //#undef USE_SERVOS
108 #undef USE_BARO
109 #undef USE_RANGEFINDER
110 #undef USE_RANGEFINDER_HCSR04
111 #undef USE_SERIAL_4WAY_BLHELI_INTERFACE
112 //#undef USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol
113 //#undef USE_SERIALRX_SBUS // Frsky and Futaba receivers
114 //#undef USE_SERIALRX_IBUS // FlySky and Turnigy receivers
115 #undef USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol
116 #undef USE_SERIALRX_SUMD // Graupner Hott protocol
117 #undef USE_SERIALRX_SUMH // Graupner legacy protocol
118 #undef USE_SERIALRX_XBUS // JR
119 #endif
121 //#undef USE_LED_STRIP
122 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
124 // IO - from schematics
125 #define TARGET_IO_PORTA 0xffff
126 #define TARGET_IO_PORTB 0xffff
127 #define TARGET_IO_PORTC ( BIT(14) )
129 #define PARTIAL_REMAP_TIM3
131 #define USABLE_TIMER_CHANNEL_COUNT 12
132 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )