Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / target / CRAZYBEEF3FR / target.h
blob75597691917192ef2cac27e1c6dfba3069add9de
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/>.
21 #pragma once
23 #if defined(CRAZYBEEF3FS)
24 #define TARGET_BOARD_IDENTIFIER "CBFS"
25 #define USBD_PRODUCT_STRING "CrazyBee F3 FS"
26 #elif defined(CRAZYBEEF3DX)
27 #define TARGET_BOARD_IDENTIFIER "CBDX"
28 #define USBD_PRODUCT_STRING "CrazyBee F3 DX"
29 #else
30 #define TARGET_BOARD_IDENTIFIER "CBFR"
31 #define USBD_PRODUCT_STRING "CrazyBee F3 FR"
32 #endif
34 #undef USE_SERIALRX_CRSF
35 #undef USE_SERIALRX_GHST
36 #undef USE_SERIALRX_SUMD
37 #undef USE_SERIALRX_SUMH
38 #undef USE_SERIALRX_XBUS
39 #undef USE_TELEMETRY_CRSF
40 #undef USE_TELEMETRY_GHST
41 #undef USE_TELEMETRY_MAVLINK
42 #undef USE_PWM
45 #if defined(CRAZYBEEF3FS)
46 #undef USE_SERIALRX_SBUS
47 #undef USE_SERIALRX_FPORT
48 #undef USE_SERIALRX_SPEKTRUM
49 #undef USE_TELEMETRY_FRSKY_HUB
50 #undef USE_TELEMETRY_SMARTPORT
51 #undef USE_TELEMETRY_SRXL
52 #elif defined(CRAZYBEEF3DX)
53 #undef USE_SERIALRX_SBUS
54 #undef USE_SERIALRX_FPORT
55 #undef USE_SERIALRX_IBUS
56 #undef USE_TELEMETRY_FRSKY_HUB
57 #undef USE_TELEMETRY_SMARTPORT
58 #else
59 #undef USE_SERIALRX_SPEKTRUM
60 #undef USE_SERIALRX_IBUS
61 #undef USE_TELEMETRY_SRXL
62 #endif
64 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
66 #define LED0_PIN PB3
67 #define USE_BEEPER
68 #define BEEPER_PIN PC15
69 #define BEEPER_INVERTED
71 #define USE_EXTI
72 #define USE_GYRO_EXTI
73 #define GYRO_1_EXTI_PIN PC13
74 #define USE_MPU_DATA_READY_SIGNAL
75 #define GYRO_1_SPI_INSTANCE SPI1
76 #define GYRO_1_CS_PIN PA4
77 #define USE_GYRO
78 #define USE_GYRO_SPI_MPU6000
79 #define GYRO_1_ALIGN CW90_DEG
80 #define USE_ACC
81 #define USE_ACC_SPI_MPU6000
83 #define USE_VCP
84 #if defined(CRAZYBEEF3DX)
85 #define USE_UART2
86 #define USE_UART3
87 #define SERIAL_PORT_COUNT 3
88 #define UART2_TX_PIN PA14
89 #define UART2_RX_PIN PA15
90 #define UART3_TX_PIN PB10
91 #define UART3_RX_PIN PB11
92 #else
93 #define USE_UART3
94 #define SERIAL_PORT_COUNT 2
95 #define UART3_TX_PIN PB10
96 #define UART3_RX_PIN PB11
97 #endif
99 #define USE_SPI
100 #define USE_SPI_DEVICE_1
101 #define SPI1_NSS_PIN PA4
102 #define SPI1_SCK_PIN PA5
103 #define SPI1_MISO_PIN PA6
104 #define SPI1_MOSI_PIN PA7
106 #define USE_SPI_DEVICE_2
107 #define SPI2_NSS_PIN PB12
108 #define SPI2_SCK_PIN PB13
109 #define SPI2_MISO_PIN PB14
110 #define SPI2_MOSI_PIN PB15
112 #if defined(CRAZYBEEF3FS)
113 #define USE_RX_SPI
114 #define USE_RX_FLYSKY
115 #define RX_CHANNELS_AETR
116 #define DEFAULT_RX_FEATURE FEATURE_RX_SPI
117 #define RX_SPI_DEFAULT_PROTOCOL RX_SPI_A7105_FLYSKY_2A
118 #define FLYSKY_2A_CHANNEL_COUNT 14
119 #define RX_SPI_INSTANCE SPI2
120 #define RX_NSS_PIN SPI2_NSS_PIN
121 #define RX_SPI_EXTI_PIN PA8
122 #define RX_SPI_BIND_PIN PA9
123 #define RX_SPI_LED_PIN PA10
124 #define DEFAULT_FEATURES (FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_MOTOR_STOP)
125 #elif defined(CRAZYBEEF3DX)
126 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
127 #define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048
128 #define SERIALRX_UART SERIAL_PORT_USART3
129 #define RX_CHANNELS_TAER
130 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_MOTOR_STOP)
131 #else
132 #define USE_RX_SPI
133 #define USE_RX_FRSKY_SPI_D
134 #define USE_RX_FRSKY_SPI_X
135 #define USE_RX_SFHSS_SPI
136 #define USE_RX_REDPINE_SPI
137 #define DEFAULT_RX_FEATURE FEATURE_RX_SPI
138 #define RX_SPI_DEFAULT_PROTOCOL RX_SPI_FRSKY_X
139 #define USE_RX_FRSKY_SPI_TELEMETRY
141 #define RX_SPI_INSTANCE SPI2
142 #define RX_NSS_PIN SPI2_NSS_PIN
143 #define RX_SPI_EXTI_PIN PA8
144 #define RX_SPI_LED_PIN PA10
145 #define RX_SPI_BIND_PIN PA9
146 #define DEFAULT_FEATURES (FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_MOTOR_STOP)
147 #endif
149 #define USE_MAX7456
150 #define MAX7456_SPI_INSTANCE SPI1
151 #define MAX7456_SPI_CS_PIN PB1
153 #define USE_ADC
154 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
155 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
156 #define VBAT_ADC_PIN PA0
157 #define CURRENT_METER_ADC_PIN PA1
158 #define ADC_INSTANCE ADC1
159 #define CURRENT_METER_SCALE_DEFAULT 2350
161 #define TARGET_IO_PORTA 0xffff
162 #define TARGET_IO_PORTB 0xffff
163 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
164 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
165 #define USABLE_TIMER_CHANNEL_COUNT 6
166 #define USED_TIMERS (TIM_N(2) |TIM_N(3) |TIM_N(4) | TIM_N(8))