Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / target / ALIENFLIGHTF3 / target.h
blobd0e22c8f873c9f72fd830df1770ed19060d8144e
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 #define TARGET_BOARD_IDENTIFIER "AFF3" // AlienFlight F3.
24 #define USE_TARGET_CONFIG
25 #define TARGET_BUS_INIT
26 #define REMAP_TIM17_DMA
29 #define USE_HARDWARE_REVISION_DETECTION
30 #define HW_PIN PB2
32 // LED's V1
33 #define LED0_PIN PB4
34 #define LED1_PIN PB5
36 // LED's V2
37 #define LED0_A PB8
38 #define LED1_A PB9
40 #define USE_BEEPER
41 #define BEEPER_PIN PA5
43 #define USE_EXTI
44 #define USE_MPU_DATA_READY_SIGNAL
46 // Using MPU6050 for the moment.
47 #define USE_GYRO
48 #define USE_GYRO_MPU6050
49 #define USE_GYRO_SPI_MPU6500
51 #define GYRO_1_ALIGN CW270_DEG
53 #define USE_ACC
54 #define USE_ACC_MPU6050
55 #define USE_ACC_SPI_MPU6500
58 // No baro support.
59 //#define USE_BARO
60 //#define USE_BARO_MS5611
62 // option to use MPU9150 or MPU9250 integrated AK89xx Mag
63 #define USE_MAG
64 #define USE_MAG_AK8963
65 #define MAG_AK8963_ALIGN CW180_DEG_FLIP
67 #define USE_VCP
68 #define USE_UART1 // Not connected - TX (PB6) RX PB7 (AF7)
69 #define USE_UART2 // Receiver - RX (PA3)
70 #define USE_UART3 // Not connected - 10/RX (PB11) 11/TX (PB10)
71 #define USE_SOFTSERIAL1
72 #define USE_SOFTSERIAL2
74 #define SERIAL_PORT_COUNT 6
76 #define AVOID_UART2_FOR_PWM_PPM
78 #define USE_ESCSERIAL
79 #define ESCSERIAL_TIMER_TX_PIN PB15 // (HARDARE=0)
81 #define UART1_TX_PIN PB6
82 #define UART1_RX_PIN PB7
84 #define UART2_TX_PIN PA2
85 #define UART2_RX_PIN PA3
87 #define UART3_TX_PIN PB10
88 #define UART3_RX_PIN PB11
90 #define USE_I2C
91 #define USE_I2C_PULLUP
92 #define USE_I2C_DEVICE_2
93 #define I2C_DEVICE (I2CDEV_2)
94 #define I2C2_SCL PA9
95 #define I2C2_SDA PA10
97 #define USE_SPI
98 #define USE_SPI_DEVICE_3
100 #define SPI3_NSS_PIN PA15
101 #define SPI3_SCK_PIN PB3
102 #define SPI3_MISO_PIN PB4
103 #define SPI3_MOSI_PIN PB5
105 #define GYRO_1_CS_PIN SPI3_NSS_PIN
106 #define GYRO_1_SPI_INSTANCE SPI3
108 #define USE_ADC
110 #define ADC_INSTANCE ADC2
111 #define VBAT_ADC_PIN PA4
112 #define VBAT_SCALE_DEFAULT 20
114 #define BINDPLUG_PIN PB12
116 #define DEFAULT_FEATURES FEATURE_MOTOR_STOP
117 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
118 #define SERIALRX_UART SERIAL_PORT_USART2
120 // IO - stm32f303cc in 48pin package
121 #define TARGET_IO_PORTA 0xffff
122 #define TARGET_IO_PORTB 0xffff
123 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
124 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
126 #define USABLE_TIMER_CHANNEL_COUNT 11
127 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(8) | TIM_N(15) | TIM_N(16) | TIM_N(17) )