add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / YUPIF4 / target.h
blob69c5bc3ab1c16dccbde55a2127682d01e4fa9ab6
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 USE_EXTI
48 #define GYRO_INT_EXTI PC4
49 #define USE_MPU_DATA_READY_SIGNAL
50 #define ENSURE_MPU_DATA_READY_IS_LOW
52 #define MPU6500_CS_PIN SPI1_NSS_PIN
53 #define MPU6500_SPI_BUS BUS_SPI1
55 #define USE_IMU_MPU6500
56 #define IMU_MPU6500_ALIGN CW90_DEG
58 #define USE_I2C
59 #define USE_I2C_DEVICE_2
60 #define I2C1_SCL PB10
61 #define I2C1_SDA PB11
63 #define USE_MAG
64 #define MAG_I2C_BUS BUS_I2C2
65 #define USE_MAG_HMC5883
66 #define USE_MAG_QMC5883
68 #define TEMPERATURE_I2C_BUS BUS_I2C2
69 #define BNO055_I2C_BUS BUS_I2C2
71 #define USE_BARO
72 #define BARO_I2C_BUS BUS_I2C2
73 #define USE_BARO_MS5611
74 #define USE_BARO_BMP280
76 #define USE_MAX7456
77 #define MAX7456_SPI_BUS BUS_SPI1
78 #define MAX7456_CS_PIN PA14
80 #if defined(YUPIF4MINI)
81 #else
82 #define USE_SDCARD
83 #define USE_SDCARD_SPI
84 #define SDCARD_DETECT_INVERTED
85 #define SDCARD_DETECT_PIN PD2
86 #define SDCARD_SPI_BUS BUS_SPI3
87 #define SDCARD_CS_PIN SPI3_NSS_PIN
88 #endif
90 #define USB_IO
91 #define USE_VCP
93 #define USE_UART_INVERTER
95 #define USE_UART1
96 #define UART1_RX_PIN PA10
97 #define UART1_TX_PIN PA9
99 #define USE_UART3
100 #define UART3_RX_PIN PB11
101 #define UART3_TX_PIN PB10
103 #define USE_UART4
104 #define UART4_RX_PIN PC11
105 #define UART4_TX_PIN PC10
107 #define USE_UART6
108 #define UART6_RX_PIN PC7
109 #define UART6_TX_PIN PC6
110 #define INVERTER_PIN_UART6_RX PB15
112 #define SERIAL_PORT_COUNT 5
114 #define USE_ESCSERIAL
115 #define ESCSERIAL_TIMER_TX_HARDWARE 0
117 #define USE_SPI
118 #define USE_SPI_DEVICE_1 // Gyro
119 #define SPI1_NSS_PIN PA4
120 #define SPI1_SCK_PIN PA5
121 #define SPI1_MISO_PIN PA6
122 #define SPI1_MOSI_PIN PA7
124 #define USE_SPI_DEVICE_3 // SD Card
125 #define SPI3_NSS_PIN PA15
126 #define SPI3_SCK_PIN PC10
127 #define SPI3_MISO_PIN PC11
128 #define SPI3_MOSI_PIN PC12
130 // ADC inputs
131 #define BOARD_HAS_VOLTAGE_DIVIDER
132 #define USE_ADC
133 #define ADC_CHANNEL_1_PIN PC1
134 #define ADC_CHANNEL_2_PIN PC0
135 #define VBAT_ADC_CHANNEL ADC_CHN_1
136 #define RSSI_ADC_CHANNEL ADC_CHN_2
138 // LED Strip can run off Pin 5 (PB1) of the motor outputs
139 #define USE_LED_STRIP
140 #define WS2811_PIN PB1
142 // Features
143 // #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
145 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
146 #define SERIALRX_PROVIDER SERIALRX_SBUS
147 #define SERIALRX_UART SERIAL_PORT_USART6
148 #define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_OSD)
150 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
152 // Number of available PWM outputs
153 #define MAX_PWM_OUTPUT_PORTS 6
155 #define TARGET_IO_PORTA 0xffff
156 #define TARGET_IO_PORTB 0xffff
157 #define TARGET_IO_PORTC 0xffff
158 #define TARGET_IO_PORTD (BIT(2))
160 #define PCA9685_I2C_BUS BUS_I2C2