Merge pull request #10558 from iNavFlight/MrD_Correct-comments-on-OSD-symbols
[inav.git] / src / main / target / MATEKF411SE / target.h
blobdb5652e0cac181e3d80e1116eebc51c2d6f03b7b
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 "M41S"
21 #define USBD_PRODUCT_STRING "MatekF411SE"
23 #define LED0 PC13
24 #define LED1 PC14
26 #define BEEPER PB2
27 #define BEEPER_INVERTED
29 // *************** SPI1 Gyro & ACC **********************
30 #define USE_SPI
31 #define USE_SPI_DEVICE_1
33 #define SPI1_SCK_PIN PA5
34 #define SPI1_MISO_PIN PA6
35 #define SPI1_MOSI_PIN PA7
37 #define USE_IMU_MPU6000
38 #define IMU_MPU6000_ALIGN CW180_DEG
39 #define MPU6000_CS_PIN PA4
40 #define MPU6000_SPI_BUS BUS_SPI1
42 // *************** SPI2 OSD *****************************
43 #define USE_SPI_DEVICE_2
44 #define SPI2_SCK_PIN PB13
45 #define SPI2_MISO_PIN PB14
46 #define SPI2_MOSI_PIN PB15
48 #define USE_MAX7456
49 #define MAX7456_SPI_BUS BUS_SPI2
50 #define MAX7456_CS_PIN PB12
52 // *************** UART *****************************
53 #define USE_VCP
54 #define VBUS_SENSING_PIN PC15
55 #define VBUS_SENSING_ENABLED
57 #define USE_UART1
58 #define UART1_TX_PIN PA15
59 #define UART1_RX_PIN PB3
61 #define USE_UART2
62 #define UART2_TX_PIN PA2
63 #define UART2_RX_PIN PA3
65 #define USE_SOFTSERIAL1
66 #define SOFTSERIAL_1_TX_PIN PB9 // ST1 pad
67 #ifdef MATEKF411SE_FD_SFTSRL1
68 #define SOFTSERIAL_1_RX_PIN PB10 // LED pad
69 #else
70 #define SOFTSERIAL_1_RX_PIN PB9
71 #endif
73 #define USE_SOFTSERIAL2
74 #ifdef MATEKF411SE_SS2_CH6
75 #define SOFTSERIAL_2_TX_PIN PB8 // CH6 pad
76 #define SOFTSERIAL_2_RX_PIN PB8
77 #else
78 #define SOFTSERIAL_2_TX_PIN PA2 // TX2 pad
79 #define SOFTSERIAL_2_RX_PIN PA2
80 #endif
82 #define SERIAL_PORT_COUNT 5
84 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
85 #define SERIALRX_PROVIDER SERIALRX_SBUS
86 #define SERIALRX_UART SERIAL_PORT_USART2
88 // *************** I2C /Baro/Mag/Pitot ********************
89 #define USE_I2C
90 #define USE_I2C_DEVICE_1
91 #define I2C1_SCL PB6
92 #define I2C1_SDA PB7
94 #define DEFAULT_I2C_BUS BUS_I2C1
96 #define USE_BARO
97 #define BARO_I2C_BUS BUS_I2C1
98 #define USE_BARO_BMP280
99 #define USE_BARO_MS5611
100 #define USE_BARO_BMP085
101 #define USE_BARO_DPS310
102 #define USE_BARO_SPL06
104 #define USE_MAG
105 #define MAG_I2C_BUS BUS_I2C1
106 #define USE_MAG_ALL
108 #define PITOT_I2C_BUS BUS_I2C1
109 #define TEMPERATURE_I2C_BUS BUS_I2C1
111 #define USE_RANGEFINDER
112 #define USE_RANGEFINDER_MSP
113 #define RANGEFINDER_I2C_BUS BUS_I2C1
115 // *************** ADC *****************************
116 #define USE_ADC
117 #define ADC_INSTANCE ADC1
118 #define ADC1_DMA_STREAM DMA2_Stream0
120 #define ADC_CHANNEL_1_PIN PB0
121 #define ADC_CHANNEL_2_PIN PB1
122 #define ADC_CHANNEL_3_PIN PA0
123 #define ADC_CHANNEL_4_PIN PA1
125 #define VBAT_ADC_CHANNEL ADC_CHN_1
126 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
127 #define RSSI_ADC_CHANNEL ADC_CHN_3
128 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
130 // *************** LED2812 ************************
131 #if !defined(MATEKF411SE_PINIO) && !defined(MATEKF411SE_FD_SFTSRL1)
132 #define USE_LED_STRIP
133 #define WS2811_PIN PB10
134 #endif
136 // *************** PINIO ***************************
137 #define USE_PINIO
138 #define USE_PINIOBOX
139 #define PINIO1_PIN PA13 // Camera switcher
140 #ifdef MATEKF411SE_PINIO
141 #define PINIO2_PIN PB10 // External PINIO (LED pad)
142 #endif
144 // *************** OTHERS *************************
145 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
147 #define CURRENT_METER_SCALE 423 //F411-WSE 78A
149 #define USE_SPEKTRUM_BIND
150 #define BIND_PIN PA3 // RX2
152 #define USE_DSHOT
153 #define USE_ESC_SENSOR
154 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
156 #define TARGET_IO_PORTA 0xffff
157 #define TARGET_IO_PORTB 0xffff
158 #define TARGET_IO_PORTC 0xffff
159 #define TARGET_IO_PORTD (BIT(2))
161 #define MAX_PWM_OUTPUT_PORTS 6