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/>.
23 #define TARGET_BOARD_IDENTIFIER "CLR4"
25 #define USBD_PRODUCT_STRING "CLRACINGF4"
27 #define USE_TARGET_CONFIG
31 #define BEEPER_PIN PB4
32 #define BEEPER_INVERTED
33 #define BEEPER_PWM_HZ 3800 // Beeper PWM frequency in Hz
35 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_OFF // Motors 3 / 4 conflict with LED_STRIP if enabled
37 #define INVERTER_PIN_UART1 PC0 // PC0 used as inverter select GPIO
42 #define GYRO_1_EXTI_PIN PC4
43 #define USE_MPU_DATA_READY_SIGNAL
49 #define USE_ACC_SPI_MPU6000
50 #define USE_GYRO_SPI_MPU6000
53 #define USE_ACC_SPI_MPU6500
54 #define USE_GYRO_SPI_MPU6500
56 #define GYRO_1_CS_PIN PA4
57 #define GYRO_1_SPI_INSTANCE SPI1
58 #define GYRO_1_ALIGN CW0_DEG
61 #define MAX7456_SPI_INSTANCE SPI3
62 #define MAX7456_SPI_CS_PIN PA15
64 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
66 #define USE_SDCARD_SPI
67 #define SDCARD_DETECT_PIN PB7
68 #define SDCARD_SPI_INSTANCE SPI2
69 #define SDCARD_SPI_CS_PIN SPI2_NSS_PIN
70 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
73 #define USE_FLASH_M25P16
74 #define FLASH_CS_PIN PB3
75 #define FLASH_SPI_INSTANCE SPI3
79 #define USE_USB_DETECT
80 #define USB_DETECT_PIN PC5
83 #define UART1_RX_PIN PA10
84 #define UART1_TX_PIN PA9
87 #define UART3_RX_PIN PB11
88 #define UART3_TX_PIN PB10
91 #define UART6_RX_PIN PC7
92 #define UART6_TX_PIN PC6
95 #define UART4_RX_PIN PA1
96 #define UART4_TX_PIN PA0
98 #define USE_SOFTSERIAL1
100 #define SERIAL_PORT_COUNT 6 //VCP, USART1, USART3,USART4, USART6, SOFT_SERIAL1
102 #define USE_ESCSERIAL
103 #define ESCSERIAL_TIMER_TX_PIN PB9 // (HARDARE=0,PPM)
106 #define USE_SPI_DEVICE_1
108 #define USE_SPI_DEVICE_2
109 #define SPI2_NSS_PIN PB12
110 #define SPI2_SCK_PIN PB13
111 #define SPI2_MISO_PIN PB14
112 #define SPI2_MOSI_PIN PB15
114 #define USE_SPI_DEVICE_3
115 #define SPI3_NSS_PIN PA15
116 #define SPI3_SCK_PIN PC10
117 #define SPI3_MISO_PIN PC11
118 #define SPI3_MOSI_PIN PC12
121 #define CURRENT_METER_ADC_PIN PC1
122 #define VBAT_ADC_PIN PC2
123 #define RSSI_ADC_PIN PC3
124 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
125 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
127 #define USE_TRANSPONDER
129 #define PINIO1_PIN PA14 // VTX power switcher
133 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
134 #define DEFAULT_FEATURES ( FEATURE_OSD )
135 #define CURRENT_METER_SCALE_DEFAULT 250
137 #define TARGET_IO_PORTA (0xffff )
138 #define TARGET_IO_PORTB (0xffff & ~(BIT(2)))
139 #define TARGET_IO_PORTC (0xffff & ~(BIT(15)|BIT(14)|BIT(13)))
140 #define TARGET_IO_PORTD BIT(2)
142 #define USABLE_TIMER_CHANNEL_COUNT 7
143 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(11))