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/>.
19 #define TARGET_BOARD_IDENTIFIER "AFF7"
21 #define USE_HARDWARE_REVISION_DETECTION
23 #define USE_BRUSHED_ESC_AUTODETECT
25 #define USBD_PRODUCT_STRING "AlienFlightNG F7"
31 #define BEEPER_INVERTED
33 #define MPU6500_CS_PIN SPI1_NSS_PIN
34 #define MPU6500_SPI_BUS BUS_SPI1
36 #define MPU9250_CS_PIN SPI1_NSS_PIN
37 #define MPU9250_SPI_BUS BUS_SPI1
39 #define USE_IMU_MPU6500
40 #define IMU_MPU6500_ALIGN CW270_DEG
42 #define USE_IMU_MPU9250
43 #define IMU_MPU9250_ALIGN CW270_DEG
46 #define MAG_I2C_BUS BUS_I2C1
49 #define AK8963_CS_PIN PC15
50 #define AK8963_SPI_BUS BUS_SPI3
52 #define TEMPERATURE_I2C_BUS BUS_I2C1
55 #define BARO_I2C_BUS BUS_I2C1
56 #define USE_BARO_MS5611
57 #define USE_BARO_BMP280
59 #define MS5611_CS_PIN SPI3_NSS_PIN
60 #define MS5611_SPI_BUS BUS_SPI3
62 #define BMP280_CS_PIN SPI3_NSS_PIN
63 #define BMP280_SPI_BUS BUS_SPI3
66 #define USE_SDCARD_SPI
67 #define SDCARD_DETECT_INVERTED
68 #define SDCARD_DETECT_PIN PB11
69 #define SDCARD_SPI_BUS BUS_SPI2
70 #define SDCARD_CS_PIN PB10
72 #define M25P16_CS_PIN SPI2_NSS_PIN
73 #define M25P16_SPI_BUS BUS_SPI2
76 #define USE_FLASH_M25P16
81 #define UART1_RX_PIN PA10
82 #define UART1_TX_PIN PA9
85 #define UART2_RX_PIN PA3
86 #define UART2_TX_PIN PA2
89 #define UART3_RX_PIN NONE
90 #define UART3_TX_PIN NONE
93 #define UART4_RX_PIN PC11
94 #define UART4_TX_PIN PC10
96 #define SERIAL_PORT_COUNT 5
98 //#define USE_ESCSERIAL
99 //#define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
102 #define USE_SPI_DEVICE_1
103 #define USE_SPI_DEVICE_2
104 #define USE_SPI_DEVICE_3
106 #define SPI1_NSS_PIN PA4
107 #define SPI1_SCK_PIN PA5
108 #define SPI1_MISO_PIN PA6
109 #define SPI1_MOSI_PIN PA7
111 #define SPI2_NSS_PIN PB12
112 #define SPI2_SCK_PIN PB13
113 #define SPI2_MISO_PIN PC2
114 #define SPI2_MOSI_PIN PC3
116 #define SPI3_NSS_PIN PA15
117 #define SPI3_SCK_PIN PB3
118 #define SPI3_MISO_PIN PB4
119 #define SPI3_MOSI_PIN PB5
122 #define USE_I2C_PULLUP
123 #define USE_I2C_DEVICE_1
128 #define MAX7456_SPI_BUS BUS_SPI3
129 #define MAX7456_CS_PIN PB12
130 //#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz // XXX
131 //#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST) // XXX
134 #define ADC1_DMA_STREAM DMA2_Stream0
135 #define ADC_CHANNEL_1_PIN PC0
136 #define ADC_CHANNEL_2_PIN PC1
137 #define ADC_CHANNEL_3_PIN PC4
139 #define VBAT_ADC_CHANNEL ADC_CHN_1
140 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
141 #define RSSI_ADC_CHANNEL ADC_CHN_3
143 //#define BOARD_HAS_VOLTAGE_DIVIDER
144 //#define BOARD_HAS_CURRENT_SENSOR
146 // LED strip configuration using RC1 pin.
147 #define USE_LED_STRIP
148 // LED Strip can run off Pin 41 (PA8) of the ESC outputs.
149 #define WS2811_PIN PA8
151 #define USE_SPEKTRUM_BIND
153 #define BIND_PIN UART2_RX_PIN
155 #define HARDWARE_BIND_PLUG
156 // Hardware bind plug at PB2 (Pin 28)
157 #define BINDPLUG_PIN PB2
159 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
161 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
162 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
163 #define SERIALRX_UART SERIAL_PORT_USART2
164 #define RX_CHANNELS_TAER
166 #define TELEMETRY_UART SERIAL_PORT_USART1
168 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
170 // Number of available PWM outputs
171 #define MAX_PWM_OUTPUT_PORTS 12
173 #define TARGET_IO_PORTA 0xffff
174 #define TARGET_IO_PORTB 0xffff
175 #define TARGET_IO_PORTC 0xffff
176 #define TARGET_IO_PORTD (BIT(2))