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)
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/>.
22 #define TARGET_BOARD_IDENTIFIER "AFF4"
23 #define USE_TARGET_CONFIG
25 #define USE_HARDWARE_REVISION_DETECTION
28 #define USBD_PRODUCT_STRING "AlienFlight F4"
34 #define BEEPER_PIN PC13
35 #define BEEPER_INVERTED
37 #define INVERTER_PIN_UART2 PC15
42 #define GYRO_1_EXTI_PIN PC14
43 //#define DEBUG_MPU_DATA_READY_INTERRUPT
44 #define USE_MPU_DATA_READY_SIGNAL
45 #define ENSURE_MPU_DATA_READY_IS_LOW
47 #define GYRO_1_CS_PIN SPI1_NSS_PIN
48 #define GYRO_1_SPI_INSTANCE SPI1
51 #define USE_ACC_SPI_MPU6500
54 #define USE_GYRO_SPI_MPU6500
55 #define GYRO_1_ALIGN CW270_DEG
58 #define USE_MAG_HMC5883
59 #define USE_MAG_QMC5883
60 #define USE_MAG_AK8963
61 #define USE_MAG_LIS3MDL
63 #define MAG_AK8963_ALIGN CW180_DEG_FLIP
66 #define USE_BARO_MS5611
67 #define USE_BARO_BMP280
70 #define USE_SDCARD_SPI
71 #define SDCARD_DETECT_INVERTED
72 #define SDCARD_DETECT_PIN PB11
73 #define SDCARD_SPI_INSTANCE SPI2
74 #define SDCARD_SPI_CS_PIN PB10
75 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
77 // Performance logging for SD card operations:
78 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
80 #define FLASH_CS_PIN SPI2_NSS_PIN
81 #define FLASH_SPI_INSTANCE SPI2
84 #define USE_FLASH_M25P16
89 #define UART1_RX_PIN PA10
90 #define UART1_TX_PIN PA9
93 #define UART2_RX_PIN PA3
94 #define UART2_TX_PIN PA2 //inverter
97 //#define UART3_RX_PIN PB11
98 //#define UART3_TX_PIN PB10
101 #define UART4_RX_PIN PC11
102 #define UART4_TX_PIN PC10
104 #define USE_SOFTSERIAL1
105 #define USE_SOFTSERIAL2
107 #define SERIAL_PORT_COUNT 6
109 #define USE_ESCSERIAL
110 #define ESCSERIAL_TIMER_TX_PIN PA8 // (HARDARE=0,PPM)
113 #define USE_SPI_DEVICE_1
114 #define USE_SPI_DEVICE_2
115 #define USE_SPI_DEVICE_3
117 #define SPI1_NSS_PIN PA4
118 #define SPI1_SCK_PIN PA5
119 #define SPI1_MISO_PIN PA6
120 #define SPI1_MOSI_PIN PA7
122 #define SPI2_NSS_PIN PB12
123 #define SPI2_SCK_PIN PB13
124 #define SPI2_MISO_PIN PC2
125 #define SPI2_MOSI_PIN PC3
127 #define SPI3_NSS_PIN PA15
128 #define SPI3_SCK_PIN PB3
129 #define SPI3_MISO_PIN PB4
130 #define SPI3_MOSI_PIN PB5
133 #define USE_I2C_PULLUP
134 #define USE_I2C_DEVICE_1
135 #define I2C_DEVICE (I2CDEV_1)
140 #define ADC_INSTANCE ADC1 // Default added
141 #define ADC1_DMA_OPT 0 // DMA 2 Stream 0 Channel 0
143 //#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
144 //#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
145 #define VBAT_ADC_PIN PC0
146 #define CURRENT_METER_ADC_PIN PC1
147 #define RSSI_ADC_PIN PC4
148 #define EXTERNAL1_ADC_PIN PC5
150 #define CURRENT_METER_OFFSET_DEFAULT 2500 // ACS712/714-30A - 0A = 2.5V
151 #define CURRENT_METER_SCALE_DEFAULT -667 // ACS712/714-30A - 66.666 mV/A inverted mode
153 #define BINDPLUG_PIN PB2
155 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
157 #define DEFAULT_FEATURES (FEATURE_MOTOR_STOP)
158 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
159 #define SERIALRX_UART SERIAL_PORT_USART2
160 #define RX_CHANNELS_TAER
162 #define TARGET_IO_PORTA 0xffff
163 #define TARGET_IO_PORTB 0xffff
164 #define TARGET_IO_PORTC 0xffff
165 #define TARGET_IO_PORTD (BIT(2))
167 #define USABLE_TIMER_CHANNEL_COUNT 13
168 #define USED_TIMERS ( TIM_N(1) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) )