Cleanup CC3D/NAZE/OLIMEXINO ADC initialisation and PWM mapping. Fixes
[betaflight.git] / src / main / target / CC3D / target.h
blob65c4b69457493a72839ad89f546448b0103370d9
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 USABLE_TIMER_CHANNEL_COUNT 12
40 #define GYRO
41 #define USE_GYRO_SPI_MPU6000
43 #define GYRO_SPI_MPU6000_ALIGN CW270_DEG
45 #define ACC
46 #define USE_ACC_SPI_MPU6000
48 #define ACC_SPI_MPU6000_ALIGN CW270_DEG
50 #define INVERTER
51 #define BEEPER
53 #define USE_USART1
54 #define USE_USART3
55 #define USE_SOFTSERIAL1
56 #define SERIAL_PORT_COUNT 3
58 #define SOFTSERIAL_1_TIMER TIM3
59 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 1 // PWM 2
60 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 2 // PWM 3
62 #define USART3_RX_PIN Pin_11
63 #define USART3_TX_PIN Pin_10
64 #define USART3_GPIO GPIOB
65 #define USART3_APB1_PERIPHERALS RCC_APB1Periph_USART3
66 #define USART3_APB2_PERIPHERALS RCC_APB2Periph_GPIOB
68 #define USE_SPI
69 #define USE_SPI_DEVICE_1
70 #define USE_SPI_DEVICE_2
72 #define USE_ADC
74 #define CURRENT_METER_ADC_GPIO GPIOB
75 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
76 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
78 #define VBAT_ADC_GPIO GPIOA
79 #define VBAT_ADC_GPIO_PIN GPIO_Pin_0
80 #define VBAT_ADC_CHANNEL ADC_Channel_0
82 #define RSSI_ADC_GPIO GPIOA
83 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
84 #define RSSI_ADC_CHANNEL ADC_Channel_1
87 #define SENSORS_SET (SENSOR_ACC)
89 #define GPS
90 #define LED_STRIP
91 #define LED_STRIP_TIMER TIM3
93 #define BLACKBOX
94 #define TELEMETRY
95 #define SERIAL_RX
96 #define AUTOTUNE
98 #define SPEKTRUM_BIND
99 // USART3, PB11 (Flexport)
100 #define BIND_PORT GPIOB
101 #define BIND_PIN Pin_11