[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / BETAFLIGHTF3 / target.h
blob2f50dc866ebbb13463ae9a48e6c7ca6887d8af4d
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
17 //Target code By BorisB and Hector "Hectech FPV" Hind
19 #pragma once
21 #define TARGET_BOARD_IDENTIFIER "BFF3"
23 #define BEEPER PC15
24 #define BEEPER_INVERTED
26 #define MPU6000_CS_PIN PA15
27 #define MPU6000_SPI_BUS BUS_SPI1
29 #define USE_IMU_MPU6000
30 #define IMU_MPU6000_ALIGN CW180_DEG
32 // MPU6000 interrupts
33 #define USE_MPU_DATA_READY_SIGNAL
34 #define EXTI_CALLBACK_HANDLER_COUNT 1
35 #define GYRO_INT_EXTI PC13
36 #define USE_EXTI
38 //#define USE_ESC_SENSOR // XXX
39 //#define REMAP_TIM16_DMA // XXX
40 //#define REMAP_TIM17_DMA // XXX
42 #define USE_VCP
43 #define USE_UART1
44 #define USE_UART2
45 #define USE_UART3
46 #define USE_SOFTSERIAL1
47 //#define USE_SOFTSERIAL2
49 #define SERIAL_PORT_COUNT 5
51 //#define USE_ESCSERIAL // XXX
52 //#define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1 XXX
54 #define UART1_TX_PIN PA9
55 #define UART1_RX_PIN PA10
57 #define UART2_TX_PIN PA2
58 #define UART2_RX_PIN PA3
60 #define UART3_TX_PIN PB10
61 #define UART3_RX_PIN PB11
63 #define SOFTSERIAL_1_RX_PIN PB0 // PWM 5
64 #define SOFTSERIAL_1_TX_PIN PB1 // PWM 6
66 #undef USE_I2C
68 #define USE_SPI
69 #define USE_SPI_DEVICE_1
70 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
72 #define SPI1_NSS_PIN PA15
73 #define SPI1_SCK_PIN PB3
74 #define SPI1_MISO_PIN PB4
75 #define SPI1_MOSI_PIN PB5
77 #define SPI2_NSS_PIN PB12
78 #define SPI2_SCK_PIN PB13
79 #define SPI2_MISO_PIN PB14
80 #define SPI2_MOSI_PIN PB15
82 #define USE_OSD
83 #define USE_MAX7456
84 #define MAX7456_SPI_BUS BUS_SPI1
85 #define MAX7456_CS_PIN PA1
87 #define USE_SDCARD
88 #define USE_SDCARD_SPI
89 #define SDCARD_DETECT_INVERTED
90 #define SDCARD_DETECT_PIN PC14
91 #define SDCARD_SPI_BUS BUS_SPI2
92 #define SDCARD_CS_PIN SPI2_NSS_PIN
94 #define BOARD_HAS_VOLTAGE_DIVIDER
95 #define USE_ADC
96 #define ADC_INSTANCE ADC2
97 #define ADC_CHANNEL_1_PIN PA4
98 #define ADC_CHANNEL_2_PIN PA5
99 #define ADC_CHANNEL_3_PIN PB2
100 #define VBAT_ADC_CHANNEL ADC_CHN_1
101 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
102 #define RSSI_ADC_CHANNEL ADC_CHN_3
104 //#define USE_LED_STRIP
106 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
108 #define SERIALRX_PROVIDER SERIALRX_SBUS
109 #define SERIALRX_UART SERIAL_PORT_USART2
110 //#define SBUS_TELEMETRY_UART SERIAL_PORT_USART1 // XXX
111 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_CURRENT_METER | FEATURE_TELEMETRY ) // XXX
113 #define USE_SPEKTRUM_BIND
114 #define BIND_PIN UART2_RX_PIN
116 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
118 // IO - stm32f303cc in 48pin package
119 #define TARGET_IO_PORTA 0xffff
120 #define TARGET_IO_PORTB 0xffff
121 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
122 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))
124 #define MAX_PWM_OUTPUT_PORTS 8