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
40 // disable GYRO_EXTI when MAX7456 is on same SPI bus as gyro
41 // #define USE_GYRO_EXTI
42 #define GYRO_1_EXTI_PIN PC4
45 #define USE_ACC_SPI_ICM20689
46 #define USE_ACC_SPI_MPU6500
49 #define USE_GYRO_SPI_ICM20689
50 #define USE_GYRO_SPI_MPU6500
51 #define GYRO_1_ALIGN CW90_DEG
53 #define GYRO_1_CS_PIN PA4
54 #define GYRO_1_SPI_INSTANCE SPI1
60 #define INVERTER_PIN_UART1 PB12
61 #define UART1_RX_PIN PA10
62 #define UART1_TX_PIN PA9
65 #define UART3_RX_PIN PB11
66 #define UART3_TX_PIN PB10
69 #define INVERTER_PIN_UART6 PB15
70 #define UART6_RX_PIN PC7
71 #define UART6_TX_PIN PC6
73 #define USE_SOFTSERIAL1
74 #define SOFTSERIAL1_RX_PIN PB1 // PWM7
75 #define SOFTSERIAL1_TX_PIN PB0 // PWM5
77 #define USE_SOFTSERIAL2
79 #define SERIAL_PORT_COUNT 6 // VCP, UART1, UART3, UART6, SOFTSERIAL x 2
82 #define ESCSERIAL_TIMER_TX_PIN PC8 // (HARDARE=0,PPM)
86 #define USE_SDCARD_SPI
87 #define SDCARD_DETECT_INVERTED
88 #define SDCARD_DETECT_PIN PD2
89 #define SDCARD_SPI_INSTANCE SPI3
90 #define SDCARD_SPI_CS_PIN PA15
91 #define SPI3_TX_DMA_OPT 0 // DMA 1 Stream 5 Channel 0
96 #define USE_SPI_DEVICE_1 //Gyro
97 #define SPI1_NSS_PIN PA4
98 #define SPI1_SCK_PIN PA5
99 #define SPI1_MISO_PIN PA6
100 #define SPI1_MOSI_PIN PA7
102 #define USE_SPI_DEVICE_3 //dataslash - SD Card
103 #define SPI3_NSS_PIN PA15
104 #define SPI3_SCK_PIN PC10
105 #define SPI3_MISO_PIN PC11
106 #define SPI3_MOSI_PIN PC12
110 #define MAX7456_SPI_INSTANCE SPI1
111 #define MAX7456_SPI_CS_PIN PA14
114 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
115 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
117 #define RSSI_ADC_PIN PC0
118 #define VBAT_ADC_PIN PC1
119 #define CURRENT_METER_ADC_PIN PC2
120 #define CURRENT_METER_SCALE_DEFAULT 150
122 // Default configuration
123 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
124 #define SERIALRX_PROVIDER SERIALRX_SBUS
125 #define SERIALRX_UART SERIAL_PORT_USART6
126 #define DEFAULT_FEATURES (FEATURE_OSD)
127 #define USE_GYRO_FAST_KALMAN
129 // Target IO and timers
130 #define TARGET_IO_PORTA 0xffff
131 #define TARGET_IO_PORTB 0xffff
132 #define TARGET_IO_PORTC 0xffff
133 #define TARGET_IO_PORTD (BIT(2))
135 #define USABLE_TIMER_CHANNEL_COUNT 10
136 #define USED_TIMERS (TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(12))