Fix WS2812 led definition
[inav.git] / src / main / target / MAMBAF722_2022A / target.h
blob0752bb368b39e285c316469e143d3b4fa189bd16
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 #ifdef MAMBAF722_2022B
24 #define TARGET_BOARD_IDENTIFIER "M72B"
25 #define USBD_PRODUCT_STRING "MAMBAF722_2022B"
27 #else
29 #define TARGET_BOARD_IDENTIFIER "M72A"
30 #define USBD_PRODUCT_STRING "MAMBAF722_2022A"
32 #endif
34 // ******** Board LEDs **********************
35 #define LED0 PC15
36 #define LED1 PC14
38 // ******* Beeper ***********
39 #define BEEPER PB2
40 #define BEEPER_INVERTED
42 //MPU6000
43 #define USE_IMU_MPU6000
44 #define IMU_MPU6000_ALIGN CW180_DEG
45 #define MPU6000_CS_PIN SPI1_NSS_PIN
46 #define MPU6000_SPI_BUS BUS_SPI1
48 //MPU6500
49 #define USE_IMU_MPU6500
50 #define IMU_MPU6500_ALIGN CW180_DEG
51 #define MPU6500_CS_PIN SPI1_NSS_PIN
52 #define MPU6500_SPI_BUS BUS_SPI1
54 //BMI270
55 #define USE_IMU_BMI270
56 #define IMU_BMI270_ALIGN CW180_DEG
57 #define BMI270_SPI_BUS BUS_SPI1
58 #define BMI270_CS_PIN SPI1_NSS_PIN
60 #ifdef MAMBAF722_2022B
62 #define USE_IMU_ICM42605
63 #define IMU_ICM42605_ALIGN CW270_DEG
64 #define ICM42605_SPI_BUS BUS_SPI1
65 #define ICM42605_CS_PIN SPI1_NSS_PIN
67 #endif
69 #define USE_I2C
71 #define USE_I2C_DEVICE_1
72 #define I2C1_SCL PB8
73 #define I2C1_SDA PB9
74 #define DEFAULT_I2C_BUS BUS_I2C1
76 // *************** Baro **************************
77 #define USE_BARO
78 #define BARO_I2C_BUS DEFAULT_I2C_BUS
79 #define USE_BARO_BMP280
80 #define USE_BARO_MS5611
81 #define USE_BARO_BMP085
82 #define USE_BARO_DPS310
83 #define USE_BARO_SPL06
85 //*********** Magnetometer / Compass *************
86 #define USE_MAG
87 #define MAG_I2C_BUS DEFAULT_I2C_BUS
89 #define USE_MAG_HMC5883
90 #define USE_MAG_QMC5883
91 #define USE_MAG_IST8310
92 #define USE_MAG_MAG3110
93 #define USE_MAG_LIS3MDL
95 // ******* SERIAL ********
96 #define USE_VCP
97 #define USE_UART1
98 #define USE_UART2
99 #define USE_UART3
100 #define USE_UART4
101 #define USE_UART5
102 #define USE_UART6
104 #define UART1_TX_PIN PB6
105 #define UART1_RX_PIN PB7
107 #define UART2_TX_PIN PA2
108 #define UART2_RX_PIN PA3
110 #define UART3_TX_PIN PB10
111 #define UART3_RX_PIN PB11
113 #define UART4_TX_PIN PA0
114 #define UART4_RX_PIN PA1
116 #define UART5_TX_PIN PC12
117 #define UART5_RX_PIN PD2
119 #define UART6_TX_PIN PC6
120 #define UART6_RX_PIN PC7
122 #define SERIAL_PORT_COUNT 7
124 // ******* SPI ********
125 #define USE_SPI
127 #define USE_SPI_DEVICE_1
128 #define SPI1_NSS_PIN PA4
129 #define SPI1_SCK_PIN PA5
130 #define SPI1_MISO_PIN PA6
131 #define SPI1_MOSI_PIN PA7
133 #define USE_SPI_DEVICE_2
134 #define SPI2_NSS_PIN PB12
135 #define SPI2_SCK_PIN PB13
136 #define SPI2_MISO_PIN PB14
137 #define SPI2_MOSI_PIN PB15
139 #define USE_SPI_DEVICE_3
140 #define SPI3_NSS_PIN PA15
141 #define SPI3_SCK_PIN PC10
142 #define SPI3_MISO_PIN PC11
143 #define SPI3_MOSI_PIN PB5
145 // ******* ADC ********
146 #define USE_ADC
147 #define ADC_CHANNEL_1_PIN PC1
148 #define ADC_CHANNEL_2_PIN PC3
150 #define VBAT_ADC_CHANNEL ADC_CHN_1
151 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
153 #define VBAT_SCALE_DEFAULT 1100
155 // ******* OSD ********
156 #define USE_MAX7456
157 #define MAX7456_SPI_BUS BUS_SPI2
158 #define MAX7456_CS_PIN SPI2_NSS_PIN
160 //******* FLASH ********
161 #define USE_FLASHFS
162 #define USE_FLASH_M25P16
163 #define M25P16_CS_PIN SPI3_NSS_PIN
164 #define M25P16_SPI_BUS BUS_SPI3
166 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
168 //************ LEDSTRIP *****************
169 #define USE_LED_STRIP
170 #define WS2811_PIN PB3
172 // ******* FEATURES ********
173 #define SERIALRX_UART SERIAL_PORT_USART1
174 #define SERIALRX_PROVIDER SERIALRX_SBUS
176 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY)
178 #define TARGET_IO_PORTA 0xffff
179 #define TARGET_IO_PORTB 0xffff
180 #define TARGET_IO_PORTC 0xffff
181 #define TARGET_IO_PORTD (BIT(2))
183 #define MAX_PWM_OUTPUT_PORTS 8
184 #define TARGET_MOTOR_COUNT 8
186 // ESC-related features
187 #define USE_DSHOT
188 #define USE_ESC_SENSOR
189 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
191 #define USE_RANGEFINDER
192 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
193 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
194 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
196 // *************** PINIO ***************************
197 #define USE_PINIO
198 #define USE_PINIOBOX
199 #define PINIO1_PIN PC0 // VTX power switcher
200 #define PINIO2_PIN PC2 // WiFi Switcher