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
35 #define GYRO_INT_EXTI PC14
36 #define USE_MPU_DATA_READY_SIGNAL
37 #define ENSURE_MPU_DATA_READY_IS_LOW
39 #define MPU6500_CS_PIN SPI1_NSS_PIN
40 #define MPU6500_SPI_BUS BUS_SPI1
42 #define MPU9250_CS_PIN SPI1_NSS_PIN
43 #define MPU9250_SPI_BUS BUS_SPI1
45 #define USE_IMU_MPU6500
46 #define IMU_MPU6500_ALIGN CW270_DEG
48 #define USE_IMU_MPU9250
49 #define IMU_MPU9250_ALIGN CW270_DEG
52 #define MAG_I2C_BUS BUS_I2C1
53 #define USE_MAG_AK8963
54 #define USE_MAG_MPU9250
55 #define USE_MAG_HMC5883
56 #define USE_MAG_MAG3110
57 #define USE_MAG_QMC5883
58 #define USE_MAG_IST8310
59 #define USE_MAG_IST8308
60 #define USE_MAG_LIS3MDL
62 #define AK8963_CS_PIN PC15
63 #define AK8963_SPI_BUS BUS_SPI3
65 #define TEMPERATURE_I2C_BUS BUS_I2C1
66 #define BNO055_I2C_BUS BUS_I2C1
69 #define BARO_I2C_BUS BUS_I2C1
70 #define USE_BARO_MS5611
71 #define USE_BARO_BMP280
73 #define MS5611_CS_PIN SPI3_NSS_PIN
74 #define MS5611_SPI_BUS BUS_SPI3
76 #define BMP280_CS_PIN SPI3_NSS_PIN
77 #define BMP280_SPI_BUS BUS_SPI3
80 #define USE_SDCARD_SPI
81 #define SDCARD_DETECT_INVERTED
82 #define SDCARD_DETECT_PIN PB11
83 #define SDCARD_SPI_BUS BUS_SPI2
84 #define SDCARD_CS_PIN PB10
86 #define M25P16_CS_PIN SPI2_NSS_PIN
87 #define M25P16_SPI_BUS BUS_SPI2
90 #define USE_FLASH_M25P16
95 #define UART1_RX_PIN PA10
96 #define UART1_TX_PIN PA9
99 #define UART2_RX_PIN PA3
100 #define UART2_TX_PIN PA2
103 #define UART3_RX_PIN NONE
104 #define UART3_TX_PIN NONE
107 #define UART4_RX_PIN PC11
108 #define UART4_TX_PIN PC10
110 #define SERIAL_PORT_COUNT 5
112 //#define USE_ESCSERIAL
113 //#define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
116 #define USE_SPI_DEVICE_1
117 #define USE_SPI_DEVICE_2
118 #define USE_SPI_DEVICE_3
120 #define SPI1_NSS_PIN PA4
121 #define SPI1_SCK_PIN PA5
122 #define SPI1_MISO_PIN PA6
123 #define SPI1_MOSI_PIN PA7
125 #define SPI2_NSS_PIN PB12
126 #define SPI2_SCK_PIN PB13
127 #define SPI2_MISO_PIN PC2
128 #define SPI2_MOSI_PIN PC3
130 #define SPI3_NSS_PIN PA15
131 #define SPI3_SCK_PIN PB3
132 #define SPI3_MISO_PIN PB4
133 #define SPI3_MOSI_PIN PB5
136 #define USE_I2C_PULLUP
137 #define USE_I2C_DEVICE_1
142 #define MAX7456_SPI_BUS BUS_SPI3
143 #define MAX7456_CS_PIN PB12
144 //#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz // XXX
145 //#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST) // XXX
148 #define ADC1_DMA_STREAM DMA2_Stream0
149 #define ADC_CHANNEL_1_PIN PC0
150 #define ADC_CHANNEL_2_PIN PC1
151 #define ADC_CHANNEL_3_PIN PC4
153 #define VBAT_ADC_CHANNEL ADC_CHN_1
154 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
155 #define RSSI_ADC_CHANNEL ADC_CHN_3
157 //#define BOARD_HAS_VOLTAGE_DIVIDER
158 //#define BOARD_HAS_CURRENT_SENSOR
160 // LED strip configuration using RC1 pin.
161 #define USE_LED_STRIP
162 // LED Strip can run off Pin 41 (PA8) of the ESC outputs.
163 #define WS2811_PIN PA8
165 #define USE_SPEKTRUM_BIND
167 #define BIND_PIN UART2_RX_PIN
169 #define HARDWARE_BIND_PLUG
170 // Hardware bind plug at PB2 (Pin 28)
171 #define BINDPLUG_PIN PB2
173 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
175 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_MOTOR_STOP | FEATURE_BLACKBOX)
176 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
177 #define SERIALRX_UART SERIAL_PORT_USART2
178 #define RX_CHANNELS_TAER
180 #define TELEMETRY_UART SERIAL_PORT_USART1
182 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
184 // Number of available PWM outputs
185 #define MAX_PWM_OUTPUT_PORTS 12
187 #define TARGET_IO_PORTA 0xffff
188 #define TARGET_IO_PORTB 0xffff
189 #define TARGET_IO_PORTC 0xffff
190 #define TARGET_IO_PORTD (BIT(2))