Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / src / main / target / VGOODRCF4 / target.h
blob0b6755ebf303356c948ca51260edd51c39d3fca1
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/>.
20 #pragma once
22 //#define USE_TARGET_CONFIG
23 #define TARGET_BOARD_IDENTIFIER "VGF4"
24 #define TARGET_MANUFACTURER_IDENTIFIER "VGRC"
25 #define USBD_PRODUCT_STRING "VGOODRCF4"
27 #define LED0_PIN PC14
28 #define LED1_PIN PC15
30 #define USE_BEEPER
31 #define BEEPER_PIN PC13
32 #define BEEPER_INVERTED
34 //#define ENABLE_DSHOT_DMAR true//debug for checking
36 #define GYRO_1_ALIGN CW180_DEG
38 #define USE_EXTI
39 #define USE_GYRO_EXTI
40 #define GYRO_1_EXTI_PIN PC3
42 #define USE_MPU_DATA_READY_SIGNAL
43 //#define ENSURE_MPU_DATA_READY_IS_LOW
45 #define USE_ACC
46 #define USE_ACC_SPI_MPU6000
47 #define USE_GYRO
48 #define USE_GYRO_SPI_MPU6000
50 #define GYRO_1_CS_PIN PA15
51 #define GYRO_1_SPI_INSTANCE SPI3
53 //-------------------------------------SPI2 FLASH------------------------------
54 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
55 #define USE_FLASHFS
56 #define USE_FLASH_M25P16
57 #define USE_FLASH_W25M512
58 #define FLASH_CS_PIN PB12
59 #define FLASH_SPI_INSTANCE SPI2
61 //-------------------------------------SPI1 OSD--------------------------------
62 #define USE_OSD
63 #define USE_MAX7456
64 #define MAX7456_SPI_INSTANCE SPI1
65 #define MAX7456_SPI_CS_PIN PA4
67 //-------------------------------------IIC2 BMP280------------------------------
68 #define USE_BARO
69 #define USE_BARO_BMP280
70 #define USE_BARO_MS5611
71 #define USE_BARO_BMP085
72 #define BARO_I2C_INSTANCE (I2CDEV_2)
73 #define DEFAULT_BARO_BMP280
75 //-------------------------------------IIC1 MAG5883------------------------------
76 #define MAG_I2C_INSTANCE (I2CDEV_1)
77 #define USE_MAG
78 #define USE_MAG_HMC5883
79 #define USE_MAG_QMC5883
80 #define USE_MAG_LIS3MDL
81 #define MAG_HMC5883_ALIGN CW90_DEG
83 //-------------------------------------USART-----------------------------------
84 #define USE_VCP
85 #define USE_USB_DETECT
86 #define USB_DETECT_PIN PC4
87 //usb-:pa11,usb+:pa12
89 #define USE_UART1
90 #define UART1_TX_PIN PB6
91 #define UART1_RX_PIN PB7
93 #define USE_UART2
94 #define UART2_TX_PIN PA2
95 #define UART2_RX_PIN PA3
97 #define USE_UART3
98 #define UART3_TX_PIN PC10
99 #define UART3_RX_PIN PC11
101 #define USE_UART4
102 #define UART4_TX_PIN PA0
103 #define UART4_RX_PIN PA1
105 #define USE_UART5
106 #define UART5_TX_PIN PC12
107 #define UART5_RX_PIN PD2
109 #define USE_UART6
110 #define UART6_TX_PIN PC6
111 #define UART6_RX_PIN PC7//RX(PPM/SBUS)
113 #define USE_SOFTSERIAL1
114 #define SOFTSERIAL1_RX_PIN PC5
115 #define SOFTSERIAL1_TX_PIN PB2
118 #define SERIAL_PORT_COUNT 8
120 //-------------------------------------ADC METERE------------------------------
121 #define USE_ADC
122 #define ADC_INSTANCE ADC2
123 #define ADC2_DMA_OPT 1
124 #define CURRENT_METER_ADC_PIN PC0
125 #define VBAT_ADC_PIN PC1
126 #define RSSI_ADC_PIN PC2
128 //---------------------------------VTX&&CAM------------------------------------
129 #define USE_PINIO
130 #define PINIO1_PIN PA13 // VTX power switcher
131 #define PINIO2_PIN PA14 // 2xCamera switcher
132 #define USE_PINIOBOX
134 //-------------------------------------SPI------------------------------------
135 #define USE_SPI
136 #define USE_SPI_DEVICE_3 //GYRO
137 #define SPI3_SCK_PIN PB3
138 #define SPI3_MISO_PIN PB4
139 #define SPI3_MOSI_PIN PB5
141 #define USE_SPI_DEVICE_2 // FLASH
142 #define SPI2_SCK_PIN PB13
143 #define SPI2_MISO_PIN PB14
144 #define SPI2_MOSI_PIN PB15
146 #define USE_SPI_DEVICE_1 //OSD
147 #define SPI1_SCK_PIN PA5
148 #define SPI1_MISO_PIN PA6
149 #define SPI1_MOSI_PIN PA7
151 //-------------------------------------IIC------------------------------------
152 #define USE_I2C //MAG5883
153 #define USE_I2C_DEVICE_1
154 //#define I2C_DEVICE (I2CDEV_1)
155 #define I2C1_SCL PB8
156 #define I2C1_SDA PB9
158 #define USE_I2C //BMP280
159 #define USE_I2C_DEVICE_2
160 //#define I2C_DEVICE (I2CDEV_2)
161 #define I2C2_SCL PB10
162 #define I2C2_SDA PB11
164 //-------------------------------------FEATURES-------------------------------
165 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY )
167 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
168 #define SERIALRX_PROVIDER SERIALRX_SBUS
169 #define SERIALRX_UART SERIAL_PORT_USART6
171 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
172 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
173 #define CURRENT_METER_SCALE_DEFAULT 179
175 #define USE_ESCSERIAL
177 //--------------------------------BOARD RESOURCES-----------------------------
178 #define TARGET_IO_PORTA 0xffff
179 #define TARGET_IO_PORTB 0xffff
180 #define TARGET_IO_PORTC 0xffff
181 #define TARGET_IO_PORTD 0x0007
183 #define USABLE_TIMER_CHANNEL_COUNT 8
184 #define USED_TIMERS (TIM_N(1)|TIM_N(3)|TIM_N(8))