Update DPS310 driver to support SPL07-003
[inav.git] / src / main / target / YUPIF4 / target.h
blob6a7bb7d545f8e0a89061effa1e5292705e4d146c
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
20 #if defined (YUPIF4R2)
21 #define TARGET_BOARD_IDENTIFIER "YPF4R2"
22 #define USBD_PRODUCT_STRING "YUPIF4R2"
23 #elif (YUPIF4MINI)
24 #define TARGET_BOARD_IDENTIFIER "YPF4M"
25 #define USBD_PRODUCT_STRING "YUPIF4MINI"
26 #else
27 #define TARGET_BOARD_IDENTIFIER "YPF4"
28 #define USBD_PRODUCT_STRING "YUPIF4"
29 #endif
31 #define LED0 PB6
32 #define LED1 PB4
34 #if defined(YUPIF4R2)
35 #define BEEPER PB14
36 #else
37 #define BEEPER PC9
38 #endif
40 #if defined(YUPIF4MINI)
41 // #define BEEPER_INVERTED
42 #else
43 #define BEEPER_INVERTED
44 #define BEEPER_PWM_FREQUENCY 3150
45 #endif
47 #define MPU6500_CS_PIN SPI1_NSS_PIN
48 #define MPU6500_SPI_BUS BUS_SPI1
50 #define USE_IMU_MPU6500
51 #define IMU_MPU6500_ALIGN CW90_DEG
53 #define USE_I2C
54 #define USE_I2C_DEVICE_2
55 #define I2C1_SCL PB10
56 #define I2C1_SDA PB11
58 #define USE_MAG
59 #define MAG_I2C_BUS BUS_I2C2
60 #define USE_MAG_ALL
62 #define TEMPERATURE_I2C_BUS BUS_I2C2
64 #define USE_BARO
65 #define BARO_I2C_BUS BUS_I2C2
66 #define USE_BARO_MS5611
67 #define USE_BARO_BMP280
69 #define USE_MAX7456
70 #define MAX7456_SPI_BUS BUS_SPI1
71 #define MAX7456_CS_PIN PA14
73 #if defined(YUPIF4MINI)
74 #else
75 #define USE_SDCARD
76 #define USE_SDCARD_SPI
77 #define SDCARD_DETECT_INVERTED
78 #define SDCARD_DETECT_PIN PD2
79 #define SDCARD_SPI_BUS BUS_SPI3
80 #define SDCARD_CS_PIN SPI3_NSS_PIN
81 #endif
83 #define USB_IO
84 #define USE_VCP
86 #define USE_UART_INVERTER
88 #define USE_UART1
89 #define UART1_RX_PIN PA10
90 #define UART1_TX_PIN PA9
92 #define USE_UART3
93 #define UART3_RX_PIN PB11
94 #define UART3_TX_PIN PB10
96 #define USE_UART4
97 #define UART4_RX_PIN PC11
98 #define UART4_TX_PIN PC10
100 #define USE_UART6
101 #define UART6_RX_PIN PC7
102 #define UART6_TX_PIN PC6
103 #define INVERTER_PIN_UART6_RX PB15
105 #define SERIAL_PORT_COUNT 5
107 #define USE_ESCSERIAL
108 #define ESCSERIAL_TIMER_TX_HARDWARE 0
110 #define USE_SPI
111 #define USE_SPI_DEVICE_1 // Gyro
112 #define SPI1_NSS_PIN PA4
113 #define SPI1_SCK_PIN PA5
114 #define SPI1_MISO_PIN PA6
115 #define SPI1_MOSI_PIN PA7
117 #define USE_SPI_DEVICE_3 // SD Card
118 #define SPI3_NSS_PIN PA15
119 #define SPI3_SCK_PIN PC10
120 #define SPI3_MISO_PIN PC11
121 #define SPI3_MOSI_PIN PC12
123 // ADC inputs
124 #define BOARD_HAS_VOLTAGE_DIVIDER
125 #define USE_ADC
126 #define ADC_CHANNEL_1_PIN PC1
127 #define ADC_CHANNEL_2_PIN PC0
128 #define VBAT_ADC_CHANNEL ADC_CHN_1
129 #define RSSI_ADC_CHANNEL ADC_CHN_2
131 // LED Strip can run off Pin 5 (PB1) of the motor outputs
132 #define USE_LED_STRIP
133 #define WS2811_PIN PB1
135 // Features
136 // #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
138 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
139 #define SERIALRX_PROVIDER SERIALRX_SBUS
140 #define SERIALRX_UART SERIAL_PORT_USART6
141 #define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_OSD)
143 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
145 // Number of available PWM outputs
146 #define MAX_PWM_OUTPUT_PORTS 6
148 #define TARGET_IO_PORTA 0xffff
149 #define TARGET_IO_PORTB 0xffff
150 #define TARGET_IO_PORTC 0xffff
151 #define TARGET_IO_PORTD (BIT(2))