2 * This file is part of INAV.
4 * INAV 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 * INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
20 #define TARGET_BOARD_IDENTIFIER "MF4C"
21 #define USBD_PRODUCT_STRING "Matek_F405CAN"
23 #define LED0 PA14 //Blue
24 #define LED1 PA13 //Green
27 #define BEEPER_INVERTED
28 #define BEEPER_PWM_FREQUENCY 2500
30 // *************** SPI1 Gyro & ACC *******************
32 #define USE_SPI_DEVICE_1
34 #define SPI1_SCK_PIN PA5
35 #define SPI1_MISO_PIN PA6
36 #define SPI1_MOSI_PIN PA7
38 #define USE_IMU_MPU6500
39 #define IMU_MPU6500_ALIGN CW180_DEG_FLIP
40 #define MPU6500_CS_PIN PA4
41 #define MPU6500_SPI_BUS BUS_SPI1
44 #define GYRO_INT_EXTI PC4
45 #define USE_MPU_DATA_READY_SIGNAL
48 // *************** I2C /Baro/Mag *********************
50 #define USE_I2C_DEVICE_2
55 #define BARO_I2C_BUS BUS_I2C2
56 #define USE_BARO_BMP280
57 #define USE_BARO_MS5611
58 #define USE_BARO_DPS310
59 #define USE_BARO_SPL06
62 #define MAG_I2C_BUS BUS_I2C2
63 #define USE_MAG_AK8963
64 #define USE_MAG_AK8975
65 #define USE_MAG_HMC5883
66 #define USE_MAG_QMC5883
67 #define USE_MAG_IST8310
68 #define USE_MAG_MAG3110
69 #define USE_MAG_LIS3MDL
71 #define USE_RANGEFINDER
72 #define RANGEFINDER_I2C_BUS BUS_I2C2
74 #define PITOT_I2C_BUS BUS_I2C2
75 #define TEMPERATURE_I2C_BUS BUS_I2C2
76 #define PCA9685_I2C_BUS BUS_I2C2
77 #define BNO055_I2C_BUS BUS_I2C2
80 // *************** SPI2 RM3100 **************************
81 #define USE_SPI_DEVICE_2
82 #define SPI2_SCK_PIN PB13
83 #define SPI2_MISO_PIN PB14
84 #define SPI2_MOSI_PIN PB15
86 #define USE_MAG_RM3100
87 #define RM3100_CS_PIN PB12
88 #define RM3100_SPI_BUS BUS_SPI2
90 // *************** SPI3 SD Card ********************
92 #define USE_SDCARD_SPI
93 #define SDCARD_SPI_BUS BUS_SPI3
94 #define SDCARD_CS_PIN PC14
96 #define USE_SPI_DEVICE_3
97 #define SPI3_SCK_PIN PB3
98 #define SPI3_MISO_PIN PB4
99 #define SPI3_MOSI_PIN PB5
101 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
103 // *************** UART *****************************
107 #define UART1_TX_PIN PA9
108 #define UART1_RX_PIN PA10
111 #define UART2_TX_PIN PA2
112 #define UART2_RX_PIN PA3
115 #define UART3_TX_PIN PC10
116 #define UART3_RX_PIN PC11
119 #define UART4_TX_PIN PA0
120 #define UART4_RX_PIN PA1
123 #define UART5_TX_PIN PC12
124 #define UART5_RX_PIN PD2
126 #define USE_SOFTSERIAL1
127 #define SOFTSERIAL_1_TX_PIN PA2 //TX2 pad
128 #define SOFTSERIAL_1_RX_PIN PA2 //TX2 pad
130 #define SERIAL_PORT_COUNT 7
132 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
133 #define SERIALRX_PROVIDER SERIALRX_SBUS
134 #define SERIALRX_UART SERIAL_PORT_USART2
136 // *************** ADC ***************************
138 #define ADC_INSTANCE ADC1
139 #define ADC1_DMA_STREAM DMA2_Stream0
140 #define ADC_CHANNEL_1_PIN PC0
141 #define ADC_CHANNEL_2_PIN PC1
142 #define ADC_CHANNEL_3_PIN PC2
143 #define ADC_CHANNEL_4_PIN PC3
144 #define VBAT_ADC_CHANNEL ADC_CHN_1
145 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
146 #define RSSI_ADC_CHANNEL ADC_CHN_3
147 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
149 // *************** LED2812 ************************
150 #define USE_LED_STRIP
151 #define WS2811_PIN PA15
152 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST5_HANDLER
153 #define WS2811_DMA_STREAM DMA1_Stream5
154 #define WS2811_DMA_CHANNEL DMA_Channel_3
156 // *************** OTHERS *************************
157 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_GPS | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
158 #define VBAT_SCALE 2100 //1K:20K
160 #define USE_SPEKTRUM_BIND
161 #define BIND_PIN PA3 // RX2
164 #define USE_ESC_SENSOR
166 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
168 #define TARGET_IO_PORTA 0xffff
169 #define TARGET_IO_PORTB 0xffff
170 #define TARGET_IO_PORTC 0xffff
171 #define TARGET_IO_PORTD (BIT(2))
173 #define MAX_PWM_OUTPUT_PORTS 8