Added common target header file.
[betaflight.git] / src / main / target / CC3D / target.h
bloba782103b2bf94be2346869d4e44e304b57b7c1c3
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_GPIO GPIOB
21 #define LED0_PIN Pin_3 // PB3 (LED)
22 #define LED0_PERIPHERAL RCC_APB2Periph_GPIOB
23 #define LED0
25 #define INVERTER_PIN Pin_2 // PB2 (BOOT1) used as inverter select GPIO
26 #define INVERTER_GPIO GPIOB
27 #define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB
28 #define INVERTER_USART USART1
30 #define BEEP_GPIO GPIOA
31 #define BEEP_PIN Pin_15 // PA15 (Beeper)
32 #define BEEP_PERIPHERAL RCC_APB2Periph_GPIOA
34 #define MPU6000_CS_GPIO GPIOA
35 #define MPU6000_CS_PIN GPIO_Pin_4
36 #define MPU6000_SPI_INSTANCE SPI1
38 #define M25P16_CS_GPIO GPIOB
39 #define M25P16_CS_PIN GPIO_Pin_12
40 #define M25P16_SPI_INSTANCE SPI2
42 #define USE_FLASHFS
43 #define USE_FLASH_M25P16
45 #define USABLE_TIMER_CHANNEL_COUNT 12
47 //#define DEBUG_MPU_DATA_READY_INTERRUPT
48 #define USE_MPU_DATA_READY_SIGNAL
50 #define GYRO
51 #define USE_GYRO_SPI_MPU6000
53 #define GYRO_MPU6000_ALIGN CW270_DEG
55 #define ACC
56 #define USE_ACC_SPI_MPU6000
58 #define ACC_MPU6000_ALIGN CW270_DEG
60 // External I2C BARO
61 #define BARO
62 #define USE_BARO_MS5611
63 #define USE_BARO_BMP085
65 // External I2C MAG
66 #define MAG
67 #define USE_MAG_HMC5883
68 #define USE_MAG_AK8975
69 #define USE_MAG_MAG3110
71 #define INVERTER
72 #define BEEPER
74 #define USE_VCP
75 #define USE_USART1
76 #define USE_USART3
77 #define USE_SOFTSERIAL1
78 #define SERIAL_PORT_COUNT 4
80 #define SOFTSERIAL_1_TIMER TIM3
81 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 1 // PWM 2
82 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 2 // PWM 3
84 #define USART3_RX_PIN Pin_11
85 #define USART3_TX_PIN Pin_10
86 #define USART3_GPIO GPIOB
87 #define USART3_APB1_PERIPHERALS RCC_APB1Periph_USART3
88 #define USART3_APB2_PERIPHERALS RCC_APB2Periph_GPIOB
90 #define USE_SPI
91 #define USE_SPI_DEVICE_1
92 #define USE_SPI_DEVICE_2
94 #define USE_I2C
95 #define I2C_DEVICE (I2CDEV_2) // Flex port - SCL/PB10, SDA/PB11
97 #define USE_ADC
99 #define CURRENT_METER_ADC_GPIO GPIOB
100 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
101 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
103 #define VBAT_ADC_GPIO GPIOA
104 #define VBAT_ADC_GPIO_PIN GPIO_Pin_0
105 #define VBAT_ADC_CHANNEL ADC_Channel_0
107 #define RSSI_ADC_GPIO GPIOA
108 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
109 #define RSSI_ADC_CHANNEL ADC_Channel_1
111 #define GPS
112 #define GPS_PROTO_NMEA
113 #define GPS_PROTO_UBLOX
114 #define GPS_PROTO_I2C_NAV
115 #define GPS_PROTO_NAZA
117 #define NAV
118 //#define NAV_AUTO_MAG_DECLINATION
119 #define NAV_GPS_GLITCH_DETECTION
121 //#define LED_STRIP
122 //#define LED_STRIP_TIMER TIM3
124 #define BLACKBOX
125 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
127 #define TELEMETRY
128 //#define TELEMETRY_FRSKY
129 //#define TELEMETRY_HOTT
130 //#define TELEMETRY_SMARTPORT
131 #define TELEMETRY_LTM
133 #define SONAR
134 #define USE_SONAR_SRF10
135 #define SONAR_TRIGGER_PIN Pin_5 // (PB5)
136 #define SONAR_TRIGGER_GPIO GPIOB
137 #define SONAR_ECHO_PIN Pin_0 // (PB0) - only 3.3v ( add a 1K Ohms resistor )
138 #define SONAR_ECHO_GPIO GPIOB
139 #define SONAR_EXTI_LINE EXTI_Line0
140 #define SONAR_EXTI_PIN_SOURCE GPIO_PinSource0
141 #define SONAR_EXTI_IRQN EXTI0_IRQn
143 #define SERIAL_RX
144 #define USE_SERVOS
145 #define USE_CLI
147 //#define USE_SERIAL_4WAY_BLHELI_INTERFACE
149 #define SPEKTRUM_BIND
150 // USART3, PB11 (Flexport)
151 #define BIND_PORT GPIOB
152 #define BIND_PIN Pin_11
154 //Disables uncommon predefined mixer settings like BiCopter, H6 and similar exotics
156 #ifdef CC3D_OPBL
157 #define USE_QUAD_MIXER_ONLY
158 #undef USE_SERVOS
159 #undef TELEMETRY
160 #undef TELEMETRY_LTM
161 #undef SERIAL_RX
162 //#define SKIP_RX_MSP
163 #endif
165 // DEBUG
166 //#define HIL
167 //#define USE_FAKE_MAG
168 //#define USE_FAKE_BARO
169 //#define USE_FAKE_GPS