[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / MATEKF411SE / target.h
blob790be95bac361b9915eb5cf764b8e059591e37bf
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 #define USE_EXTI
43 #define GYRO_INT_EXTI PA14
44 #define USE_MPU_DATA_READY_SIGNAL
47 // *************** SPI2 OSD *****************************
48 #define USE_SPI_DEVICE_2
49 #define SPI2_SCK_PIN PB13
50 #define SPI2_MISO_PIN PB14
51 #define SPI2_MOSI_PIN PB15
53 #define USE_OSD
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 PA15
65 #define UART1_RX_PIN PB3
67 #define USE_UART2
68 #define UART2_TX_PIN PA2
69 #define UART2_RX_PIN PA3
71 #define USE_SOFTSERIAL1
72 #define SOFTSERIAL_1_TX_PIN PB9 // ST1 pad
73 #define SOFTSERIAL_1_RX_PIN PB9
75 #define USE_SOFTSERIAL2
76 #define SOFTSERIAL_2_TX_PIN PA2 // TX2 pad
77 #define SOFTSERIAL_2_RX_PIN PA2
79 #define SERIAL_PORT_COUNT 5
81 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
82 #define SERIALRX_PROVIDER SERIALRX_SBUS
83 #define SERIALRX_UART SERIAL_PORT_USART2
85 // *************** I2C /Baro/Mag/Pitot ********************
86 #define USE_I2C
87 #define USE_I2C_DEVICE_1
88 #define I2C1_SCL PB6
89 #define I2C1_SDA PB7
91 #define DEFAULT_I2C_BUS BUS_I2C1
93 #define USE_BARO
94 #define BARO_I2C_BUS BUS_I2C1
95 #define USE_BARO_BMP280
96 #define USE_BARO_MS5611
97 #define USE_BARO_BMP085
98 #define USE_BARO_DPS310
100 #define USE_MAG
101 #define MAG_I2C_BUS BUS_I2C1
102 #define USE_MAG_HMC5883
103 #define USE_MAG_QMC5883
104 #define USE_MAG_IST8310
105 #define USE_MAG_IST8308
106 #define USE_MAG_MAG3110
107 #define USE_MAG_LIS3MDL
108 #define USE_MAG_AK8975
110 #define PITOT_I2C_BUS BUS_I2C1
111 #define TEMPERATURE_I2C_BUS BUS_I2C1
113 #define USE_RANGEFINDER
114 #define USE_RANGEFINDER_MSP
115 #define USE_RANGEFINDER_HCSR04_I2C
116 #define RANGEFINDER_I2C_BUS BUS_I2C1
118 // *************** ADC *****************************
119 #define USE_ADC
120 #define ADC_INSTANCE ADC1
121 #define ADC1_DMA_STREAM DMA2_Stream0
123 #define ADC_CHANNEL_1_PIN PB0
124 #define ADC_CHANNEL_2_PIN PB1
125 #define ADC_CHANNEL_3_PIN PA0
126 #define ADC_CHANNEL_4_PIN PA1
128 #define VBAT_ADC_CHANNEL ADC_CHN_1
129 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
130 #define RSSI_ADC_CHANNEL ADC_CHN_3
131 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
133 // *************** LED2812 ************************
134 #define USE_LED_STRIP
135 #define WS2811_PIN PB10
137 // *************** PINIO ***************************
138 #define USE_PINIO
139 #define USE_PINIOBOX
140 #define PINIO1_PIN PA13 // Camera switcher
142 // *************** OTHERS *************************
143 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
145 #define CURRENT_METER_SCALE 423 //F411-WSE 78A
147 #define USE_SPEKTRUM_BIND
148 #define BIND_PIN PA3 // RX2
150 #define USE_DSHOT
151 #define USE_ESC_SENSOR
152 #define USE_SERIALSHOT
153 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
155 #define TARGET_IO_PORTA 0xffff
156 #define TARGET_IO_PORTB 0xffff
157 #define TARGET_IO_PORTC 0xffff
158 #define TARGET_IO_PORTD (BIT(2))
160 #define MAX_PWM_OUTPUT_PORTS 6
162 #ifdef USE_USB_MSC
163 # undef USE_USB_MSC
164 #endif