Merge pull request #11297 from SteveCEvans/baro_state
[betaflight.git] / src / main / target / ALIENFLIGHTNGF7 / target.h
blobdc586bc827f7546937f7f825a7c1623e64a60c27
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
22 #define TARGET_BOARD_IDENTIFIER "AFF7"
23 #define USE_TARGET_CONFIG
25 #define USE_HARDWARE_REVISION_DETECTION
26 #define HW_PIN PC13
28 #define USBD_PRODUCT_STRING "AlienFlightNG F7"
30 #define LED0_PIN PC12
31 #define LED1_PIN PD2
33 #define USE_BEEPER
34 #define BEEPER_PIN PC13
35 #define BEEPER_INVERTED
37 // MPU interrupt
38 #define USE_EXTI
39 #define USE_GYRO_EXTI
40 #define GYRO_1_EXTI_PIN PC14
41 #define USE_MPU_DATA_READY_SIGNAL
42 #define ENSURE_MPU_DATA_READY_IS_LOW
44 #define GYRO_1_CS_PIN SPI1_NSS_PIN
45 #define GYRO_1_SPI_INSTANCE SPI1
47 #define USE_ACC
48 #define USE_ACC_SPI_MPU6500
50 #define USE_GYRO
51 #define USE_GYRO_SPI_MPU6500
52 #define GYRO_1_ALIGN CW270_DEG
54 #define USE_MAG
55 #define USE_MAG_HMC5883
56 #define USE_MAG_SPI_HMC5883
57 #define USE_MAG_QMC5883
58 #define USE_MAG_AK8963
59 #define USE_MAG_SPI_AK8963
60 #define USE_MAG_LIS3MDL
62 #define MAG_CS_PIN PC15
63 #define MAG_SPI_INSTANCE SPI3
65 #define MAG_AK8963_ALIGN CW180_DEG_FLIP
67 #define USE_BARO
68 #define USE_BARO_MS5611
69 #define USE_BARO_SPI_MS5611
70 #define USE_BARO_BMP280
71 #define USE_BARO_SPI_BMP280
73 #define BARO_CS_PIN SPI3_NSS_PIN
74 #define BARO_SPI_INSTANCE SPI3
76 #define USE_SDCARD
77 #define USE_SDCARD_SPI
78 #define SDCARD_DETECT_INVERTED
79 #define SDCARD_DETECT_PIN PB11
80 #define SDCARD_SPI_INSTANCE SPI2
81 #define SDCARD_SPI_CS_PIN PB10
82 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
84 // Performance logging for SD card operations:
85 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
87 #define FLASH_CS_PIN SPI2_NSS_PIN
88 #define FLASH_SPI_INSTANCE SPI2
90 #define USE_FLASHFS
91 #define USE_FLASH_TOOLS
92 #define USE_FLASH_M25P16
93 #define USE_FLASH_W25N01G
94 #define USE_FLASH_W25M02G
96 #define USE_VCP
98 #define USE_UART1
99 #define UART1_RX_PIN PA10
100 #define UART1_TX_PIN PA9
102 #define USE_UART2
103 #define UART2_RX_PIN PA3
104 #define UART2_TX_PIN PA2
106 #define USE_UART3
107 #define UART3_RX_PIN NONE
108 #define UART3_TX_PIN NONE
110 #define USE_UART4
111 #define UART4_RX_PIN PC11
112 #define UART4_TX_PIN PC10
114 #define USE_SOFTSERIAL1
115 #define USE_SOFTSERIAL2
117 #define SERIAL_PORT_COUNT 7
119 #define USE_ESCSERIAL
120 #define ESCSERIAL_TIMER_TX_PIN PA8 // (Hardware=0, PPM/LED_STRIP) XXX Crash if using an LED strip.
122 #define USE_SPI
123 #define USE_SPI_DEVICE_1
124 #define USE_SPI_DEVICE_2
125 #define USE_SPI_DEVICE_3
127 #define SPI1_NSS_PIN PA4
128 #define SPI1_SCK_PIN PA5
129 #define SPI1_MISO_PIN PA6
130 #define SPI1_MOSI_PIN PA7
132 #define SPI2_NSS_PIN PB12
133 #define SPI2_SCK_PIN PB13
134 #define SPI2_MISO_PIN PC2
135 #define SPI2_MOSI_PIN PC3
137 #define SPI3_NSS_PIN PA15
138 #define SPI3_SCK_PIN PB3
139 #define SPI3_MISO_PIN PB4
140 #define SPI3_MOSI_PIN PB5
142 #define USE_I2C
143 #define USE_I2C_PULLUP
144 #define USE_I2C_DEVICE_1
145 #define I2C_DEVICE (I2CDEV_1)
146 #define I2C1_SCL PB6
147 #define I2C1_SDA PB7
149 #define USE_MAX7456
150 #define MAX7456_SPI_INSTANCE SPI3
151 #define MAX7456_SPI_CS_PIN PB12
153 #define USE_ADC
154 #define ADC_INSTANCE ADC1 // Default added
155 #define ADC1_DMA_OPT 0 // DMA 2 Stream 0 Channel 0
157 //#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
158 //#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
159 #define VBAT_ADC_PIN PC0
160 #define CURRENT_METER_ADC_PIN PC1
161 #define RSSI_ADC_PIN PC4
163 #define CURRENT_METER_OFFSET_DEFAULT 2500 // ACS712/714-30A - 0A = 2.5V
164 #define CURRENT_METER_SCALE_DEFAULT -667 // ACS712/714-30A - 66.666 mV/A inverted mode
166 #define BINDPLUG_PIN PB2
168 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
170 #define DEFAULT_FEATURES (FEATURE_MOTOR_STOP)
171 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
172 #define SERIALRX_UART SERIAL_PORT_USART2
173 #define RX_CHANNELS_TAER
175 #define TARGET_IO_PORTA 0xffff
176 #define TARGET_IO_PORTB 0xffff
177 #define TARGET_IO_PORTC 0xffff
178 #define TARGET_IO_PORTD (BIT(2))
180 #define USABLE_TIMER_CHANNEL_COUNT 13
181 #define USED_TIMERS ( TIM_N(1) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) )