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)
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/>.
22 #define TARGET_BOARD_IDENTIFIER "YPF4"
23 #define USE_TARGET_CONFIG
25 #define USBD_PRODUCT_STRING "YupiF4"
27 #define USE_HARDWARE_REVISION_DETECTION
34 #define BEEPER_PIN PC9
35 #define BEEPER_PWM_HZ 3150 // Beeper PWM frequency in Hz
39 #define USE_MPU_DATA_READY_SIGNAL
41 #define GYRO_1_EXTI_PIN PC4
44 #define USE_ACC_SPI_ICM20689
45 #define USE_ACC_SPI_MPU6500
48 #define USE_GYRO_SPI_ICM20689
49 #define USE_GYRO_SPI_MPU6500
50 #define GYRO_1_ALIGN CW90_DEG
52 #define GYRO_1_CS_PIN PA4
53 #define GYRO_1_SPI_INSTANCE SPI1
59 #define INVERTER_PIN_UART1 PB12
60 #define UART1_RX_PIN PA10
61 #define UART1_TX_PIN PA9
64 #define UART3_RX_PIN PB11
65 #define UART3_TX_PIN PB10
68 #define INVERTER_PIN_UART6 PB15
69 #define UART6_RX_PIN PC7
70 #define UART6_TX_PIN PC6
72 #define USE_SOFTSERIAL1
73 #define SOFTSERIAL1_RX_PIN PB1 // PWM7
74 #define SOFTSERIAL1_TX_PIN PB0 // PWM5
76 #define USE_SOFTSERIAL2
78 #define SERIAL_PORT_COUNT 6 // VCP, UART1, UART3, UART6, SOFTSERIAL x 2
81 #define ESCSERIAL_TIMER_TX_PIN PC8 // (HARDARE=0,PPM)
85 #define USE_SDCARD_SPI
86 #define SDCARD_DETECT_INVERTED
87 #define SDCARD_DETECT_PIN PD2
88 #define SDCARD_SPI_INSTANCE SPI3
89 #define SDCARD_SPI_CS_PIN PA15
90 #define SPI3_TX_DMA_OPT 0 // DMA 1 Stream 5 Channel 0
95 #define USE_SPI_DEVICE_1 //Gyro
96 #define SPI1_NSS_PIN PA4
97 #define SPI1_SCK_PIN PA5
98 #define SPI1_MISO_PIN PA6
99 #define SPI1_MOSI_PIN PA7
101 #define USE_SPI_DEVICE_3 //dataslash - SD Card
102 #define SPI3_NSS_PIN PA15
103 #define SPI3_SCK_PIN PC10
104 #define SPI3_MISO_PIN PC11
105 #define SPI3_MOSI_PIN PC12
109 #define MAX7456_SPI_INSTANCE SPI1
110 #define MAX7456_SPI_CS_PIN PA14
113 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
114 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
116 #define RSSI_ADC_PIN PC0
117 #define VBAT_ADC_PIN PC1
118 #define CURRENT_METER_ADC_PIN PC2
119 #define CURRENT_METER_SCALE_DEFAULT 150
121 // Default configuration
122 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
123 #define SERIALRX_PROVIDER SERIALRX_SBUS
124 #define SERIALRX_UART SERIAL_PORT_USART6
125 #define DEFAULT_FEATURES (FEATURE_OSD)
126 #define USE_GYRO_FAST_KALMAN
128 // Target IO and timers
129 #define TARGET_IO_PORTA 0xffff
130 #define TARGET_IO_PORTB 0xffff
131 #define TARGET_IO_PORTC 0xffff
132 #define TARGET_IO_PORTD (BIT(2))
134 #define USABLE_TIMER_CHANNEL_COUNT 10
135 #define USED_TIMERS (TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(12))