add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / ALIENFLIGHTF3 / target.h
blob7b5349533c9ebb79bb87eba6a6203c48c1f83ec5
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 USE_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 USE_MAG_AK8963
64 #define USE_MAG_AK8975
65 #define USE_MAG_HMC5883
66 #define USE_MAG_MAG3110
67 #define USE_MAG_QMC5883
68 #define USE_MAG_IST8310
69 #define USE_MAG_IST8308
70 #define USE_MAG_LIS3MDL
72 #define USE_VCP
73 #define USE_UART1 // Not connected - TX (PB6) RX PB7 (AF7)
74 #define USE_UART2 // Receiver - RX (PA3)
75 #define USE_UART3 // Not connected - 10/RX (PB11) 11/TX (PB10)
76 #define SERIAL_PORT_COUNT 4
78 #define UART1_TX_PIN PB6
79 #define UART1_RX_PIN PB7
81 #define UART2_TX_PIN PA2
82 #define UART2_RX_PIN PA3
84 #define UART3_TX_PIN PB10
85 #define UART3_RX_PIN PB11
87 #define USE_I2C
88 #define USE_I2C_PULLUP
89 #define USE_I2C_DEVICE_2 // SDA (PA10/AF4), SCL (PA9/AF4)
90 #define I2C2_SCL PA9
91 #define I2C2_SDA PA10
93 // SPI3
94 // PA15 38 SPI3_NSS
95 // PB3 39 SPI3_SCK
96 // PB4 40 SPI3_MISO
97 // PB5 41 SPI3_MOSI
99 #define USE_SPI
100 #define USE_SPI_DEVICE_3
102 #define USE_ADC
103 #define ADC_INSTANCE ADC2
104 #define ADC_CHANNEL_1_PIN PA4
105 #define VBAT_ADC_CHANNEL ADC_CHN_1
106 #define VBAT_SCALE_DEFAULT 20
108 #define USE_SPEKTRUM_BIND
109 // USART2, PA3
110 #define BIND_PIN PA3
112 #define HARDWARE_BIND_PLUG
113 // Hardware bind plug at PB12 (Pin 25)
114 #define BINDPLUG_PIN PB12
117 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_MOTOR_STOP)
118 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
119 #define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048
120 #define SERIALRX_UART SERIAL_PORT_USART3
121 #define RX_CHANNELS_TAER
123 // Number of available PWM outputs
124 #define MAX_PWM_OUTPUT_PORTS 10
126 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
128 // IO - assuming 303 in 64pin package, TODO
129 #define TARGET_IO_PORTA 0xffff
130 #define TARGET_IO_PORTB 0xffff
131 #define TARGET_IO_PORTC 0xffff
132 #define TARGET_IO_PORTD (BIT(2))
133 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
135 #define PCA9685_I2C_BUS BUS_I2C2