[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / MAMBAF405US / target.h
blobf4312c06fc6773d13ba95a370050be9271fefd58
1 /*
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/>.
18 #pragma once
20 #define USE_TARGET_CONFIG
22 #define TARGET_BOARD_IDENTIFIER "MBUS"
23 #define USBD_PRODUCT_STRING "MAMBAF405US"
25 // ******** Board LEDs **********************
26 #define LED0 PC15
27 #define LED1 PC14
29 // ******* Beeper ***********
30 #define BEEPER PC13
31 #define BEEPER_INVERTED
34 // ******* GYRO and ACC ********
35 #define USE_EXTI
36 #define GYRO_INT_EXTI PC4
37 #define USE_MPU_DATA_READY_SIGNAL
39 #define USE_IMU_MPU6000
40 #define IMU_MPU6000_ALIGN CW180_DEG
41 #define MPU6000_SPI_BUS BUS_SPI1
42 #define MPU6000_CS_PIN PA4
45 // *************** Baro **************************
46 #define USE_I2C
47 #define USE_I2C_DEVICE_2
49 #define I2C2_SCL PB10 // SCL pad TX3
50 #define I2C2_SDA PB11 // SDA pad RX3
51 #define DEFAULT_I2C_BUS BUS_I2C2
53 #define USE_BARO
54 #define BARO_I2C_BUS DEFAULT_I2C_BUS
56 #define USE_BARO_BMP280
57 #define USE_BARO_MS5611
59 //*********** Magnetometer / Compass *************
60 #define USE_MAG
61 #define MAG_I2C_BUS DEFAULT_I2C_BUS
63 #define USE_MAG_HMC5883
64 #define USE_MAG_QMC5883
65 #define USE_MAG_LIS3MDL
67 // ******* SERIAL ********
68 #define USE_VCP
70 #define USE_UART1
71 #define UART1_TX_PIN PB6
72 #define UART1_RX_PIN PB7
74 #define USE_UART2
75 #define UART2_TX_PIN PA2
76 #define UART2_RX_PIN PA3
78 #define USE_UART3
79 #define UART3_TX_PIN PB10
80 #define UART3_RX_PIN PB11
82 #define USE_UART4
83 #define UART4_TX_PIN PA0
84 #define UART4_RX_PIN PA1
86 #define USE_UART5
87 #define UART5_TX_PIN PC12
88 #define UART5_RX_PIN PD2
90 #define USE_UART6
91 #define UART6_TX_PIN PC6
92 #define UART6_RX_PIN PC7
95 #define USE_SOFTSERIAL1
96 #define SOFTSERIAL_1_TX_PIN PA2
97 #define SOFTSERIAL_1_RX_PIN PA2
100 #define SERIAL_PORT_COUNT 7
102 #define USE_UART_INVERTER
103 #define INVERTER_PIN_UART1_RX PC0
106 // *************** PINIO ***************************
107 #define USE_PINIO
108 #define USE_PINIOBOX
109 #define PINIO1_PIN PB0
112 // ******* SPI ********
113 #define USE_SPI
115 #define USE_SPI_DEVICE_1
116 #define SPI1_NSS_PIN PA4
117 #define SPI1_SCK_PIN PA5
118 #define SPI1_MISO_PIN PA6
119 #define SPI1_MOSI_PIN PA7
121 #define USE_SPI_DEVICE_2
122 #define SPI2_NSS_PIN PB12
123 #define SPI2_SCK_PIN PB13
124 #define SPI2_MISO_PIN PB14
125 #define SPI2_MOSI_PIN PB15
127 #define USE_SPI_DEVICE_3
128 #define SPI3_NSS_PIN PA15
129 #define SPI3_SCK_PIN PC10
130 #define SPI3_MISO_PIN PC11
131 #define SPI3_MOSI_PIN PB5
133 // ******* ADC ********
134 #define USE_ADC
135 #define ADC_CHANNEL_1_PIN PC1
136 #define ADC_CHANNEL_2_PIN PC2
137 #define ADC_CHANNEL_3_PIN PC3
139 #define VBAT_ADC_CHANNEL ADC_CHN_1
140 #define RSSI_ADC_CHANNEL ADC_CHN_2
141 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
143 #define VBAT_SCALE_DEFAULT 1100
145 // ******* OSD ********
146 #define USE_OSD
147 #define USE_MAX7456
148 #define MAX7456_SPI_BUS BUS_SPI2
149 #define MAX7456_CS_PIN PB12
151 //******* FLASH ********
152 #define USE_FLASHFS
153 #define USE_FLASH_M25P16
154 #define M25P16_SPI_BUS BUS_SPI3
155 #define M25P16_CS_PIN PA15
157 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
159 //************ LEDSTRIP *****************
160 #define USE_LED_STRIP
161 #define WS2811_PIN PB3
163 // ******* FEATURES ********
164 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
165 #define SERIALRX_UART SERIAL_PORT_USART1
166 #define SERIALRX_PROVIDER SERIALRX_SBUS
168 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY)
170 #define TARGET_IO_PORTA 0xffff
171 #define TARGET_IO_PORTB 0xffff
172 #define TARGET_IO_PORTC 0xffff
173 #define TARGET_IO_PORTD (BIT(2))
175 #define MAX_PWM_OUTPUT_PORTS 8
176 #define TARGET_MOTOR_COUNT 4
178 // ESC-related features
179 #define USE_DSHOT
180 #define USE_SERIALSHOT
181 //#define USE_ESC_SENSOR
182 #define USE_SERIAL_4WAY_BLHELI_INTERFACE