Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / target / ALIENFLIGHTF4 / target.h
blob52cd4cf4a9d9c08c144a73b454c52a01ff21ae80
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
19 #define TARGET_BOARD_IDENTIFIER "AFF4"
21 #define USE_HARDWARE_REVISION_DETECTION
22 #define HW_PIN PC13
23 #define USE_BRUSHED_ESC_AUTODETECT
25 #define USBD_PRODUCT_STRING "AlienFlight F4"
27 #define LED0 PC12
28 #define LED1 PD2
30 #define BEEPER PC13
31 #define BEEPER_INVERTED
33 #define INVERTER_PIN_USART2 PC15
35 #define MPU6500_CS_PIN SPI1_NSS_PIN
36 #define MPU6500_SPI_BUS BUS_SPI1
38 #define MPU9250_CS_PIN SPI1_NSS_PIN
39 #define MPU9250_SPI_BUS BUS_SPI1
41 #define USE_IMU_MPU6500
42 #define IMU_MPU6500_ALIGN CW270_DEG
43 #define USE_IMU_MPU9250
44 #define IMU_MPU9250_ALIGN CW270_DEG
47 #define USE_MAG
48 #define MAG_I2C_BUS BUS_I2C1
49 #define USE_MAG_ALL
51 #define TEMPERATURE_I2C_BUS BUS_I2C1
53 #define USE_BARO
54 #define BARO_I2C_BUS BUS_I2C1
55 #define USE_BARO_MS5611
56 #define USE_BARO_BMP280
58 #define USE_SDCARD
59 #define USE_SDCARD_SPI
60 #define SDCARD_DETECT_INVERTED
61 #define SDCARD_DETECT_PIN PB11
62 #define SDCARD_SPI_BUS BUS_SPI2
63 #define SDCARD_CS_PIN PB10
65 //#define M25P16_CS_PIN SPI2_NSS_PIN
66 //#define M25P16_SPI_BUS BUS_SPI2
68 //#define USE_FLASHFS
69 //#define USE_FLASH_M25P16
71 #define USE_VCP
73 #define USE_UART1
74 #define UART1_RX_PIN PA10
75 #define UART1_TX_PIN PA9
77 #define USE_UART2
78 #define UART2_RX_PIN PA3
79 #define UART2_TX_PIN PA2 //inverter
81 //#define USE_UART3
82 //#define UART3_RX_PIN PB11
83 //#define UART3_TX_PIN PB10
85 #define USE_UART4
86 #define UART4_RX_PIN PC11
87 #define UART4_TX_PIN PC10
89 #define SERIAL_PORT_COUNT 4
91 #define USE_ESCSERIAL
92 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
94 #define USE_SPI
95 #define USE_SPI_DEVICE_1
96 #define USE_SPI_DEVICE_2
97 #define USE_SPI_DEVICE_3
99 #define SPI1_NSS_PIN PA4
100 #define SPI1_SCK_PIN PA5
101 #define SPI1_MISO_PIN PA6
102 #define SPI1_MOSI_PIN PA7
104 #define SPI2_NSS_PIN PB12
105 #define SPI2_SCK_PIN PB13
106 #define SPI2_MISO_PIN PC2
107 #define SPI2_MOSI_PIN PC3
109 #define SPI3_NSS_PIN PA15
110 #define SPI3_SCK_PIN PB3
111 #define SPI3_MISO_PIN PB4
112 #define SPI3_MOSI_PIN PB5
114 #define USE_I2C
115 #define USE_I2C_DEVICE_1
116 #define USE_I2C_PULLUP
117 #define I2C1_SCL PB6
118 #define I2C1_SDA PB7
120 #define USE_ADC
121 #define ADC1_DMA_STREAM DMA2_Stream0
122 #define ADC_CHANNEL_1_PIN PC0
123 #define ADC_CHANNEL_2_PIN PC1
124 #define ADC_CHANNEL_3_PIN PC4
125 #define ADC_CHANNEL_4_PIN PC5
127 #define VBAT_ADC_CHANNEL ADC_CHN_1
128 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
129 #define RSSI_ADC_CHANNEL ADC_CHN_3
131 //#define BOARD_HAS_VOLTAGE_DIVIDER
132 //#define BOARD_HAS_CURRENT_SENSOR
134 // LED strip configuration using RC1 pin.
135 #define USE_LED_STRIP
136 // LED Strip can run off Pin 41 (PA8) of the ESC outputs.
137 #define WS2811_PIN PA8
139 #define USE_SPEKTRUM_BIND
140 // USART2, PA3
141 #define BIND_PIN UART2_RX_PIN
143 #define HARDWARE_BIND_PLUG
144 // Hardware bind plug at PB2 (Pin 28)
145 #define BINDPLUG_PIN PB2
147 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
149 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
150 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
151 #define SERIALRX_UART SERIAL_PORT_USART2
152 #define RX_CHANNELS_TAER
154 #define TELEMETRY_UART SERIAL_PORT_USART1
156 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
158 // Number of available PWM outputs
159 #define MAX_PWM_OUTPUT_PORTS 12
161 #define TARGET_IO_PORTA 0xffff
162 #define TARGET_IO_PORTB 0xffff
163 #define TARGET_IO_PORTC 0xffff
164 #define TARGET_IO_PORTD (BIT(2))