vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / OMNIBUSF7 / target.h
bloba5f1bfc6b87a18ca054e03a48ce0b617e57b570b
1 /*
2 * This is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * This software is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this software. If not, see <http://www.gnu.org/licenses/>.
16 #pragma once
18 #ifdef OMNIBUSF7V2
19 #define TARGET_BOARD_IDENTIFIER "OB72"
20 #define USBD_PRODUCT_STRING "OmnibusF7V2"
21 #else
22 #define TARGET_BOARD_IDENTIFIER "OBF7"
23 #define USBD_PRODUCT_STRING "OmnibusF7"
24 #endif
26 // Use target-specific hardware descriptors (don't use common_hardware.h)
27 #define USE_TARGET_HARDWARE_DESCRIPTORS
29 #define LED0 PE0
31 #define BEEPER PD15
32 #define BEEPER_INVERTED
34 #define USE_DUAL_GYRO
36 // ICM-20608-G
38 // MPU6000
40 #ifdef OMNIBUSF7V2
41 #define USE_IMU_MPU6000
42 #define IMU_MPU6000_ALIGN CW0_DEG
43 #define MPU6000_CS_PIN SPI1_NSS_PIN
44 #define MPU6000_SPI_BUS BUS_SPI1
46 #define USE_IMU_MPU6500
47 #define IMU_MPU6500_ALIGN CW90_DEG
48 #define MPU6500_CS_PIN SPI3_NSS_PIN
49 #define MPU6500_SPI_BUS BUS_SPI3
50 #else
51 #define USE_IMU_MPU6000
52 #define IMU_MPU6000_ALIGN CW0_DEG
53 #define MPU6000_CS_PIN SPI3_NSS_PIN
54 #define MPU6000_SPI_BUS BUS_SPI3
56 #define USE_IMU_MPU6500
57 #define IMU_MPU6500_ALIGN CW0_DEG
58 #define MPU6500_CS_PIN SPI1_NSS_PIN
59 #define MPU6500_SPI_BUS BUS_SPI1
60 #endif
63 #define USE_VCP
64 #define VBUS_SENSING_PIN PC4
66 #define USE_UART1
67 #define UART1_RX_PIN PA10
68 #define UART1_TX_PIN PA9
70 #define USE_UART2
71 #define UART2_TX_PIN PA2 //not wired
72 #define UART2_RX_PIN PA3
74 // Assigned to shared output I2C2
75 #define USE_UART3
76 #define UART3_RX_PIN PB11
77 #define UART3_TX_PIN PB10
79 #define USE_UART6
80 #define UART6_RX_PIN PC7
81 #define UART6_TX_PIN PC6
83 #ifdef OMNIBUSF7V2
84 #define USE_UART7
85 #define UART7_RX_PIN PE7
86 #define UART7_TX_PIN NONE
87 #endif
89 #ifdef OMNIBUSF7V2
90 #define SERIAL_PORT_COUNT 6 //VCP, USART1, USART2, USART3, USART6, USART7
91 // #define SERIAL_PORT_COUNT 5 //VCP, USART1, USART2, USART3, USART6
92 #else
93 #define SERIAL_PORT_COUNT 5 //VCP, USART1, USART2, USART3, USART6
94 #endif
96 #define USE_SPI
97 #define USE_SPI_DEVICE_1
98 #define USE_SPI_DEVICE_2
99 #define USE_SPI_DEVICE_3
100 #define USE_SPI_DEVICE_4
102 #define SPI1_NSS_PIN PA4
103 #define SPI1_SCK_PIN PA5
104 #define SPI1_MISO_PIN PA6
105 #define SPI1_MOSI_PIN PA7
107 #define SPI2_NSS_PIN PB12
108 #define SPI2_SCK_PIN PB13
109 #define SPI2_MISO_PIN PB14
110 #define SPI2_MOSI_PIN PB15
112 #define SPI3_NSS_PIN PA15
113 #define SPI3_SCK_PIN PC10
114 #define SPI3_MISO_PIN PC11
115 #define SPI3_MOSI_PIN PC12
117 #define SPI4_NSS_PIN PE4
118 #define SPI4_SCK_PIN PE2
119 #define SPI4_MISO_PIN PE5
120 #define SPI4_MOSI_PIN PE6
122 #define USE_MAX7456
123 #define MAX7456_SPI_BUS BUS_SPI2
124 #define MAX7456_CS_PIN SPI2_NSS_PIN
126 #define USE_SDCARD
127 #define USE_SDCARD_SPI
128 #define SDCARD_DETECT_INVERTED
129 #define SDCARD_DETECT_PIN PE3
130 #define SDCARD_SPI_BUS BUS_SPI4
131 #define SDCARD_CS_PIN SPI4_NSS_PIN
133 #define USE_I2C
134 #define USE_I2C_DEVICE_2
135 #define I2C_DEVICE_2_SHARES_UART3
137 #define USE_BARO
138 #define USE_BARO_BMP280
139 #define BMP280_SPI_BUS BUS_SPI1
140 #define BMP280_CS_PIN PA1
142 #define USE_MAG
143 #define MAG_I2C_BUS BUS_I2C2
144 #define USE_MAG_ALL
146 #define TEMPERATURE_I2C_BUS BUS_I2C2
148 #define USE_RANGEFINDER
149 #define RANGEFINDER_I2C_BUS BUS_I2C2
151 #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO)
153 #define USE_ADC
154 #define ADC_CHANNEL_1_PIN PC2
155 #define ADC_CHANNEL_2_PIN PC3
156 #define ADC_CHANNEL_3_PIN PC5
157 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
158 #define VBAT_ADC_CHANNEL ADC_CHN_2
159 #define RSSI_ADC_CHANNEL ADC_CHN_3
161 // #define USE_LED_STRIP
163 //Following configuration needs to be reviewed, when LED is enabled, VCP stops to work
164 //Until someone with deeper knowledge od DMA fixes it, LED are disabled in target
165 #define WS2811_PIN PD12
167 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
169 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD)
170 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
171 #define SERIALRX_PROVIDER SERIALRX_SBUS
172 #define SERIALRX_UART SERIAL_PORT_USART2
174 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
176 // Number of available PWM outputs
177 #define MAX_PWM_OUTPUT_PORTS 4
178 #define TARGET_MOTOR_COUNT 4
179 #define USE_DSHOT
180 #define USE_ESC_SENSOR
182 #define TARGET_IO_PORTA 0xffff
183 #define TARGET_IO_PORTB 0xffff
184 #define TARGET_IO_PORTC 0xffff
185 #define TARGET_IO_PORTD 0xffff
186 #define TARGET_IO_PORTE 0xffff