Update header
[inav.git] / src / main / target / MATEKF411 / target.h
blob0bf0aab1987a744d80307716df5c201c16c6c9e1
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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 * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "MK41"
22 #define USBD_PRODUCT_STRING "MatekF411"
24 #define LED0 PC13
25 #define LED1 PC14
27 #define BEEPER PB2
28 #define BEEPER_INVERTED
30 // *************** SPI1 Gyro & ACC **********************
31 #define USE_SPI
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_MPU6000
39 #define IMU_MPU6000_ALIGN CW180_DEG
40 #define MPU6000_CS_PIN PA4
41 #define MPU6000_SPI_BUS BUS_SPI1
43 #define USE_IMU_MPU6500
44 #define IMU_MPU6500_ALIGN CW180_DEG
45 #define MPU6500_CS_PIN PA4
46 #define MPU6500_SPI_BUS BUS_SPI1
48 // *************** SPI2 OSD *****************************
49 #define USE_SPI_DEVICE_2
50 #define SPI2_SCK_PIN PB13
51 #define SPI2_MISO_PIN PB14
52 #define SPI2_MOSI_PIN PB15
54 #define USE_MAX7456
55 #define MAX7456_SPI_BUS BUS_SPI2
56 #define MAX7456_CS_PIN PB12
58 // *************** UART *****************************
59 #define USE_VCP
60 #define VBUS_SENSING_PIN PC15
61 #define VBUS_SENSING_ENABLED
63 #define USE_UART1
64 #define UART1_TX_PIN PA9
65 #define UART1_RX_PIN PA10
67 #define USE_UART2
68 #define UART2_TX_PIN PA2
69 #define UART2_RX_PIN PA3
71 #if defined(MATEKF411_SFTSRL2)
72 #define USE_SOFTSERIAL1
73 #define SOFTSERIAL_1_TX_PIN PA0 // ST1 pad
74 #define SOFTSERIAL_1_RX_PIN PA0
75 #define USE_SOFTSERIAL2
76 #define SOFTSERIAL_2_TX_PIN PA8 // LED pad
77 #define SOFTSERIAL_2_RX_PIN PA8
78 #define SERIAL_PORT_COUNT 5
80 #elif defined(MATEKF411_FD_SFTSRL)
81 #define USE_SOFTSERIAL1
82 #define SOFTSERIAL_1_TX_PIN PA0 // ST1 pad
83 #define SOFTSERIAL_1_RX_PIN PA8 // LED pad
84 #define SERIAL_PORT_COUNT 4
86 #elif defined(MATEKF411_RSSI)
87 #define USE_SOFTSERIAL1
88 #define SOFTSERIAL_1_TX_PIN PA8 // LED pad
89 #define SOFTSERIAL_1_RX_PIN PA8
90 #define SERIAL_PORT_COUNT 4
92 #else
93 #define USE_SOFTSERIAL1
94 #define SOFTSERIAL_1_TX_PIN PA0 // ST1 pad
95 #define SOFTSERIAL_1_RX_PIN PA0
96 #define SERIAL_PORT_COUNT 4
97 #endif
99 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
100 #define SERIALRX_PROVIDER SERIALRX_SBUS
101 #define SERIALRX_UART SERIAL_PORT_USART1
103 // *************** I2C /Baro/Mag/Pitot ********************
104 #define USE_I2C
105 #define USE_I2C_DEVICE_1
106 #define I2C1_SCL PB8
107 #define I2C1_SDA PB9
109 #define DEFAULT_I2C_BUS BUS_I2C1
111 #define USE_BARO
112 #define BARO_I2C_BUS BUS_I2C1
113 #define USE_BARO_BMP280
114 #define USE_BARO_MS5611
115 #define USE_BARO_BMP085
116 #define USE_BARO_DPS310
117 #define USE_BARO_SPL06
119 #define TEMPERATURE_I2C_BUS BUS_I2C1
121 #define USE_MAG
122 #define MAG_I2C_BUS BUS_I2C1
123 #define USE_MAG_HMC5883
124 #define USE_MAG_QMC5883
125 #define USE_MAG_IST8310
126 #define USE_MAG_MAG3110
127 #define USE_MAG_LIS3MDL
129 #define PITOT_I2C_BUS BUS_I2C1
131 // *************** ADC *****************************
132 #define USE_ADC
133 #define ADC_INSTANCE ADC1
134 #define ADC1_DMA_STREAM DMA2_Stream0
135 #define ADC_CHANNEL_1_PIN PB0
136 #define ADC_CHANNEL_2_PIN PB1
137 #define VBAT_ADC_CHANNEL ADC_CHN_1
138 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
140 #if defined(MATEKF411_RSSI)
141 #define ADC_CHANNEL_3_PIN PA0
142 #define RSSI_ADC_CHANNEL ADC_CHN_3
143 #endif
145 // *************** LED2812 ************************
146 #if !defined(MATEKF411_SFTSRL2) && !defined(MATEKF411_RSSI) && !defined(MATEKF411_FD_SFTSRL)
147 #define USE_LED_STRIP
148 #define WS2811_PIN PA8
149 #endif
150 // *************** OTHERS *************************
151 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
153 #define USE_SPEKTRUM_BIND
154 #define BIND_PIN PA10 // RX1
156 #define USE_DSHOT
157 #define USE_ESC_SENSOR
159 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
161 #define TARGET_IO_PORTA 0xffff
162 #define TARGET_IO_PORTB 0xffff
163 #define TARGET_IO_PORTC 0xffff
164 #define TARGET_IO_PORTD (BIT(2))
166 #define MAX_PWM_OUTPUT_PORTS 7