Fix WS2812 led definition
[inav.git] / src / main / target / MAMBAF722 / target.h
blobc536cc6017efb85944d15af4ba7729aabb0847e5
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 "MBF7"
23 #ifdef MAMBAF722_I2C
24 #define USBD_PRODUCT_STRING "MAMBAF722_I2C"
25 #else
26 #define USBD_PRODUCT_STRING "MAMBAF722"
27 #endif
29 // ******** Board LEDs **********************
30 #define LED0 PC15
31 #define LED1 PC14
33 // ******* Beeper ***********
34 #define BEEPER PB2
35 #define BEEPER_INVERTED
37 #define MPU6000_CS_PIN SPI1_NSS_PIN
38 #define MPU6000_SPI_BUS BUS_SPI1
40 #define USE_IMU_MPU6000
41 #define IMU_MPU6000_ALIGN CW180_DEG
43 // The 2022 variant of F722_I2C with MPU6500
44 #define USE_IMU_MPU6500
45 #define IMU_MPU6500_ALIGN CW180_DEG
46 #define MPU6500_CS_PIN SPI1_NSS_PIN
47 #define MPU6500_SPI_BUS BUS_SPI1
49 #define USE_I2C
51 #ifdef MAMBAF722_I2C
53 #define USE_I2C_DEVICE_1
54 #define I2C1_SCL PB8
55 #define I2C1_SDA PB9
56 #define DEFAULT_I2C_BUS BUS_I2C1
58 #else
60 #define USE_I2C_DEVICE_2
62 #define I2C2_SCL PB10 // SCL pad TX3
63 #define I2C2_SDA PB11 // SDA pad RX3
64 #define DEFAULT_I2C_BUS BUS_I2C2
66 #endif
68 // *************** Baro **************************
69 #define USE_BARO
70 #define BARO_I2C_BUS DEFAULT_I2C_BUS
71 #define USE_BARO_BMP280
72 #define USE_BARO_MS5611
74 //*********** Magnetometer / Compass *************
75 #define USE_MAG
76 #define MAG_I2C_BUS DEFAULT_I2C_BUS
78 #define USE_MAG_HMC5883
79 #define USE_MAG_QMC5883
80 #define USE_MAG_IST8310
81 #define USE_MAG_MAG3110
82 #define USE_MAG_LIS3MDL
84 // ******* SERIAL ********
85 #define USE_VCP
86 #define USE_UART1
87 #define USE_UART2
88 #define USE_UART3
89 #define USE_UART4
90 #define USE_UART5
91 #define USE_UART6
93 #define UART1_TX_PIN PB6
94 #define UART1_RX_PIN PB7
96 #define UART2_TX_PIN PA2
97 #define UART2_RX_PIN PA3
99 #define UART3_TX_PIN PB10
100 #define UART3_RX_PIN PB11
102 #define UART4_TX_PIN PA0
103 #define UART4_RX_PIN PA1
105 #define UART5_TX_PIN PC12
106 #define UART5_RX_PIN PD2
108 #define UART6_TX_PIN PC6
109 #define UART6_RX_PIN PC7
111 #ifdef MAMBAF722_I2C
113 #define SERIAL_PORT_COUNT 7
115 #else
117 #define USE_SOFTSERIAL1
119 #define SOFTSERIAL_1_TX_PIN PA2
120 #define SOFTSERIAL_1_RX_PIN PA2
121 #define SERIAL_PORT_COUNT 8
123 #endif
125 // ******* SPI ********
126 #define USE_SPI
128 #define USE_SPI_DEVICE_1
129 #define SPI1_NSS_PIN PA4
130 #define SPI1_SCK_PIN PA5
131 #define SPI1_MISO_PIN PA6
132 #define SPI1_MOSI_PIN PA7
134 #define USE_SPI_DEVICE_2
135 #define SPI2_NSS_PIN PB12
136 #define SPI2_SCK_PIN PB13
137 #define SPI2_MISO_PIN PB14
138 #define SPI2_MOSI_PIN PB15
140 #define USE_SPI_DEVICE_3
141 #define SPI3_NSS_PIN PA15
142 #define SPI3_SCK_PIN PC10
143 #define SPI3_MISO_PIN PC11
144 #define SPI3_MOSI_PIN PB5
146 // ******* ADC ********
147 #define USE_ADC
148 #define ADC_CHANNEL_1_PIN PC1
149 #define ADC_CHANNEL_2_PIN PC2
150 #define ADC_CHANNEL_3_PIN PC3
152 #define VBAT_ADC_CHANNEL ADC_CHN_1
153 #define RSSI_ADC_CHANNEL ADC_CHN_2
154 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
156 #define VBAT_SCALE_DEFAULT 1100
158 // ******* OSD ********
159 #define USE_MAX7456
160 #define MAX7456_SPI_BUS BUS_SPI2
161 #define MAX7456_CS_PIN SPI2_NSS_PIN
163 //******* FLASH ********
164 #define USE_FLASHFS
165 #define USE_FLASH_M25P16
166 #define M25P16_CS_PIN SPI3_NSS_PIN
167 #define M25P16_SPI_BUS BUS_SPI3
169 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
171 //************ LEDSTRIP *****************
172 #define USE_LED_STRIP
173 #define WS2811_PIN PB3
175 // ******* FEATURES ********
176 #define SERIALRX_UART SERIAL_PORT_USART1
177 #define SERIALRX_PROVIDER SERIALRX_SBUS
179 #ifdef MAMBAF722_I2C
180 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY)
181 #else
182 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
183 #endif
185 #define TARGET_IO_PORTA 0xffff
186 #define TARGET_IO_PORTB 0xffff
187 #define TARGET_IO_PORTC 0xffff
188 #define TARGET_IO_PORTD (BIT(2))
190 #define MAX_PWM_OUTPUT_PORTS 8
191 #define TARGET_MOTOR_COUNT 4
193 // ESC-related features
194 #define USE_DSHOT
195 #define USE_ESC_SENSOR
196 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
198 #ifdef MAMBAF722_I2C
200 #define USE_RANGEFINDER
201 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
202 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
203 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
205 #endif