Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / target / CRAZYFLIE2 / target.h
blobc98588c1e72ba201145b4014319b5162491ca0fc
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/>.
22 * This target is for the Crazyflie 2.0 nanocopter board
24 * For details on using this target with the Crazyflie see:
25 * https://wiki.bitcraze.io/misc:hacks:betaflight
27 * Target code written and maintained by Sean Kelly (theseankelly@outlook.com)
30 #pragma once
32 #if defined(CRAZYFLIE2BQ)
33 #define TARGET_BOARD_IDENTIFIER "CFBQ"
34 #define USBD_PRODUCT_STRING "Crazyflie 2.0 (BigQuad Deck)"
35 #else
36 #define TARGET_BOARD_IDENTIFIER "CF20"
37 #define USBD_PRODUCT_STRING "Crazyflie 2.0"
38 #endif
40 #define USABLE_TIMER_CHANNEL_COUNT 14
42 #if defined(CRAZYFLIE2BQ)
43 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(14) )
44 #else
45 #define USED_TIMERS ( TIM_N(2) | TIM_N(4) )
46 #endif
48 #define LED0_PIN PD2
49 #define LED1_PIN PC0
50 #define LED2_PIN PC3
52 // Using STM32F405RG, 64 pin package (LQFP64)
53 // 16 pins per port, ports A, B, C, and also PD2
54 #define TARGET_IO_PORTA 0xFFFF
55 #define TARGET_IO_PORTB 0xFFFF
56 #define TARGET_IO_PORTC 0xFFFF
57 #define TARGET_IO_PORTD (BIT(2))
59 #define USE_VCP
61 #if defined(CRAZYFLIE2BQ)
62 #define USE_UART1
63 #define UART1_TX_PIN PB6
64 #define UART1_RX_PIN PB7
66 #define USE_UART3
67 #define UART3_TX_PIN PC10
68 #define UART3_RX_PIN PC11
69 #endif
71 #define USE_UART6
72 #define UART6_TX_PIN PC6
73 #define UART6_RX_PIN PC7
75 #if defined(CRAZYFLIE2BQ)
76 #define SERIAL_PORT_COUNT 4
77 #else
78 #define SERIAL_PORT_COUNT 2
79 #endif
81 #define USE_I2C
82 #define USE_I2C_DEVICE_3
83 #define I2C_DEVICE (I2CDEV_3)
85 // MPU9250 has the AD0 pin held high so the
86 // address is 0x69 instead of the default 0x68
87 #define MPU_ADDRESS 0x69
89 #define USE_GYRO
90 #define USE_GYRO_MPU6500
91 #define GYRO_MPU6500_ALIGN CW270_DEG
93 #define USE_ACC
94 #define USE_ACC_MPU6500
95 #define ACC_MPU6500_ALIGN CW270_DEG
97 #define USE_MAG
98 #define USE_MPU9250_MAG // Enables bypass configuration on the MPU9250 I2C bus
99 #define USE_MAG_AK8963
100 #define MAG_AK8963_ALIGN CW270_DEG
102 #define USE_EXTI
103 #define MPU_INT_EXTI PC13
105 #define USE_SERIALRX_TARGET_CUSTOM
106 #define SERIALRX_UART SERIAL_PORT_USART6
107 #define SERIALRX_PROVIDER SERIALRX_TARGET_CUSTOM
108 #define RX_CHANNELS_TAER
110 #if defined(CRAZYFLIE2BQ)
111 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
112 #else
113 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
114 #endif
116 #if defined(CRAZYFLIE2BQ)
117 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
119 #define USE_BEEPER
120 #define BEEPER_PIN PC12
122 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
123 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
124 #define USE_ADC
125 #define ADC_INSTANCE ADC1
126 #define CURRENT_METER_ADC_PIN PA5
127 #define VBAT_ADC_PIN PA6
128 #else
129 #define BRUSHED_MOTORS
130 #endif