vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / MAMBAF405_2022A / target.h
blob5a24771288d9197c685e5e9735bd79abdffa4ad2
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
23 #ifdef MAMBAF405_2022B
24 #define USBD_PRODUCT_STRING "MAMBAF405_2022B"
25 #define TARGET_BOARD_IDENTIFIER "M42B"
26 #else
27 #define TARGET_BOARD_IDENTIFIER "M42A"
28 #define USBD_PRODUCT_STRING "MAMBAF405_2022A"
29 #endif
31 // ******** Board LEDs **********************
32 #define LED0 PC15
33 #define LED1 PC14
35 // ******* Beeper ***********
36 #define BEEPER PC13
37 #define BEEPER_INVERTED
39 //MPU6000
40 #define USE_IMU_MPU6000
41 #define IMU_MPU6000_ALIGN CW180_DEG
42 #define MPU6000_SPI_BUS BUS_SPI1
43 #define MPU6000_CS_PIN PA4
45 //MPU6500
46 #define USE_IMU_MPU6500
47 #define IMU_MPU6500_ALIGN CW180_DEG
48 #define MPU6500_CS_PIN SPI1_NSS_PIN
49 #define MPU6500_SPI_BUS BUS_SPI1
51 //BMI270
52 #define USE_IMU_BMI270
53 #define IMU_BMI270_ALIGN CW180_DEG
54 #define BMI270_SPI_BUS BUS_SPI1
55 #define BMI270_CS_PIN SPI1_NSS_PIN
57 #ifdef MAMBAF405_2022B
59 #define USE_IMU_ICM42605
60 #define IMU_ICM42605_ALIGN CW270_DEG
61 #define ICM42605_SPI_BUS BUS_SPI1
62 #define ICM42605_CS_PIN SPI1_NSS_PIN
64 #endif
66 // *************** Baro **************************
67 #define USE_I2C
69 #define USE_I2C_DEVICE_1
70 #define I2C2_SCL PB8
71 #define I2C2_SDA PB9
72 #define DEFAULT_I2C_BUS BUS_I2C1
74 #define USE_BARO
75 #define BARO_I2C_BUS DEFAULT_I2C_BUS
77 #define USE_BARO_BMP280
78 #define USE_BARO_MS5611
79 #define USE_BARO_BMP085
80 #define USE_BARO_DPS310
81 #define USE_BARO_SPL06
83 //*********** Magnetometer / Compass *************
84 #define USE_MAG
85 #define MAG_I2C_BUS DEFAULT_I2C_BUS
86 #define USE_MAG_ALL
88 // ******* SERIAL ********
89 #define USE_VCP
91 #define USE_UART1
92 #define UART1_TX_PIN PB6
93 #define UART1_RX_PIN PB7
95 #define USE_UART2
96 #define UART2_TX_PIN PA2
97 #define UART2_RX_PIN PA3
99 #define USE_UART3
100 #define UART3_TX_PIN PB10
101 #define UART3_RX_PIN PB11
103 #define USE_UART4
104 #define UART4_TX_PIN PA0
105 #define UART4_RX_PIN PA1
107 #define USE_UART5
108 #define UART5_TX_PIN PC12
109 #define UART5_RX_PIN PD2
111 #define USE_UART6
112 #define UART6_TX_PIN PC6
113 #define UART6_RX_PIN PC7
115 #define SERIAL_PORT_COUNT 7
117 #define USE_UART_INVERTER
118 #define INVERTER_PIN_UART1_RX PC0
120 // ******* SPI ********
121 #define USE_SPI
123 #define USE_SPI_DEVICE_1
124 #define SPI1_NSS_PIN PA4
125 #define SPI1_SCK_PIN PA5
126 #define SPI1_MISO_PIN PA6
127 #define SPI1_MOSI_PIN PA7
129 #define USE_SPI_DEVICE_2
130 #define SPI2_NSS_PIN PB12
131 #define SPI2_SCK_PIN PB13
132 #define SPI2_MISO_PIN PB14
133 #define SPI2_MOSI_PIN PB15
135 #define USE_SPI_DEVICE_3
136 #define SPI3_NSS_PIN PA15
137 #define SPI3_SCK_PIN PC10
138 #define SPI3_MISO_PIN PC11
139 #define SPI3_MOSI_PIN PB5
141 // ******* ADC ********
142 #define USE_ADC
143 #define ADC_CHANNEL_1_PIN PC1
144 #define ADC_CHANNEL_2_PIN PC3
146 #define VBAT_ADC_CHANNEL ADC_CHN_1
147 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
149 #define VBAT_SCALE_DEFAULT 1100
150 #define CURRENT_METER_SCALE 183
152 // ******* OSD ********
153 #define USE_MAX7456
154 #define MAX7456_SPI_BUS BUS_SPI2
155 #define MAX7456_CS_PIN PB12
157 //******* FLASH ********
158 #define USE_FLASHFS
159 #define USE_FLASH_M25P16
160 #define M25P16_SPI_BUS BUS_SPI3
161 #define M25P16_CS_PIN PA15
163 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
165 //************ LEDSTRIP *****************
166 #define USE_LED_STRIP
167 #define WS2811_PIN PB3
169 // ******* FEATURES ********
170 #define SERIALRX_UART SERIAL_PORT_USART1
171 #define SERIALRX_PROVIDER SERIALRX_SBUS
173 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY)
175 #define TARGET_IO_PORTA 0xffff
176 #define TARGET_IO_PORTB 0xffff
177 #define TARGET_IO_PORTC 0xffff
178 #define TARGET_IO_PORTD (BIT(2))
180 #define MAX_PWM_OUTPUT_PORTS 6
181 #define TARGET_MOTOR_COUNT 4
183 // ESC-related features
184 #define USE_DSHOT
185 #define USE_ESC_SENSOR
186 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
188 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
189 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
190 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
192 // *************** PINIO ***************************
193 #define USE_PINIO
194 #define USE_PINIOBOX
195 #define PINIO1_PIN PC2
196 #define PINIO2_PIN PC5