Merge pull request #11270 from haslinghuis/rename_attr
[betaflight.git] / src / main / target / ALIENFLIGHTF4 / target.h
blob19cdb4364982c212578d56de66352af0eb485915
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 "AFF4"
23 #define USE_TARGET_CONFIG
25 #define USE_HARDWARE_REVISION_DETECTION
26 #define HW_PIN PC13
28 #define USBD_PRODUCT_STRING "AlienFlight F4"
30 #define LED0_PIN PC12
31 #define LED1_PIN PD2
33 #define USE_BEEPER
34 #define BEEPER_PIN PC13
35 #define BEEPER_INVERTED
37 #define INVERTER_PIN_UART2 PC15
39 // MPU interrupt
40 #define USE_EXTI
41 #define USE_GYRO_EXTI
42 #define GYRO_1_EXTI_PIN PC14
43 #define USE_MPU_DATA_READY_SIGNAL
44 #define ENSURE_MPU_DATA_READY_IS_LOW
46 #define GYRO_1_CS_PIN SPI1_NSS_PIN
47 #define GYRO_1_SPI_INSTANCE SPI1
49 #define USE_ACC
50 #define USE_ACC_SPI_MPU6500
52 #define USE_GYRO
53 #define USE_GYRO_SPI_MPU6500
54 #define GYRO_1_ALIGN CW270_DEG
56 #define USE_MAG
57 #define USE_MAG_HMC5883
58 #define USE_MAG_QMC5883
59 #define USE_MAG_AK8963
60 #define USE_MAG_LIS3MDL
62 #define MAG_AK8963_ALIGN CW180_DEG_FLIP
64 #define USE_BARO
65 #define USE_BARO_MS5611
66 #define USE_BARO_BMP280
68 #define USE_SDCARD
69 #define USE_SDCARD_SPI
70 #define SDCARD_DETECT_INVERTED
71 #define SDCARD_DETECT_PIN PB11
72 #define SDCARD_SPI_INSTANCE SPI2
73 #define SDCARD_SPI_CS_PIN PB10
74 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
76 // Performance logging for SD card operations:
77 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
79 #define FLASH_CS_PIN SPI2_NSS_PIN
80 #define FLASH_SPI_INSTANCE SPI2
82 #define USE_FLASHFS
83 #define USE_FLASH_M25P16
85 #define USE_VCP
87 #define USE_UART1
88 #define UART1_RX_PIN PA10
89 #define UART1_TX_PIN PA9
91 #define USE_UART2
92 #define UART2_RX_PIN PA3
93 #define UART2_TX_PIN PA2 //inverter
95 //#define USE_UART3
96 //#define UART3_RX_PIN PB11
97 //#define UART3_TX_PIN PB10
99 #define USE_UART4
100 #define UART4_RX_PIN PC11
101 #define UART4_TX_PIN PC10
103 #define USE_SOFTSERIAL1
104 #define USE_SOFTSERIAL2
106 #define SERIAL_PORT_COUNT 6
108 #define USE_ESCSERIAL
109 #define ESCSERIAL_TIMER_TX_PIN PA8 // (HARDARE=0,PPM)
111 #define USE_SPI
112 #define USE_SPI_DEVICE_1
113 #define USE_SPI_DEVICE_2
114 #define USE_SPI_DEVICE_3
116 #define SPI1_NSS_PIN PA4
117 #define SPI1_SCK_PIN PA5
118 #define SPI1_MISO_PIN PA6
119 #define SPI1_MOSI_PIN PA7
121 #define SPI2_NSS_PIN PB12
122 #define SPI2_SCK_PIN PB13
123 #define SPI2_MISO_PIN PC2
124 #define SPI2_MOSI_PIN PC3
126 #define SPI3_NSS_PIN PA15
127 #define SPI3_SCK_PIN PB3
128 #define SPI3_MISO_PIN PB4
129 #define SPI3_MOSI_PIN PB5
131 #define USE_I2C
132 #define USE_I2C_PULLUP
133 #define USE_I2C_DEVICE_1
134 #define I2C_DEVICE (I2CDEV_1)
135 #define I2C1_SCL PB6
136 #define I2C1_SDA PB7
138 #define USE_ADC
139 #define ADC_INSTANCE ADC1 // Default added
140 #define ADC1_DMA_OPT 0 // DMA 2 Stream 0 Channel 0
142 //#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
143 //#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
144 #define VBAT_ADC_PIN PC0
145 #define CURRENT_METER_ADC_PIN PC1
146 #define RSSI_ADC_PIN PC4
147 #define EXTERNAL1_ADC_PIN PC5
149 #define CURRENT_METER_OFFSET_DEFAULT 2500 // ACS712/714-30A - 0A = 2.5V
150 #define CURRENT_METER_SCALE_DEFAULT -667 // ACS712/714-30A - 66.666 mV/A inverted mode
152 #define BINDPLUG_PIN PB2
154 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
156 #define DEFAULT_FEATURES (FEATURE_MOTOR_STOP)
157 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
158 #define SERIALRX_UART SERIAL_PORT_USART2
159 #define RX_CHANNELS_TAER
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))
166 #define USABLE_TIMER_CHANNEL_COUNT 13
167 #define USED_TIMERS ( TIM_N(1) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) )