Merge pull request #11297 from SteveCEvans/baro_state
[betaflight.git] / src / main / target / CC3D / target.h
blobf3d007fd34258191744ffd2f6de07adc3defc170
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 USE_SPI
37 #define USE_SPI_DEVICE_1
38 #define USE_SPI_DEVICE_2
40 #define GYRO_1_CS_PIN PA4
41 #define GYRO_1_SPI_INSTANCE SPI1
43 #define FLASH_CS_PIN PB12
44 #define FLASH_SPI_INSTANCE SPI2
46 #define USE_FLASHFS
47 #define USE_FLASH_M25P16
49 #define USE_GYRO
50 #define USE_GYRO_SPI_MPU6000
51 #define GYRO_1_ALIGN CW270_DEG
53 #define USE_ACC
54 #define USE_ACC_SPI_MPU6000
56 // MPU6000 interrupts
57 #define USE_MPU_DATA_READY_SIGNAL
59 //#define USE_I2C
60 //#define I2C_DEVICE (I2CDEV_2) // Flex port - SCL/PB10, SDA/PB11
62 // External I2C BARO
63 //#define USE_BARO
64 //#define USE_BARO_MS5611
65 //#define USE_BARO_BMP085
66 //#define USE_BARO_BMP280
68 // External I2C MAG
69 //#define USE_MAG
70 //#define USE_MAG_HMC5883
72 #define USE_VCP
73 #define USE_UART1
74 #define USE_UART3
75 #define USE_SOFTSERIAL1
76 #define USE_SOFTSERIAL2
78 #define SERIAL_PORT_COUNT 5
80 #ifndef CC3D_OPBL
81 #define SOFTSERIAL1_TX_PIN PB5 // PWM 2
82 #define SOFTSERIAL1_RX_PIN PB0 // PWM 3
83 #endif
85 #ifdef USE_UART1_RX_DMA
86 #undef USE_UART1_RX_DMA
87 #endif
89 #define UART3_RX_PIN PB11
90 #define UART3_TX_PIN PB10
92 #define USE_ADC
93 #define CURRENT_METER_ADC_PIN PB1
94 #define VBAT_ADC_PIN PA0
95 #define RSSI_ADC_PIN PB0
97 //#define USE_RANGEFINDER
98 //#define USE_RANGEFINDER_HCSR04
99 //#define RANGEFINDER_HCSR04_ECHO_PIN PB0
100 //#define RANGEFINDER_HCSR04_TRIGGER_PIN PB5
102 #undef USE_MAG
104 #ifdef CC3D_OPBL
105 //#undef USE_SERVOS
106 #undef USE_BARO
107 #undef USE_RANGEFINDER
108 #undef USE_RANGEFINDER_HCSR04
109 #undef USE_SERIAL_4WAY_BLHELI_INTERFACE
110 //#undef USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol
111 //#undef USE_SERIALRX_SBUS // Frsky and Futaba receivers
112 //#undef USE_SERIALRX_IBUS // FlySky and Turnigy receivers
113 #undef USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol
114 #undef USE_SERIALRX_SUMD // Graupner Hott protocol
115 #undef USE_SERIALRX_SUMH // Graupner legacy protocol
116 #undef USE_SERIALRX_XBUS // JR
117 #endif
119 //#undef USE_LED_STRIP
120 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
122 // IO - from schematics
123 #define TARGET_IO_PORTA 0xffff
124 #define TARGET_IO_PORTB 0xffff
125 #define TARGET_IO_PORTC ( BIT(14) )
127 #define PARTIAL_REMAP_TIM3
129 #define USABLE_TIMER_CHANNEL_COUNT 12
130 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )