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/>.
19 #define USE_TARGET_CONFIG
21 #if defined(MATEKF405TE_SD)
22 # define TARGET_BOARD_IDENTIFIER "MF4T"
23 # define USBD_PRODUCT_STRING "MatekF405TE_SD"
25 # define TARGET_BOARD_IDENTIFIER "MF4T"
26 # define USBD_PRODUCT_STRING "MatekF405TE"
29 #define LED0 PA14 //Blue
30 #define LED1 PA13 //Green
33 #define BEEPER_INVERTED
34 #define BEEPER_PWM_FREQUENCY 2500
36 // *************** SPI1 IMU & OSD *******************
38 #define USE_SPI_DEVICE_1
40 #define SPI1_SCK_PIN PA5
41 #define SPI1_MISO_PIN PB4
42 #define SPI1_MOSI_PIN PA7
44 #define USE_IMU_ICM42605
45 #define IMU_ICM42605_ALIGN CW270_DEG_FLIP
46 #define ICM42605_SPI_BUS BUS_SPI1
47 #define ICM42605_CS_PIN PC14
49 #define USE_IMU_BMI270
50 #define IMU_BMI270_ALIGN CW270_DEG_FLIP
51 #define BMI270_SPI_BUS BUS_SPI1
52 #define BMI270_CS_PIN PC14
57 #define MAX7456_SPI_BUS BUS_SPI1
58 #define MAX7456_CS_PIN PB12
60 // *************** SPI2 Flash/SD Card ****************
61 #define USE_SPI_DEVICE_2
62 #define SPI2_SCK_PIN PB13
63 #define SPI2_MISO_PIN PC2
64 #define SPI2_MOSI_PIN PC3
66 #if defined(MATEKF405TE_SD)
68 # define USE_SDCARD_SPI
69 # define SDCARD_SPI_BUS BUS_SPI2
70 # define SDCARD_CS_PIN PC1
71 # define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
74 # define USE_FLASH_M25P16
75 # define M25P16_SPI_BUS BUS_SPI2
76 # define M25P16_CS_PIN PC13
77 # define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
80 // *************** I2C /Baro/Mag *********************
82 #define USE_I2C_DEVICE_1
87 #define BARO_I2C_BUS BUS_I2C1
88 #define USE_BARO_BMP280
89 #define USE_BARO_MS5611
90 #define USE_BARO_DPS310
91 #define USE_BARO_SPL06
94 #define MAG_I2C_BUS BUS_I2C1
97 #define USE_RANGEFINDER
98 #define RANGEFINDER_I2C_BUS BUS_I2C1
99 #define PITOT_I2C_BUS BUS_I2C1
100 #define TEMPERATURE_I2C_BUS BUS_I2C1
102 // *************** UART *****************************
106 #define UART1_TX_PIN PA9
107 #define UART1_RX_PIN PA10
110 #define UART2_TX_PIN PA2
111 #define UART2_RX_PIN PA3
114 #define UART3_TX_PIN PC10
115 #define UART3_RX_PIN PC11
118 #define UART4_TX_PIN PA0
119 #define UART4_RX_PIN PA1
122 #define UART5_TX_PIN PC12
123 #define UART5_RX_PIN PD2
126 #define UART6_TX_PIN PC6
127 #define UART6_RX_PIN PC7
129 #define USE_SOFTSERIAL1
130 #define SOFTSERIAL_1_TX_PIN PA2
131 #define SOFTSERIAL_1_RX_PIN PA2
133 #define SERIAL_PORT_COUNT 8
135 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
136 #define SERIALRX_PROVIDER SERIALRX_CRSF
137 #define SERIALRX_UART SERIAL_PORT_USART2
139 // *************** ADC ***************************
141 #define ADC_INSTANCE ADC1
142 #define ADC1_DMA_STREAM DMA2_Stream4
143 #define ADC_CHANNEL_1_PIN PC4
144 #define ADC_CHANNEL_2_PIN PC5
145 #define ADC_CHANNEL_3_PIN PB0
146 #define ADC_CHANNEL_4_PIN PC0
147 #define VBAT_ADC_CHANNEL ADC_CHN_1
148 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
149 #define RSSI_ADC_CHANNEL ADC_CHN_3
150 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
152 // *************** PINIO ***************************
155 #define PINIO1_PIN PA4
156 #define PINIO2_PIN PB5
158 // *************** LEDSTRIP ************************
159 #define USE_LED_STRIP
160 #define WS2811_PIN PB1
162 // *************** others ************************
163 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
164 #define VBAT_SCALE_DEFAULT 2100
165 #define CURRENT_METER_SCALE 150
167 #define TARGET_IO_PORTA 0xffff
168 #define TARGET_IO_PORTB 0xffff
169 #define TARGET_IO_PORTC 0xffff
170 #define TARGET_IO_PORTD (BIT(2))
172 #define MAX_PWM_OUTPUT_PORTS 11
174 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
176 #define USE_DSHOT_DMAR
177 #define USE_ESC_SENSOR