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 "MF4S"
21 #define USBD_PRODUCT_STRING "Matek_F405SE"
23 #define LED0 PA14 //Blue
24 #define LED1 PA13 //Green
26 #define BEEPER_INVERTED
28 // *************** SPI1 Gyro & ACC *******************
30 #define USE_SPI_DEVICE_1
32 #define SPI1_SCK_PIN PA5
33 #define SPI1_MISO_PIN PA6
34 #define SPI1_MOSI_PIN PA7
36 #define USE_IMU_MPU6000
37 #define IMU_MPU6000_ALIGN CW270_DEG
38 #define MPU6000_CS_PIN PA4
39 #define MPU6000_SPI_BUS BUS_SPI1
42 #define GYRO_INT_EXTI PC4
43 #define USE_MPU_DATA_READY_SIGNAL
46 // *************** I2C /Baro/Mag *********************
48 #define USE_I2C_DEVICE_1
52 #define USE_I2C_DEVICE_2
57 #define BARO_I2C_BUS BUS_I2C1
58 #define USE_BARO_BMP280
59 #define USE_BARO_MS5611
60 #define USE_BARO_BMP085
61 #define USE_BARO_DPS310
62 #define USE_BARO_SPL06
65 #define MAG_I2C_BUS BUS_I2C2
66 #define USE_MAG_AK8963
67 #define USE_MAG_AK8975
68 #define USE_MAG_HMC5883
69 #define USE_MAG_QMC5883
70 #define USE_MAG_IST8310
71 #define USE_MAG_MAG3110
72 #define USE_MAG_LIS3MDL
74 #define USE_RANGEFINDER
75 #define USE_RANGEFINDER_US42
76 #define RANGEFINDER_I2C_BUS BUS_I2C2
77 #define PITOT_I2C_BUS BUS_I2C2
78 #define TEMPERATURE_I2C_BUS BUS_I2C2
79 #define BNO055_I2C_BUS BUS_I2C2
82 // *************** SPI2 OSD ***************************
83 #define USE_SPI_DEVICE_2
84 #define SPI2_SCK_PIN PB13
85 #define SPI2_MISO_PIN PC2
86 #define SPI2_MOSI_PIN PC3
89 #define MAX7456_CS_PIN PB12
90 #define MAX7456_SPI_BUS BUS_SPI2
92 // *************** SPI3 SD Card ********************
94 #define USE_SDCARD_SPI
95 #define SDCARD_SPI_BUS BUS_SPI3
96 #define SDCARD_CS_PIN PC14
98 #define USE_SPI_DEVICE_3
99 #define SPI3_SCK_PIN PB3
100 #define SPI3_MISO_PIN PB4
101 #define SPI3_MOSI_PIN PB5
103 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
105 // *************** UART *****************************
107 #define VBUS_SENSING_PIN PC13
108 #define VBUS_SENSING_ENABLED
111 #define UART1_TX_PIN PA9
112 #define UART1_RX_PIN PA10
115 #define UART2_TX_PIN PA2
116 #define UART2_RX_PIN PA3
119 #define UART3_TX_PIN PC10
120 #define UART3_RX_PIN PC11
123 #define UART4_TX_PIN PA0
124 #define UART4_RX_PIN PA1
127 #define UART5_TX_PIN PC12
128 #define UART5_RX_PIN PD2
131 #define UART6_TX_PIN PC6
132 #define UART6_RX_PIN PC7
134 #define USE_SOFTSERIAL1 //Frsky SmartPort on TX2 pad
135 #define SOFTSERIAL_1_TX_PIN PA2
136 #define SOFTSERIAL_1_RX_PIN PA2
138 #define SERIAL_PORT_COUNT 8
140 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
141 #define SERIALRX_PROVIDER SERIALRX_SBUS
142 #define SERIALRX_UART SERIAL_PORT_USART2
144 // *************** ADC ***************************
146 #define ADC_INSTANCE ADC1
147 #define ADC1_DMA_STREAM DMA2_Stream0
148 #define ADC_CHANNEL_1_PIN PC0
149 #define ADC_CHANNEL_2_PIN PC1
150 #define ADC_CHANNEL_3_PIN PC5
151 #define VBAT_ADC_CHANNEL ADC_CHN_1
152 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
153 #define RSSI_ADC_CHANNEL ADC_CHN_3
155 // *************** LED2812 ************************
156 #define USE_LED_STRIP
157 #define WS2811_PIN PA15
158 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST5_HANDLER
159 #define WS2811_DMA_STREAM DMA1_Stream5
160 #define WS2811_DMA_CHANNEL DMA_Channel_3
162 // *************** OTHERS *************************
163 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
164 #define CURRENT_METER_SCALE 317
166 #define USE_SPEKTRUM_BIND
167 #define BIND_PIN PA3 // RX2
170 #define USE_ESC_SENSOR
172 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
174 #define TARGET_IO_PORTA 0xffff
175 #define TARGET_IO_PORTB 0xffff
176 #define TARGET_IO_PORTC 0xffff
177 #define TARGET_IO_PORTD (BIT(2))
179 #define MAX_PWM_OUTPUT_PORTS 9
181 #define PCA9685_I2C_BUS BUS_I2C2