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 "MEF4"
24 #define USBD_PRODUCT_STRING "MERAKRCF405"
29 #define BEEPER_PIN PC14
30 #define BEEPER_INVERTED
32 // *************** Gyro & ACC **********************
34 #define USE_SPI_DEVICE_2
36 #define SPI2_SCK_PIN PB13
37 #define SPI2_MISO_PIN PB14
38 #define SPI2_MOSI_PIN PB15
40 #define GYRO_1_CS_PIN PB12
41 #define GYRO_1_SPI_INSTANCE SPI2
43 #define GYRO_1_EXTI_PIN PC4
46 #define USE_GYRO_SPI_MPU6000
47 #define GYRO_1_ALIGN CW0_DEG
50 #define USE_ACC_SPI_MPU6000
52 // *************** BLACKBOX **************************
53 #define USE_SPI_DEVICE_1
54 #define SPI1_SCK_PIN PA5
55 #define SPI1_MISO_PIN PA6
56 #define SPI1_MOSI_PIN PA7
58 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
60 #define USE_FLASH_M25P16
61 #define FLASH_CS_PIN PA4
62 #define FLASH_SPI_INSTANCE SPI1
64 // *************** OSD *****************************
65 #define USE_SPI_DEVICE_3
66 #define SPI3_SCK_PIN PB3
67 #define SPI3_MISO_PIN PB4
68 #define SPI3_MOSI_PIN PB5
71 #define MAX7456_SPI_INSTANCE SPI3
72 #define MAX7456_SPI_CS_PIN PA15
74 // *************** I2C **************************
76 #define USE_I2C_DEVICE_1
77 #define I2C_DEVICE (I2CDEV_1)
81 // *************** BARO **************************
83 #define BARO_I2C_INSTANCE (I2CDEV_1)
84 #define USE_BARO_BMP085
85 #define USE_BARO_BMP280
86 #define USE_BARO_MS5611
88 // *************** MAG **************************
90 #define MAG_I2C_INSTANCE (I2CDEV_1)
91 #define USE_MAG_AK8975
92 #define USE_MAG_HMC5883
93 #define USE_MAG_QMC5883l
95 // *************** UART *****************************
99 #define UART1_RX_PIN PA10
100 #define UART1_TX_PIN PA9
103 #define UART2_RX_PIN PA3
104 #define UART2_TX_PIN PA2
107 #define UART3_RX_PIN PB11
108 #define UART3_TX_PIN PB10
111 #define UART4_RX_PIN PC11
112 #define UART4_TX_PIN PC10
115 #define UART5_RX_PIN PD2
116 #define UART5_TX_PIN PC12
118 #define USE_SOFTSERIAL1
119 #define USE_SOFTSERIAL2
121 #define SERIAL_PORT_COUNT 8
123 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
124 #define SERIALRX_PROVIDER SERIALRX_SBUS
126 // *************** ADC *****************************
128 #define ADC_INSTANCE ADC1
129 #define ADC1_DMA_OPT 0
131 #define VBAT_ADC_PIN PC2
132 #define CURRENT_METER_ADC_PIN PC1
133 #define RSSI_ADC_PIN PC3
135 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
136 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
137 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
138 #define CURRENT_METER_SCALE_DEFAULT 179
140 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
142 #define USE_ESCSERIAL
143 #define ESCSERIAL_TIMER_TX_PIN PA3
145 #define TARGET_IO_PORTA 0xffff
146 #define TARGET_IO_PORTB 0xffff
147 #define TARGET_IO_PORTC 0xffff
148 #define TARGET_IO_PORTD (BIT(2))
150 #define USABLE_TIMER_CHANNEL_COUNT 9
151 #define USED_TIMERS (TIM_N(1)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(8)|TIM_N(11))