Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / src / main / target / BETAFPVF4SX1280 / target.h
blob5758ec5f05147f4bb05a81b1a577d057b2bfe45b
2 /*
3 * This file is part of Cleanflight and Betaflight.
5 * Cleanflight and Betaflight are free software. You can redistribute
6 * this software and/or modify this software under the terms of the
7 * GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option)
9 * any later version.
11 * Cleanflight and Betaflight are distributed in the hope that they
12 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
13 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this software.
19 * If not, see <http://www.gnu.org/licenses/>.
22 #pragma once
24 #define TARGET_BOARD_IDENTIFIER "BHER"
25 #define USBD_PRODUCT_STRING "BETAFPVF4SX1280"
27 #define LED0_PIN PC14
29 #define USE_BEEPER
30 #define BEEPER_PIN PA14
31 #define BEEPER_INVERTED
33 #define USE_UART
35 #define USE_SOFTSERIAL1
36 #define SOFTSERIAL1_TX_PIN PA8
37 #define SOFTSERIAL1_RX_PIN PA8
39 #define USE_UART1
40 #define UART1_RX_PIN PA10
41 #define UART1_TX_PIN PA9
43 #define USE_UART2
44 #define UART2_RX_PIN PA3
45 #define UART2_TX_PIN PA2
47 #define USE_VCP
49 #define SERIAL_PORT_COUNT 4
51 #define USE_SPI
53 #define USE_SPI_DEVICE_1
54 #define SPI1_SCK_PIN PA5
55 #define SPI1_MISO_PIN PA6
56 #define SPI1_MOSI_PIN PA7
57 #define SPI1_NSS_PIN PA4
59 #define USE_SPI_DEVICE_2
60 #define SPI2_SCK_PIN PB13
61 #define SPI2_MISO_PIN PB14
62 #define SPI2_MOSI_PIN PB15
63 #define SPI2_NSS_PIN PB12
65 #define USE_SPI_DEVICE_3
66 #define SPI3_SCK_PIN PB3
67 #define SPI3_MISO_PIN PB4
68 #define SPI3_MOSI_PIN PB5
70 #define USE_GYRO
71 #define USE_ACC
73 //MPU6000
74 #define USE_GYRO_SPI_MPU6000
75 #define USE_ACC_SPI_MPU6000
77 // ICM-20689
78 #define USE_ACC_SPI_ICM20689
79 #define USE_GYRO_SPI_ICM20689
81 #define USE_EXTI
82 #define USE_GYRO_EXTI
83 #define GYRO_1_EXTI_PIN PB6
84 #define USE_MPU_DATA_READY_SIGNAL
85 #define ENSURE_MPU_DATA_READY_IS_LOW
87 #define GYRO_1_CS_PIN SPI1_NSS_PIN
88 #define GYRO_1_SPI_INSTANCE SPI1
89 #define GYRO_1_ALIGN CW90_DEG
91 #define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
93 #define USE_MAX7456
94 #define MAX7456_SPI_INSTANCE SPI2
95 #define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
97 #define USE_RX_SPI
98 #define RX_SPI_INSTANCE SPI3
99 #define RX_SPI_LED_INVERTED
101 #define DEFAULT_RX_FEATURE FEATURE_RX_SPI
102 #define RX_SPI_DEFAULT_PROTOCOL RX_SPI_EXPRESSLRS
104 #define USE_RX_EXPRESSLRS
105 #define USE_RX_EXPRESSLRS_TELEMETRY
106 #define USE_RX_SX1280
107 #define RX_CHANNELS_AETR
108 #define RX_SPI_BIND_PIN PB2
109 #define RX_NSS_PIN PA15
110 #define RX_SPI_LED_PIN PC15
111 #define RX_SPI_EXTI_PIN PC13
112 #define RX_EXPRESSLRS_SPI_RESET_PIN PB9
113 #define RX_EXPRESSLRS_SPI_BUSY_PIN PA13
114 #define RX_EXPRESSLRS_TIMER_INSTANCE TIM5
117 #define ADC1_DMA_OPT 0
119 #define USE_ADC
120 #define USE_ADC_INTERNAL
122 #define ADC1_INSTANCE ADC1
124 #define VBAT_ADC_PIN PA1
125 #define CURRENT_METER_ADC_PIN PB0
127 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
128 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
130 #define VBAT_SCALE_DEFAULT 110
131 #define CURRENT_METER_SCALE_DEFAULT 800
133 #define DEFAULT_FEATURES (FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP |FEATURE_SOFTSERIAL)
135 #define USE_ESCSERIAL
136 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_AUTO
137 #define DSHOT_BITBANG_DEFAULT DSHOT_BITBANG_OFF
139 #define TARGET_IO_PORTA 0xffff
140 #define TARGET_IO_PORTB 0xffff
141 #define TARGET_IO_PORTC 0xffff
142 #define TARGET_IO_PORTD (BIT(2))
144 #define USABLE_TIMER_CHANNEL_COUNT 7
146 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4))