2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 //OMNIBUSF7 TARGETS-------------------------
24 #define USE_TARGET_CONFIG
25 #if defined (FPVM_BETAFLIGHTF7)
26 #define TARGET_BOARD_IDENTIFIER "FBF7"
27 #define USBD_PRODUCT_STRING "FPVM_BETAFLIGHTF7"
28 #elif defined (OMNIBUSF7V2)
29 #define TARGET_BOARD_IDENTIFIER "OB72"
30 #define USBD_PRODUCT_STRING "OmnibusF7V2"
32 #define TARGET_BOARD_IDENTIFIER "OBF7"
33 #define USBD_PRODUCT_STRING "OmnibusF7"
36 //LED & BEEPER------------------------------
40 #define BEEPER_PIN PD15
41 #define BEEPER_INVERTED
44 //GYRO & ACC--------------------------------
48 #define USE_ACC_SPI_MPU6500
49 #define USE_GYRO_SPI_MPU6500
52 #define USE_ACC_SPI_MPU6000
53 #define USE_GYRO_SPI_MPU6000
55 //#define USE_MPU_DATA_READY_SIGNAL
59 #if defined(OMNIBUSF7V2)
60 #define GYRO_1_SPI_INSTANCE SPI3
61 #define GYRO_1_CS_PIN PA15
62 #define GYRO_2_SPI_INSTANCE SPI1
63 #define GYRO_2_CS_PIN PA4
64 #define GYRO_1_ALIGN CW90_DEG
65 #define GYRO_1_EXTI_PIN PD0 // MPU6000
66 #define GYRO_2_EXTI_PIN PE8 // ICM20608
68 #elif defined(FPVM_BETAFLIGHTF7)
69 #define GYRO_1_SPI_INSTANCE SPI1
70 #define GYRO_1_CS_PIN PA4
71 #define GYRO_2_SPI_INSTANCE SPI3
72 #define GYRO_2_CS_PIN PA15
73 #define GYRO_1_ALIGN CW90_DEG
74 #define GYRO_2_ALIGN CW270_DEG
75 #define GYRO_1_EXTI_PIN PD0 // Assume the same as OMNIBUSF7V2, need to verify
76 #define GYRO_2_EXTI_PIN PE8 // Ditto
79 #define GYRO_1_SPI_INSTANCE SPI3
80 #define GYRO_1_CS_PIN PA15
81 #define GYRO_2_SPI_INSTANCE SPI1
82 #define GYRO_2_CS_PIN PA4
83 #define GYRO_1_EXTI_PIN PE8 // ICM20608
84 #define GYRO_2_EXTI_PIN PD0 // MPU6000
87 //UARTS-------------------------------------
89 #define USE_USB_DETECT
90 #define USB_DETECT_PIN PC4
93 #define UART1_RX_PIN PA10
94 #define UART1_TX_PIN PA9
96 //#define AVOID_UART2_FOR_PWM_PPM // PPM is not working on RC pin anyway
98 #if defined (FPVM_BETAFLIGHTF7)
99 #define UART2_TX_PIN PA2
101 #define UART2_TX_PIN NONE
103 #define UART2_RX_PIN PA3
105 // Assigned to shared output I2C2
107 #define UART3_RX_PIN PB11
108 #define UART3_TX_PIN PB10
111 #define UART6_RX_PIN PC7
112 #define UART6_TX_PIN PC6
116 #define UART7_RX_PIN PE7
119 #define USE_SOFTSERIAL1
120 #define USE_SOFTSERIAL2
123 #define SERIAL_PORT_COUNT 8
125 #define SERIAL_PORT_COUNT 7
128 #define USE_ESCSERIAL
129 #define ESCSERIAL_TIMER_TX_PIN PA2 // (Unwired UART2_TX)
131 //SPI---------------------------------------
133 #define USE_SPI_DEVICE_1
134 #define USE_SPI_DEVICE_2
135 #define USE_SPI_DEVICE_3
136 #define USE_SPI_DEVICE_4
138 #define SPI1_NSS_PIN PA4
139 #define SPI1_SCK_PIN PA5
140 #define SPI1_MISO_PIN PA6
141 #define SPI1_MOSI_PIN PA7
143 #define SPI2_NSS_PIN PB12
144 #define SPI2_SCK_PIN PB13
145 #define SPI2_MISO_PIN PB14
146 #define SPI2_MOSI_PIN PB15
148 #define SPI3_NSS_PIN PA15
149 #define SPI3_SCK_PIN PC10
150 #define SPI3_MISO_PIN PC11
151 #define SPI3_MOSI_PIN PC12
153 #define SPI4_NSS_PIN PE4
154 #define SPI4_SCK_PIN PE2
155 #define SPI4_MISO_PIN PE5
156 #define SPI4_MOSI_PIN PE6
158 //OSD----------------------------------------
160 #define MAX7456_SPI_INSTANCE SPI2
161 #define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
163 #ifdef FPVM_BETAFLIGHTF7
164 //FLASH--------------------------------------
165 #define FLASH_CS_PIN SPI4_NSS_PIN
166 #define FLASH_SPI_INSTANCE SPI4
169 #define USE_FLASH_M25P16
173 //SD-----------------------------------------
175 #define USE_SDCARD_SPI
176 #define SDCARD_DETECT_INVERTED
177 #define SDCARD_DETECT_PIN PE3
178 #define SDCARD_SPI_INSTANCE SPI4
179 #define SDCARD_SPI_CS_PIN SPI4_NSS_PIN
180 #define SPI4_TX_DMA_OPT 0 // DMA 2 Stream 1 Channel 4
184 //I2C---------------------------------------
186 #define USE_I2C_DEVICE_2
187 #define I2C_DEVICE (I2CDEV_2)
188 #define I2C2_SCL NONE // PB10 (UART3_TX)
189 #define I2C2_SDA NONE // PB11 (UART3_RX)
191 //BARO & Mag--------------------------------
193 #define USE_BARO_BMP280
194 #define USE_BARO_SPI_BMP280
195 #define BARO_SPI_INSTANCE SPI1
196 #define BARO_CS_PIN PA1
199 #define USE_MAG_HMC5883
200 #define USE_MAG_QMC5883
201 #define USE_MAG_LIS3MDL
203 //ADC---------------------------------------
204 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
205 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
208 #define ADC_INSTANCE ADC1
209 #define ADC1_DMA_OPT 1 // DMA 2 Stream 4 Channel 0 (compat default)
210 #define CURRENT_METER_ADC_PIN PC2
211 #define VBAT_ADC_PIN PC3
212 #define RSSI_ADC_PIN PC5
214 // Additional sensors ----------------------
215 #define USE_RANGEFINDER
216 #define USE_RANGEFINDER_HCSR04
217 #define RANGEFINDER_HCSR04_TRIGGER_PIN PB10 // TX3 for testing
218 #define RANGEFINDER_HCSR04_ECHO_PIN PB11 // RX3 for testing
220 //DEFAULTS----------------------------------
222 #define DEFAULT_FEATURES (FEATURE_OSD)
223 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
224 #ifdef FPVM_BETAFLIGHTF7
225 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
226 #define SERIALRX_UART SERIAL_PORT_USART6
227 #define SERIALRX_PROVIDER SERIALRX_SBUS
229 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
230 #define SERIALRX_UART SERIAL_PORT_USART2
231 #define SERIALRX_PROVIDER SERIALRX_SBUS
234 //PORT'S & TIMERS---------------------------
235 #define TARGET_IO_PORTA 0xffff
236 #define TARGET_IO_PORTB 0xffff
237 #define TARGET_IO_PORTC 0xffff
238 #define TARGET_IO_PORTD 0xffff
239 #define TARGET_IO_PORTE 0xffff
241 #ifdef FPVM_BETAFLIGHTF7
242 #define USABLE_TIMER_CHANNEL_COUNT 13
244 #define USABLE_TIMER_CHANNEL_COUNT 12
247 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(9) )