[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / target / OMNIBUS / target.h
blobcdd1b8d33a45fd0c3da90cabc000aa2218c89d99
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 #define TARGET_BOARD_IDENTIFIER "OMNI" // https://en.wikipedia.org/wiki/Omnibus
22 #define BEEPER PC15
23 #define BEEPER_INVERTED
25 #define USE_SPI
26 #define USE_SPI_DEVICE_1
28 #define SPI1_NSS_PIN PA4
29 #define SPI1_SCK_PIN PA5
30 #define SPI1_MISO_PIN PA6
31 #define SPI1_MOSI_PIN PA7
33 #undef USE_VTX_SMARTAUDIO // Disabled due to flash size
35 #define USE_EXTI
37 #define USE_IMU_MPU6000
38 #define IMU_MPU6000_ALIGN CW90_DEG
39 #define MPU6000_SPI_BUS BUS_SPI1
40 #define MPU6000_CS_PIN PA4
41 #define GYRO_INT_EXTI PC13
42 #define USE_MPU_DATA_READY_SIGNAL
45 #define USE_BARO
46 #define USE_BARO_BMP280
47 #define BMP280_SPI_BUS BUS_SPI1
48 #define BMP280_CS_PIN PA13
50 #define USE_MAG
51 #define MAG_I2C_BUS BUS_I2C1
52 #define USE_MAG_HMC5883
53 #define USE_MAG_QMC5883
54 #define USE_MAG_IST8310
55 #define USE_MAG_IST8308
56 // #define USE_MAG_MAG3110
57 // #define USE_MAG_LIS3MDL
58 // #define USE_MAG_AK8975
60 // Disable certain features to save flash space
61 #undef USE_GPS_PROTO_MTK
63 #define USB_CABLE_DETECTION
64 #define USB_DETECT_PIN PB5
66 #define USE_VCP
67 #define USE_UART1
68 #define USE_UART2
69 #define USE_UART3
70 #define SERIAL_PORT_COUNT 4
72 #define UART1_TX_PIN PA9
73 #define UART1_RX_PIN PA10
75 #define UART2_TX_PIN PA14 // PA14 / SWCLK
76 #define UART2_RX_PIN PA15
78 #define UART3_TX_PIN PB10 // PB10 (AF7)
79 #define UART3_RX_PIN PB11 // PB11 (AF7)
81 // Enable I2C instead of PWM7&8 for iNav
82 #define USE_I2C
83 #define USE_I2C_DEVICE_1 // PB6/SCL(PWM8), PB7/SDA(PWM7)
84 #define USE_I2C_PULLUP
86 #define PITOT_I2C_BUS BUS_I2C1
88 #define USE_SPI
89 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
91 #define SPI2_NSS_PIN PB12
92 #define SPI2_SCK_PIN PB13
93 #define SPI2_MISO_PIN PB14
94 #define SPI2_MOSI_PIN PB15
96 //#define USE_RX_SPI
97 #define RX_SPI_INSTANCE SPI2
98 #define RX_NSS_PIN PB3
100 #define USE_SDCARD
101 #define USE_SDCARD_SPI
102 #define SDCARD_DETECT_INVERTED
103 #define SDCARD_DETECT_PIN PC14
104 #define SDCARD_SPI_BUS BUS_SPI2
105 #define SDCARD_CS_PIN SPI2_NSS_PIN
107 #define USE_OSD
108 #define USE_MAX7456
109 #define MAX7456_SPI_BUS BUS_SPI1
110 #define MAX7456_CS_PIN PB1
112 #define USE_ADC
113 #define ADC_INSTANCE ADC1
114 //#define BOARD_HAS_VOLTAGE_DIVIDER
115 #define ADC_CHANNEL_1_PIN PA0
116 #define ADC_CHANNEL_2_PIN PA1
117 #define ADC_CHANNEL_3_PIN PB2
118 #define ADC_CHANNEL_3_INSTANCE ADC2
119 #define VBAT_ADC_CHANNEL ADC_CHN_1
120 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
121 #define RSSI_ADC_CHANNEL ADC_CHN_3
123 #define USE_LED_STRIP
124 #define WS2811_PIN PA8
126 //#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
128 #define DEFAULT_RX_TYPE RX_TYPE_PPM
129 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_BLACKBOX | FEATURE_OSD)
131 #define BUTTONS
132 #define BUTTON_A_PORT GPIOB // Non-existent (PB1 used for RSSI/MAXCS)
133 #define BUTTON_A_PIN Pin_1
134 #define BUTTON_B_PORT GPIOB // TRIG button, used for BINDPLUG_PIN
135 #define BUTTON_B_PIN Pin_0
137 #define USE_SPEKTRUM_BIND
138 // USART3
139 #define BIND_PIN PB11
141 #define HARDWARE_BIND_PLUG
142 #define BINDPLUG_PIN PB0
144 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
146 // Number of available PWM outputs
147 #define MAX_PWM_OUTPUT_PORTS 6
149 #define TARGET_IO_PORTA 0xffff
150 #define TARGET_IO_PORTB 0xffff
151 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
152 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))