add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / FIREWORKSV2 / target.h
blobec20e387ec0fd709e8321084b043a813c81a9252
1 /*
2 * This file is part of INAV.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
25 #pragma once
27 #if defined(OMNIBUSF4V6)
28 #define TARGET_BOARD_IDENTIFIER "OBV6"
29 #else
30 #define TARGET_BOARD_IDENTIFIER "FWX2"
31 #endif
33 #if defined(OMNIBUSF4V6)
34 #define USBD_PRODUCT_STRING "OmnibusF4 V6"
35 #else
36 #define USBD_PRODUCT_STRING "OMNIBUS F4 FWX V2"
37 #endif
39 #define USE_DSHOT
40 #define USE_ESC_SENSOR
42 // Status LED
43 #define LED0 PA8
45 // Beeper
46 #define BEEPER PB4
47 #define BEEPER_INVERTED
49 // I2C
50 #define USE_I2C
51 #if defined(OMNIBUSF4V6)
52 #define USE_I2C_DEVICE_1
53 #define I2C1_SCL PB8 // SCL PIN,alt MST8
54 #define I2C1_SDA PB9 // SDA PIN,alt MST7
55 #define DEFAULT_I2C_BUS BUS_I2C1
56 #else
57 #define USE_I2C_DEVICE_2
58 #define I2C_DEVICE_2_SHARES_UART3
59 #endif
61 #define USE_EXTI
62 #define GYRO_INT_EXTI PC8
63 // #define USE_MPU_DATA_READY_SIGNAL // Not connected on FireworksV2
65 #define USE_DUAL_GYRO
66 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS // Don't use common busdev descriptors for IMU
67 #define USE_IMU_MPU6500
68 #define USE_IMU_MPU6000
70 #if defined(OMNIBUSF4V6)
71 # define IMU_1_CS_PIN PA4
72 # define IMU_1_SPI_BUS BUS_SPI1
73 # define IMU_1_ALIGN CW180_DEG
74 # define IMU_2_CS_PIN PC14
75 # define IMU_2_SPI_BUS BUS_SPI1
76 # define IMU_2_ALIGN CW0_DEG
77 #else
78 // IMU_1 is verified to work on OBF4V6 and Omnibus Fireworks board
79 # define IMU_1_CS_PIN PA4
80 # define IMU_1_SPI_BUS BUS_SPI1
81 # define IMU_1_ALIGN CW0_DEG_FLIP
82 // IMU_2 is sketchy and was not verified on actual hardware
83 # define IMU_2_CS_PIN PD2
84 # define IMU_2_SPI_BUS BUS_SPI3
85 # define IMU_2_ALIGN CW180_DEG
86 #endif
88 #define USE_MAG
89 #if defined(OMNIBUSF4V6)
90 #define MAG_I2C_BUS BUS_I2C1
91 #else
92 #define MAG_I2C_BUS BUS_I2C2
93 #endif
94 #define USE_MAG_HMC5883
95 #define USE_MAG_QMC5883
96 #define USE_MAG_IST8310
97 #define USE_MAG_MAG3110
98 #define USE_MAG_LIS3MDL
100 #if defined(OMNIBUSF4V6)
101 #define TEMPERATURE_I2C_BUS BUS_I2C1
102 #else
103 #define TEMPERATURE_I2C_BUS BUS_I2C2
104 #endif
106 #define USE_BARO
107 #define USE_BARO_BMP280
108 #define BMP280_SPI_BUS BUS_SPI3
109 #define BMP280_CS_PIN PB3
110 #if defined(OMNIBUSF4V6)
111 #define BARO_I2C_BUS BUS_I2C1
112 #endif
114 #if defined(OMNIBUSF4V6)
115 #define PITOT_I2C_BUS BUS_I2C1
116 #else
117 #define PITOT_I2C_BUS BUS_I2C2
118 #endif
120 #define USE_RANGEFINDER
121 #if defined(OMNIBUSF4V6)
122 #define RANGEFINDER_I2C_BUS BUS_I2C1
123 #else
124 #define RANGEFINDER_I2C_BUS BUS_I2C2
125 #endif
127 #define USE_VCP
128 #define VBUS_SENSING_PIN PC5
129 #define VBUS_SENSING_ENABLED
131 #define USE_UART1
132 #define UART1_RX_PIN PA10
133 #define UART1_TX_PIN PA9
135 #define USE_UART2
136 #define UART2_RX_PIN NONE
137 #define UART2_TX_PIN PA2
139 #define USE_UART3
140 #define UART3_RX_PIN PB11
141 #define UART3_TX_PIN PB10
143 #define USE_UART4
144 #define UART4_RX_PIN PA1
145 #define UART4_TX_PIN NONE
147 #define USE_UART6
148 #define UART6_RX_PIN PC7
149 #define UART6_TX_PIN PC6
151 #define USE_SOFTSERIAL1
152 #define SOFTSERIAL_1_RX_PIN NONE
153 #define SOFTSERIAL_1_TX_PIN PA9 // Clash with UART1_TX, needed for S.Port
155 #define SERIAL_PORT_COUNT 7 // VCP, USART1, USART2, USART3, USART4, USART6, SOFTSERIAL1
157 #define USE_SPI
159 #define USE_SPI_DEVICE_1
160 #define SPI1_NSS_PIN PA4
161 #define SPI1_SCK_PIN PA5
162 #define SPI1_MISO_PIN PA6
163 #define SPI1_MOSI_PIN PA7
165 #define USE_SPI_DEVICE_2
166 #define SPI2_NSS_PIN PB12
167 #define SPI2_SCK_PIN PB13
168 #define SPI2_MISO_PIN PB14
169 #define SPI2_MOSI_PIN PB15
171 #define USE_SPI_DEVICE_3
172 #define SPI3_NSS_PIN PA15
173 #define SPI3_SCK_PIN PC10
174 #define SPI3_MISO_PIN PC11
175 #define SPI3_MOSI_PIN PC12
177 #define USE_MAX7456
178 #define MAX7456_SPI_BUS BUS_SPI3
179 #define MAX7456_CS_PIN PA15
181 #define USE_FLASHFS
182 #define USE_FLASH_M25P16
183 #define M25P16_CS_PIN PB12
184 #define M25P16_SPI_BUS BUS_SPI2
185 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
187 #define USE_ADC
188 #define ADC_CHANNEL_1_PIN PC1
189 #define ADC_CHANNEL_2_PIN PC2
190 #define ADC_CHANNEL_3_PIN PA0
192 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
193 #define VBAT_ADC_CHANNEL ADC_CHN_2
194 #define RSSI_ADC_CHANNEL ADC_CHN_3
196 #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO)
198 #define USE_LED_STRIP
199 #define WS2811_PIN PB6
200 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST0_HANDLER
201 #define WS2811_DMA_STREAM DMA1_Stream0
202 #define WS2811_DMA_CHANNEL DMA_Channel_2
204 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_VBAT | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_SOFTSERIAL | FEATURE_TELEMETRY)
205 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
206 #define SERIALRX_PROVIDER SERIALRX_SBUS
207 #define DISABLE_RX_PWM_FEATURE
209 #define TELEMETRY_UART SERIAL_PORT_SOFTSERIAL1
210 #define SERIALRX_UART SERIAL_PORT_USART1
211 #define SMARTAUDIO_UART SERIAL_PORT_USART4
213 //Default values for OmnibusF4V6,calib values for FireworksV2
214 #if !defined(OMNIBUSF4V6)
215 #define CURRENT_METER_SCALE 175
216 #define CURRENT_METER_OFFSET 326
217 #endif
219 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
221 // Number of available PWM outputs
222 #define MAX_PWM_OUTPUT_PORTS 8
223 #define TARGET_MOTOR_COUNT 6
225 #define TARGET_IO_PORTA 0xffff
226 #define TARGET_IO_PORTB 0xffff
227 #define TARGET_IO_PORTC 0xffff
228 #define TARGET_IO_PORTD 0xffff
230 #if defined(OMNIBUSF4V6)
231 #define PCA9685_I2C_BUS BUS_I2C1
232 #define BNO055_I2C_BUS BUS_I2C1
233 #else
234 #define PCA9685_I2C_BUS BUS_I2C2
235 #define BNO055_I2C_BUS BUS_I2C2
236 #endif