add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / FLYWOOF411 / target.h
blob22229390b08eb5511cb1e6878dff39e1a9a190c9
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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 * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #ifdef FLYWOOF411_V2
21 #define TARGET_BOARD_IDENTIFIER "FW42"
22 #define USBD_PRODUCT_STRING "FLYWOOF411V2"
23 #else
24 #define TARGET_BOARD_IDENTIFIER "FW41"
25 #define USBD_PRODUCT_STRING "FLYWOOF411"
26 #endif
28 #define LED0 PC13
30 #define BEEPER PC14
31 #define BEEPER_INVERTED
34 // *************** SPI **********************
35 #define USE_SPI
36 #define USE_SPI_DEVICE_1
37 #define SPI1_SCK_PIN PA5
38 #define SPI1_MISO_PIN PA6
39 #define SPI1_MOSI_PIN PA7
41 #define USE_SPI_DEVICE_2
42 #define SPI2_SCK_PIN PB13
43 #define SPI2_MISO_PIN PB14
44 #define SPI2_MOSI_PIN PB15
47 // *************** SPI Gyro & ACC **********************
49 #define USE_IMU_MPU6000
50 #define MPU6000_CS_PIN PA4
51 #define MPU6000_SPI_BUS BUS_SPI1
52 #define IMU_MPU6000_ALIGN CW180_DEG
54 #define USE_IMU_ICM20689
55 #define ICM20689_CS_PIN PA4
56 #define ICM20689_SPI_BUS BUS_SPI1
57 #define IMU_ICM20689_ALIGN CW180_DEG
59 #define USE_EXTI
60 #ifdef FLYWOOF411_V2
61 #define GYRO_INT_EXTI PB5
62 #else
63 #define GYRO_INT_EXTI PB3
64 #endif
65 #define USE_MPU_DATA_READY_SIGNAL
67 // *************** Baro *****************************
69 #define USE_I2C
70 #define USE_I2C_DEVICE_1
71 #define I2C1_SCL PB8
72 #define I2C1_SDA PB9
74 #define USE_BARO
75 #define BARO_I2C_BUS BUS_I2C1
76 #define USE_BARO_BMP280
77 #define USE_BARO_MS5611
79 #define BNO055_I2C_BUS BUS_I2C1
81 #define USE_MAG
82 #define MAG_I2C_BUS BUS_I2C1
83 #define USE_MAG_HMC5883
84 #define USE_MAG_QMC5883
85 #define USE_MAG_IST8310
86 #define USE_MAG_IST8308
87 #define USE_MAG_MAG3110
88 #define USE_MAG_LIS3MDL
90 // *************** SPI OSD *****************************
91 #define USE_MAX7456
92 #define MAX7456_SPI_BUS BUS_SPI2
93 #define MAX7456_CS_PIN PB12
95 // *************** SPI FLASH **************************
96 #define USE_FLASHFS
97 #define USE_FLASH_M25P16
98 #define M25P16_CS_PIN PB2
99 #define M25P16_SPI_BUS BUS_SPI2
100 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
102 // *************** UART *****************************
103 #define USE_VCP
105 #define USE_UART1
106 #ifdef FLYWOOF411_V2
107 #define UART1_TX_PIN PA9
108 #define UART1_RX_PIN PA10
109 #else
110 #define UART1_TX_PIN PB6
111 #define UART1_RX_PIN PB7
112 #endif
114 #define USE_UART2
115 #ifdef FLYWOOF411_V2
116 #define UART2_TX_PIN PA2
117 #else
118 #define UART2_TX_PIN NONE //PA2
119 #endif
120 #define UART2_RX_PIN PA3
122 #define USE_SOFTSERIAL1
123 #ifdef FLYWOOF411_V2
124 #define SOFTSERIAL_1_TX_PIN PB6 // Clash with TX2, possible to use as S.Port or VTX control
125 #define SOFTSERIAL_1_RX_PIN PB7
126 #else
127 #define SOFTSERIAL_1_TX_PIN PA2 // Clash with TX2, possible to use as S.Port or VTX control
128 #define SOFTSERIAL_1_RX_PIN PA2
129 #endif
131 #define SERIAL_PORT_COUNT 4 // VCP, USART1, USART2, SS1
133 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
134 #define SERIALRX_PROVIDER SERIALRX_SBUS
135 #ifdef FLYWOOF411_V2
136 #define SERIALRX_UART SERIAL_PORT_USART1
137 #else
138 #define SERIALRX_UART SERIAL_PORT_USART2
139 #endif
140 // *************** ADC *****************************
141 #define USE_ADC
142 #define ADC_INSTANCE ADC1
143 #define ADC_CHANNEL_1_PIN PA1
144 #ifdef FLYWOOF411_V2
145 #define ADC_CHANNEL_2_PIN PB1
146 #define ADC_CHANNEL_3_PIN PB0
147 #else
148 #define ADC_CHANNEL_2_PIN PA0
149 #define ADC_CHANNEL_3_PIN PB1
150 #endif
152 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
153 #define VBAT_ADC_CHANNEL ADC_CHN_2
154 #define RSSI_ADC_CHANNEL ADC_CHN_3
156 // *************** LED2812 ************************
157 #define USE_LED_STRIP
158 #ifdef FLYWOOF411_V2
159 #define WS2811_PIN PA0
160 #else
161 #define WS2811_PIN PA15
162 #endif
163 // *************** OTHERS *************************
164 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL)
166 #define USE_DSHOT
167 #define USE_ESC_SENSOR
168 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
170 #define TARGET_IO_PORTA 0xffff
171 #define TARGET_IO_PORTB 0xffff
172 #define TARGET_IO_PORTC 0xffff
173 #define TARGET_IO_PORTD (BIT(2))
175 #ifdef FLYWOOF411_V2
176 #define MAX_PWM_OUTPUT_PORTS 6
177 #else
178 #define MAX_PWM_OUTPUT_PORTS 4
179 #endif