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 #if defined(CRAZYFLIE2BQ)
41 #define USABLE_TIMER_CHANNEL_COUNT 5
42 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(14) )
44 #define USABLE_TIMER_CHANNEL_COUNT 4
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 // This board only uses I2C acc/gyro
88 // MPU9250 has the AD0 pin held high so the
89 // address is 0x69 instead of the default 0x68
90 #define MPU_ADDRESS 0x69
93 #define USE_GYRO_MPU6500
94 #define GYRO_1_ALIGN CW270_DEG
97 #define USE_ACC_MPU6500
100 #define USE_MPU9250_MAG // Enables bypass configuration on the MPU9250 I2C bus
101 #define USE_MAG_AK8963
102 #define MAG_AK8963_ALIGN CW270_DEG
105 #define USE_GYRO_EXTI
106 #define GYRO_1_EXTI_PIN PC13
108 #define USE_SERIALRX_TARGET_CUSTOM
109 #define SERIALRX_UART SERIAL_PORT_USART6
110 #define SERIALRX_PROVIDER SERIALRX_TARGET_CUSTOM
111 #define RX_CHANNELS_TAER
113 #if defined(CRAZYFLIE2BQ)
114 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
116 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
119 #if defined(CRAZYFLIE2BQ)
122 #define BEEPER_PIN PC12
124 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
125 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
127 #define ADC_INSTANCE ADC1
128 #define ADC1_DMA_OPT 1 // DMA 2 Stream 4 Channel 0 (compat default)
129 #define CURRENT_METER_ADC_PIN PA5
130 #define VBAT_ADC_PIN PA6
132 #define BRUSHED_MOTORS