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/>.
20 #define USE_TARGET_CONFIG
22 #define TARGET_BOARD_IDENTIFIER "MBUS"
24 #ifdef MAMBAF405US_I2C
25 #define USBD_PRODUCT_STRING "MAMBAF405US_I2C"
27 #define USBD_PRODUCT_STRING "MAMBAF405US"
30 // ******** Board LEDs **********************
34 // ******* Beeper ***********
36 #define BEEPER_INVERTED
38 #define USE_IMU_MPU6000
39 #define IMU_MPU6000_ALIGN CW180_DEG
40 #define MPU6000_SPI_BUS BUS_SPI1
41 #define MPU6000_CS_PIN PA4
43 #define USE_IMU_MPU6500
44 #define IMU_MPU6500_ALIGN CW180_DEG
45 #define MPU6500_SPI_BUS BUS_SPI1
46 #define MPU6500_CS_PIN PA4
48 // *************** Baro **************************
51 #ifdef MAMBAF405US_I2C
53 #define USE_I2C_DEVICE_1
56 #define DEFAULT_I2C_BUS BUS_I2C1
60 #define USE_I2C_DEVICE_2
61 #define I2C2_SCL PB10 // SCL pad TX3
62 #define I2C2_SDA PB11 // SDA pad RX3
63 #define DEFAULT_I2C_BUS BUS_I2C2
68 #define BARO_I2C_BUS DEFAULT_I2C_BUS
70 #define USE_BARO_BMP280
71 #define USE_BARO_MS5611
72 #define USE_BARO_DPS310
74 //*********** Magnetometer / Compass *************
76 #define MAG_I2C_BUS DEFAULT_I2C_BUS
79 // ******* SERIAL ********
83 #define UART1_TX_PIN PB6
84 #define UART1_RX_PIN PB7
87 #define UART2_TX_PIN PA2
88 #define UART2_RX_PIN PA3
91 #define UART3_TX_PIN PB10
92 #define UART3_RX_PIN PB11
95 #define UART4_TX_PIN PA0
96 #define UART4_RX_PIN PA1
99 #define UART5_TX_PIN PC12
100 #define UART5_RX_PIN PD2
103 #define UART6_TX_PIN PC6
104 #define UART6_RX_PIN PC7
106 #define SERIAL_PORT_COUNT 7
108 #define USE_UART_INVERTER
109 #define INVERTER_PIN_UART1_RX PC0
112 // *************** PINIO ***************************
115 #define PINIO1_PIN PB0
118 // ******* SPI ********
121 #define USE_SPI_DEVICE_1
122 #define SPI1_NSS_PIN PA4
123 #define SPI1_SCK_PIN PA5
124 #define SPI1_MISO_PIN PA6
125 #define SPI1_MOSI_PIN PA7
127 #define USE_SPI_DEVICE_2
128 #define SPI2_NSS_PIN PB12
129 #define SPI2_SCK_PIN PB13
130 #define SPI2_MISO_PIN PB14
131 #define SPI2_MOSI_PIN PB15
133 #define USE_SPI_DEVICE_3
134 #define SPI3_NSS_PIN PA15
135 #define SPI3_SCK_PIN PC10
136 #define SPI3_MISO_PIN PC11
137 #define SPI3_MOSI_PIN PB5
139 // ******* ADC ********
141 #define ADC_CHANNEL_1_PIN PC1
142 #define ADC_CHANNEL_2_PIN PC2
143 #define ADC_CHANNEL_3_PIN PC3
145 #define VBAT_ADC_CHANNEL ADC_CHN_1
146 #define RSSI_ADC_CHANNEL ADC_CHN_2
147 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
149 #define VBAT_SCALE_DEFAULT 1100
151 // ******* OSD ********
153 #define MAX7456_SPI_BUS BUS_SPI2
154 #define MAX7456_CS_PIN PB12
156 //******* FLASH ********
158 #define USE_FLASH_M25P16
159 #define M25P16_SPI_BUS BUS_SPI3
160 #define M25P16_CS_PIN PA15
162 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
164 //************ LEDSTRIP *****************
165 #define USE_LED_STRIP
166 #define WS2811_PIN PB3
168 // ******* FEATURES ********
169 #define SERIALRX_UART SERIAL_PORT_USART1
170 #define SERIALRX_PROVIDER SERIALRX_SBUS
172 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY)
174 #define TARGET_IO_PORTA 0xffff
175 #define TARGET_IO_PORTB 0xffff
176 #define TARGET_IO_PORTC 0xffff
177 #define TARGET_IO_PORTD (BIT(2))
179 #define MAX_PWM_OUTPUT_PORTS 4
180 #define TARGET_MOTOR_COUNT 4
182 // ESC-related features
184 #define USE_ESC_SENSOR
185 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
187 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
188 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
189 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS