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/>.
20 //Same target as OMNIBUSF4PRO with LED strip in M5
21 #ifdef OMNIBUSF4PRO_LEDSTRIPM5
24 //Same target as OMNIBUSF4V3 with softserial in M5 and M6
25 #if defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
30 #define TARGET_BOARD_IDENTIFIER "OBSD"
31 #elif defined(OMNIBUSF4V3)
32 #define TARGET_BOARD_IDENTIFIER "OB43"
33 #elif defined(DYSF4PRO)
34 #define TARGET_BOARD_IDENTIFIER "DYS4"
35 #elif defined(DYSF4PROV2)
36 #define TARGET_BOARD_IDENTIFIER "DY42"
38 #define TARGET_BOARD_IDENTIFIER "OBF4"
41 #if defined(DYSF4PRO) || defined(DYSF4PROV2)
42 #define USBD_PRODUCT_STRING "DysF4Pro"
44 #define USBD_PRODUCT_STRING "Omnibus F4"
50 #define BEEPER_INVERTED
52 #if defined(DYSF4PROV2)
54 #define USE_I2C_DEVICE_1
57 #define I2C_EXT_BUS BUS_I2C1
60 #define USE_I2C_DEVICE_2
61 #define I2C_DEVICE_2_SHARES_UART3
62 #define I2C_EXT_BUS BUS_I2C2
65 #define UG2864_I2C_BUS I2C_EXT_BUS
69 #define GYRO_INT_EXTI PC4
70 #define USE_MPU_DATA_READY_SIGNAL
72 #define MPU6000_CS_PIN PA4
73 #define MPU6000_SPI_BUS BUS_SPI1
75 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
76 #define USE_IMU_MPU6000
77 #define IMU_MPU6000_ALIGN CW270_DEG
79 #define USE_IMU_MPU6000
80 #define IMU_MPU6000_ALIGN CW180_DEG
83 // Support for OMNIBUS F4 PRO CORNER - it has ICM20608 instead of MPU6000
84 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
85 #define MPU6500_CS_PIN MPU6000_CS_PIN
86 #define MPU6500_SPI_BUS MPU6000_SPI_BUS
87 #define USE_IMU_MPU6500
88 #define IMU_MPU6500_ALIGN IMU_MPU6000_ALIGN
92 #define MAG_I2C_BUS I2C_EXT_BUS
93 #define USE_MAG_HMC5883
94 #define USE_MAG_QMC5883
95 #define USE_MAG_IST8310
96 #define USE_MAG_IST8308
97 #define USE_MAG_MAG3110
98 #define USE_MAG_LIS3MDL
99 #define USE_MAG_AK8975
101 #define TEMPERATURE_I2C_BUS I2C_EXT_BUS
102 #define BNO055_I2C_BUS I2C_EXT_BUS
106 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
107 #define USE_BARO_BMP280
108 #define BMP280_SPI_BUS BUS_SPI3
109 #define BMP280_CS_PIN PB3 // v1
110 // Support external barometers
111 #define BARO_I2C_BUS I2C_EXT_BUS
112 #define USE_BARO_BMP085
113 #define USE_BARO_MS5611
115 #define BARO_I2C_BUS I2C_EXT_BUS
116 #define USE_BARO_BMP085
117 #define USE_BARO_BMP280
118 #define USE_BARO_MS5611
121 #define PITOT_I2C_BUS I2C_EXT_BUS
123 #define USE_RANGEFINDER
124 #define RANGEFINDER_I2C_BUS I2C_EXT_BUS
127 #define VBUS_SENSING_PIN PC5
128 #define VBUS_SENSING_ENABLED
130 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
131 #define USE_UART_INVERTER
135 #define UART1_RX_PIN PA10
136 #define UART1_TX_PIN PA9
137 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
138 #if defined(OMNIBUSF4PRO)
139 #define INVERTER_PIN_UART1_RX PC0 // PC0 has never been used as inverter control on genuine OMNIBUS F4 variants, but leave it as is since some clones actually implement it.
143 #define UART3_RX_PIN PB11
144 #define UART3_TX_PIN PB10
147 #define UART6_RX_PIN PC7
148 #define UART6_TX_PIN PC6
149 #if defined(OMNIBUSF4V3)
150 #define INVERTER_PIN_UART6_RX PC8
151 #define INVERTER_PIN_UART6_TX PC9
154 #if defined(OMNIBUSF4V3) && !(defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS))
155 #define USE_SOFTSERIAL1
156 #define SOFTSERIAL_1_RX_PIN PC6 // shared with UART6 TX
157 #define SOFTSERIAL_1_TX_PIN PC6 // shared with UART6 TX
159 #define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1
161 #elif defined(OMNIBUSF4V3_S6_SS) // one softserial on S6
162 #define USE_SOFTSERIAL1
163 #define SOFTSERIAL_1_RX_PIN PA8 // S6 output
164 #define SOFTSERIAL_1_TX_PIN PA8 // S6 output
166 #define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1
168 #elif defined(OMNIBUSF4V3_S5S6_SS) // one softserial on S5/RX S6/TX
169 #define USE_SOFTSERIAL1
170 #define SOFTSERIAL_1_RX_PIN PA1 // S5 output
171 #define SOFTSERIAL_1_TX_PIN PA8 // S6 output
173 #define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1
175 #elif defined(OMNIBUSF4V3_S5_S6_2SS) // two softserials, one on S5 and one on S6
176 #define USE_SOFTSERIAL1
177 #define SOFTSERIAL_1_RX_PIN PA1 // S5 output
178 #define SOFTSERIAL_1_TX_PIN PA1 // S5 output
180 #define USE_SOFTSERIAL2
181 #define SOFTSERIAL_2_RX_PIN PA8 // S6 output
182 #define SOFTSERIAL_2_TX_PIN PA8 // S6 output
184 #define SERIAL_PORT_COUNT 6 // VCP, USART1, USART3, USART6, SOFTSERIAL1, SOFTSERIAL2
186 #else // One softserial on versions other than OMNIBUSF4V3
187 #define USE_SOFTSERIAL1
188 #define SOFTSERIAL_1_RX_PIN PC8 // pad labelled CH5 on OMNIBUSF4PRO
189 #define SOFTSERIAL_1_TX_PIN PC9 // pad labelled CH6 on OMNIBUSF4PRO
191 #define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1
196 #define USE_SPI_DEVICE_1
198 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
199 #define USE_SPI_DEVICE_2
200 #define SPI2_NSS_PIN PB12
201 #define SPI2_SCK_PIN PB13
202 #define SPI2_MISO_PIN PB14
203 #define SPI2_MOSI_PIN PB15
206 #define USE_SPI_DEVICE_3
207 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
208 #define SPI3_NSS_PIN PA15
210 #define SPI3_NSS_PIN PB3
212 #define SPI3_SCK_PIN PC10
213 #define SPI3_MISO_PIN PC11
214 #define SPI3_MOSI_PIN PC12
217 #define MAX7456_SPI_BUS BUS_SPI3
218 #define MAX7456_CS_PIN PA15
220 #if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
221 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
223 #define USE_SDCARD_SPI
225 #define SDCARD_SPI_BUS BUS_SPI2
226 #define SDCARD_CS_PIN SPI2_NSS_PIN
228 #define SDCARD_DETECT_PIN PB7
229 #define SDCARD_DETECT_INVERTED
231 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
232 #define M25P16_CS_PIN SPI3_NSS_PIN
233 #define M25P16_SPI_BUS BUS_SPI3
235 #define USE_FLASH_M25P16
239 #define ADC_CHANNEL_1_PIN PC1
240 #define ADC_CHANNEL_2_PIN PC2
243 #define ADC_CHANNEL_3_PIN PC3
245 #define ADC_CHANNEL_3_PIN PA0
248 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
249 #define VBAT_ADC_CHANNEL ADC_CHN_2
250 #define RSSI_ADC_CHANNEL ADC_CHN_3
252 #define SENSORS_SET (SENSOR_ACC|SENSOR_MAG|SENSOR_BARO)
254 #define USE_LED_STRIP
255 #if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)) && !defined(OMNIBUSF4PRO_LEDSTRIPM5)
256 #define WS2811_PIN PB6
258 #define WS2811_PIN PA1
261 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
262 #define DISABLE_RX_PWM_FEATURE
263 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_VBAT | FEATURE_OSD)
265 #define USE_SPEKTRUM_BIND
266 #define BIND_PIN PB11 // USART3 RX
268 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
270 // Number of available PWM outputs
271 #define MAX_PWM_OUTPUT_PORTS 6
272 #define TARGET_MOTOR_COUNT 6
274 #define USE_ESC_SENSOR
276 #define TARGET_IO_PORTA 0xffff
277 #define TARGET_IO_PORTB 0xffff
278 #define TARGET_IO_PORTC 0xffff
279 #define TARGET_IO_PORTD 0xffff
282 #define CURRENT_METER_SCALE 265
285 #define PCA9685_I2C_BUS I2C_EXT_BUS