vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / SPEEDYBEEF4 / target.h
blob310f6e9b45619b12fb809e97de515a1baec7513e
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 "SBF4"
21 #define USBD_PRODUCT_STRING "SpeedyBeeF4"
23 /*** Indicators ***/
24 #define LED0 PB9
25 #define BEEPER PC13
26 #define BEEPER_INVERTED
28 #define SENSORS_SET (SENSOR_ACC | SENSOR_MAG | SENSOR_BARO)
30 /*** MPU6000 ***/
31 #define USE_IMU_MPU6000
32 #define MPU6000_CS_PIN PB11
33 #define MPU6000_SPI_BUS BUS_SPI1
34 #define IMU_MPU6000_ALIGN CW0_DEG
36 /*** SPI/I2C bus ***/
37 #define USE_SPI
38 #define USE_SPI_DEVICE_1
39 #define SPI1_SCK_PIN PA5
40 #define SPI1_MISO_PIN PA6
41 #define SPI1_MOSI_PIN PA7
43 #define USE_SPI_DEVICE_2
44 #define SPI2_NSS_PIN PB12
45 #define SPI2_SCK_PIN PB13
46 #define SPI2_MISO_PIN PB14
47 #define SPI2_MOSI_PIN PB15
49 #define USE_SPI_DEVICE_3
50 #define SPI3_SCK_PIN PB3
51 #define SPI3_MISO_PIN PB4
52 #define SPI3_MOSI_PIN PB5
54 #define I2C_DEVICE (I2CDEV_1)
55 #define UG2864_I2C_BUS BUS_I2C1
57 #define USE_I2C
58 #define USE_I2C_DEVICE_1
59 #define I2C1_SCL PB6
60 #define I2C1_SDA PB7
62 /*** Onboard flash ***/
63 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
64 #define M25P16_CS_PIN PC0
65 #define M25P16_SPI_BUS BUS_SPI3
66 #define USE_FLASHFS
67 #define USE_FLASH_M25P16
69 /*** OSD ***/
70 #define USE_MAX7456
71 #define MAX7456_SPI_BUS BUS_SPI2
72 #define MAX7456_CS_PIN PB10
74 /*** Serial ports ***/
75 #define USE_VCP
76 #define VBUS_SENSING_PIN PB12
77 #define VBUS_SENSING_ENABLED
79 #define USE_UART1
80 #define UART1_RX_PIN PA10
81 #define UART1_TX_PIN PA9
83 #define USE_UART2
84 #define UART2_RX_PIN PA3
85 #define UART2_TX_PIN PA2
87 #define USE_UART3
88 #define UART3_RX_PIN PC11
89 #define UART3_TX_PIN PC10
91 #define USE_UART4
92 #define UART4_RX_PIN PA1
93 #define UART4_TX_PIN PA0
95 #define USE_UART5
96 #define UART5_RX_PIN PD2
97 #define UART5_TX_PIN PC12
99 #if defined(SPEEDYBEEF4_SFTSRL1)
100 #define USE_SOFTSERIAL1
101 #define SOFTSERIAL_1_RX_PIN PA15 // S5
102 #define SOFTSERIAL_1_TX_PIN PB8 // S7
104 #define SERIAL_PORT_COUNT 7
106 #elif defined(SPEEDYBEEF4_SFTSRL2)
107 #define USE_SOFTSERIAL1
108 #define SOFTSERIAL_1_RX_PIN PA15 // S5
109 #define SOFTSERIAL_1_TX_PIN PB8 // S7
110 #define USE_SOFTSERIAL2
111 #define SOFTSERIAL_2_RX_PIN PA8 // S6
112 #define SOFTSERIAL_2_TX_PIN PA4 // DAC
114 #define SERIAL_PORT_COUNT 8
116 #else
117 #define SERIAL_PORT_COUNT 6
118 #endif
120 /*** BARO & MAG ***/
121 #define USE_BARO
122 #define BARO_I2C_BUS BUS_I2C1
123 #define USE_BARO_BMP085
124 #define USE_BARO_BMP280
125 #define USE_BARO_MS5611
127 #define USE_MAG
128 #define MAG_I2C_BUS BUS_I2C1
129 #define USE_MAG_ALL
131 /*** ADC ***/
132 #define USE_ADC
133 #define ADC_CHANNEL_1_PIN PC1
134 #define ADC_CHANNEL_2_PIN PC2
135 #define ADC_CHANNEL_3_PIN PC3
137 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
138 #define VBAT_ADC_CHANNEL ADC_CHN_2
139 #define RSSI_ADC_CHANNEL ADC_CHN_3
141 /*** LED STRIP ***/
143 /*** Default settings ***/
144 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_CURRENT_METER | FEATURE_BLACKBOX | FEATURE_VBAT | FEATURE_OSD)
145 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
146 #define SERIALRX_PROVIDER SERIALRX_SBUS
147 #define CURRENT_METER_SCALE 166
149 /*** Timer/PWM output ***/
150 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
151 #define MAX_PWM_OUTPUT_PORTS 7
152 #define USE_DSHOT
153 #define USE_ESC_SENSOR
155 /*** Used pins ***/
156 #define TARGET_IO_PORTA 0xffff
157 #define TARGET_IO_PORTB 0xffff
158 #define TARGET_IO_PORTC 0xffff
159 #define TARGET_IO_PORTD (BIT(2))
161 #define RANGEFINDER_I2C_BUS BUS_I2C1