Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / target / BETAFLIGHTF3 / target.h
blobcdbf30cbf34f382ff0701ca02d644c6c68f53f7e
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 //Target code By BorisB and Hector "Hectech FPV" Hind
23 #pragma once
25 #define TARGET_BOARD_IDENTIFIER "BFF3"
27 #define USE_BEEPER
28 #define BEEPER_PIN PC15
29 #define BEEPER_INVERTED
31 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
33 #define USABLE_TIMER_CHANNEL_COUNT 10
35 #define GYRO_1_CS_PIN PA15
36 #define GYRO_1_SPI_INSTANCE SPI1
38 #define USE_GYRO
39 #define USE_GYRO_SPI_MPU6000
40 #define GYRO_1_ALIGN CW180_DEG
42 #define USE_ACC
43 #define USE_ACC_SPI_MPU6000
45 // MPU6000 interrupts
46 #define USE_MPU_DATA_READY_SIGNAL
47 #define USE_EXTI
48 #define USE_GYRO_EXTI
49 #define GYRO_1_EXTI_PIN PC13
50 #define USE_EXTI
52 #define REMAP_TIM16_DMA
53 #define REMAP_TIM17_DMA
55 #define USE_VCP
56 #define USE_UART1
57 #define USE_UART2
58 #define USE_UART3
59 #define USE_SOFTSERIAL1
60 #define USE_SOFTSERIAL2
62 #define SERIAL_PORT_COUNT 6
64 #define USE_ESCSERIAL
65 #define ESCSERIAL_TIMER_TX_PIN PB7 // (HARDARE=0,PPM)
67 #define UART1_TX_PIN PA9
68 #define UART1_RX_PIN PA10
70 #define UART2_TX_PIN PA2
71 #define UART2_RX_PIN PA3
73 #define UART3_TX_PIN PB10
74 #define UART3_RX_PIN PB11
76 #define SOFTSERIAL1_RX_PIN PB0 // PWM 5
77 #define SOFTSERIAL1_TX_PIN PB1 // PWM 6
79 #undef USE_I2C
81 #define USE_SPI
82 #define USE_SPI_DEVICE_1
83 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
85 #define SPI1_NSS_PIN PA15
86 #define SPI1_SCK_PIN PB3
87 #define SPI1_MISO_PIN PB4
88 #define SPI1_MOSI_PIN PB5
90 #define SPI2_NSS_PIN PB12
91 #define SPI2_SCK_PIN PB13
92 #define SPI2_MISO_PIN PB14
93 #define SPI2_MOSI_PIN PB15
95 // include the max7456 driver
96 #define USE_MAX7456
97 #define MAX7456_SPI_INSTANCE SPI1
98 #define MAX7456_SPI_CS_PIN PA1
100 #define USE_SDCARD
101 #define USE_SDCARD_SPI
102 #define SDCARD_DETECT_INVERTED
103 #define SDCARD_DETECT_PIN PC14
104 #define SDCARD_SPI_INSTANCE SPI2
105 #define SDCARD_SPI_CS_PIN SPI2_NSS_PIN
106 #define SDCARD_DMA_CHANNEL_TX DMA1_Channel5
108 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
109 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
110 #define USE_ADC
111 #define ADC_INSTANCE ADC2
112 #define ADC24_DMA_REMAP
113 #define VBAT_ADC_PIN PA4
114 #define CURRENT_METER_ADC_PIN PA5
115 #define RSSI_ADC_PIN PB2
117 #define CURRENT_METER_SCALE_DEFAULT 220
119 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
121 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
122 #define SERIALRX_PROVIDER SERIALRX_SBUS
123 #define SERIALRX_UART SERIAL_PORT_USART2
124 #define SBUS_TELEMETRY_UART SERIAL_PORT_USART1
125 #define DEFAULT_FEATURES (FEATURE_TELEMETRY | FEATURE_OSD)
127 // IO - stm32f303cc in 48pin package
128 #define TARGET_IO_PORTA 0xffff
129 #define TARGET_IO_PORTB 0xffff
130 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
131 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))
133 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(16) | TIM_N(17) )