[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / ALIENFLIGHTF3 / target.h
blobba8de96eeaf657d600b678c97635b8fce785c4b4
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/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "AFF3" // ALIENFLIGHT F3
22 #define USE_HARDWARE_REVISION_DETECTION
23 #define HW_PIN PB2
24 #define BRUSHED_ESC_AUTODETECT
26 // LED's V1
27 #define LED0 PB4
28 #define LED1 PB5
30 // LED's V2
31 #define LED0_A PB8
32 #define LED1_A PB9
34 #define BEEPER PA5
36 #define USE_EXTI
37 #define USE_MPU_DATA_READY_SIGNAL
38 //#define DEBUG_MPU_DATA_READY_INTERRUPT
40 // Using MPU6050 for the moment.
41 #define USE_IMU_MPU6050
42 #define IMU_MPU6050_ALIGN CW270_DEG
43 #define MPU6050_I2C_BUS BUS_I2C2
45 #define USE_IMU_MPU6500
46 #define IMU_MPU6500_ALIGN CW270_DEG
47 #define MPU6500_CS_PIN PA15
48 #define MPU6500_SPI_BUS BUS_SPI3
50 #define USE_IMU_MPU9250
51 #define IMU_MPU9250_ALIGN CW270_DEG
52 #define MPU9250_CS_PIN PA15
53 #define MPU9250_SPI_BUS BUS_SPI3
55 // No baro support.
56 //#define USE_BARO
57 //#define USE_BARO_MS5611
59 // option to use MPU9150 or MPU9250 integrated AK89xx Mag
60 #define USE_MAG
61 #define MAG_I2C_BUS BUS_I2C2
62 #define USE_MAG_MPU9250
63 #define MAG_MPU9250_ALIGN CW0_DEG
64 #define USE_MAG_AK8963
65 #define USE_MAG_AK8975
66 #define USE_MAG_HMC5883
67 #define USE_MAG_MAG3110
68 #define USE_MAG_QMC5883
69 #define USE_MAG_IST8310
70 #define USE_MAG_IST8308
71 #define USE_MAG_LIS3MDL
73 #define USE_VCP
74 #define USE_UART1 // Not connected - TX (PB6) RX PB7 (AF7)
75 #define USE_UART2 // Receiver - RX (PA3)
76 #define USE_UART3 // Not connected - 10/RX (PB11) 11/TX (PB10)
77 #define SERIAL_PORT_COUNT 4
78 #define AVOID_UART2_FOR_PWM_PPM
80 #define UART1_TX_PIN PB6
81 #define UART1_RX_PIN PB7
83 #define UART2_TX_PIN PA2
84 #define UART2_RX_PIN PA3
86 #define UART3_TX_PIN PB10
87 #define UART3_RX_PIN PB11
89 #define USE_I2C
90 #define USE_I2C_PULLUP
91 #define USE_I2C_DEVICE_2 // SDA (PA10/AF4), SCL (PA9/AF4)
92 #define I2C2_SCL PA9
93 #define I2C2_SDA PA10
95 // SPI3
96 // PA15 38 SPI3_NSS
97 // PB3 39 SPI3_SCK
98 // PB4 40 SPI3_MISO
99 // PB5 41 SPI3_MOSI
101 #define USE_SPI
102 #define USE_SPI_DEVICE_3
104 #define USE_ADC
105 #define ADC_INSTANCE ADC2
106 #define ADC_CHANNEL_1_PIN PA4
107 #define VBAT_ADC_CHANNEL ADC_CHN_1
108 #define VBAT_SCALE_DEFAULT 20
110 #define USE_SPEKTRUM_BIND
111 // USART2, PA3
112 #define BIND_PIN PA3
114 #define HARDWARE_BIND_PLUG
115 // Hardware bind plug at PB12 (Pin 25)
116 #define BINDPLUG_PIN PB12
119 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_MOTOR_STOP)
120 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
121 #define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048
122 #define SERIALRX_UART SERIAL_PORT_USART3
123 #define RX_CHANNELS_TAER
125 // Number of available PWM outputs
126 #define MAX_PWM_OUTPUT_PORTS 10
128 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
130 // IO - assuming 303 in 64pin package, TODO
131 #define TARGET_IO_PORTA 0xffff
132 #define TARGET_IO_PORTB 0xffff
133 #define TARGET_IO_PORTC 0xffff
134 #define TARGET_IO_PORTD (BIT(2))
135 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
137 #define PCA9685_I2C_BUS BUS_I2C2