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)
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)
32 #if defined(CRAZYFLIE2BQ)
33 #define TARGET_BOARD_IDENTIFIER "CFBQ"
34 #define USBD_PRODUCT_STRING "Crazyflie 2.0 (BigQuad Deck)"
36 #define TARGET_BOARD_IDENTIFIER "CF20"
37 #define USBD_PRODUCT_STRING "Crazyflie 2.0"
40 #define USABLE_TIMER_CHANNEL_COUNT 14
42 #if defined(CRAZYFLIE2BQ)
43 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(14) )
45 #define USED_TIMERS ( TIM_N(2) | TIM_N(4) )
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))
61 #if defined(CRAZYFLIE2BQ)
63 #define UART1_TX_PIN PB6
64 #define UART1_RX_PIN PB7
67 #define UART3_TX_PIN PC10
68 #define UART3_RX_PIN PC11
72 #define UART6_TX_PIN PC6
73 #define UART6_RX_PIN PC7
75 #if defined(CRAZYFLIE2BQ)
76 #define SERIAL_PORT_COUNT 4
78 #define SERIAL_PORT_COUNT 2
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
90 #define USE_GYRO_MPU6500
91 #define GYRO_MPU6500_ALIGN CW270_DEG
94 #define USE_ACC_MPU6500
95 #define ACC_MPU6500_ALIGN CW270_DEG
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
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
113 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
116 #if defined(CRAZYFLIE2BQ)
117 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
120 #define BEEPER_PIN PC12
122 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
123 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
125 #define ADC_INSTANCE ADC1
126 #define CURRENT_METER_ADC_PIN PA5
127 #define VBAT_ADC_PIN PA6
129 #define BRUSHED_MOTORS