vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / BETAFLIGHTF4 / target.h
blob05f35872986e90465fe3982f20db5da3a23c2dd6
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 "BFF4"
21 #define USBD_PRODUCT_STRING "BetaFlightF4"
23 //#define USE_ESC_SENSOR
25 #define LED0 PB5
27 #define BEEPER PB4
28 #define BEEPER_INVERTED
30 #define MPU6000_CS_PIN PA4
31 #define MPU6000_SPI_BUS BUS_SPI1
33 #define USE_IMU_MPU6000
34 #define IMU_MPU6000_ALIGN CW180_DEG
36 #define USE_BARO
37 #define USE_BARO_BMP280
39 #define BMP280_SPI_BUS BUS_SPI2
40 #define BMP280_CS_PIN PB3
42 #define USE_MAX7456
43 #define MAX7456_SPI_BUS BUS_SPI2
44 #define MAX7456_CS_PIN PB12
45 //#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz // XXX
46 //#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST) // XXX
48 #define M25P16_CS_PIN PA15
49 #define M25P16_SPI_BUS BUS_SPI3
51 #define USE_FLASHFS
52 #define USE_FLASH_M25P16
54 #define USE_VCP
55 #define VBUS_SENSING_PIN PC5
56 #define VBUS_SENSING_ENABLED
58 #define USE_UART_INVERTER
60 #define USE_UART1
61 #define UART1_RX_PIN PA10
62 #define UART1_TX_PIN PA9
63 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
65 #define USE_UART2
66 #define UART2_RX_PIN PA3
67 #define UART2_TX_PIN PA2
68 // PC13 used as inverter select GPIO for UART2
69 #define INVERTER_PIN_UART2_RX PC13
71 #define USE_UART3
72 #define UART3_RX_PIN PB11
73 #define UART3_TX_PIN PB10
75 #define USE_UART6
76 #define UART6_RX_PIN PC7
77 #define UART6_TX_PIN PC6
79 //#define USE_SOFTSERIAL1
80 //#define USE_SOFTSERIAL2
82 #define SERIAL_PORT_COUNT 5 //VCP, USART1, USART2, USART3, USART6, SOFTSERIAL1, SOFTSERIAL2
84 //#define USE_ESCSERIAL // XXX
85 //#define ESCSERIAL_TIMER_TX_PIN PB8 // (Hardware=0, PPM)
87 #define USE_SPI
89 #define USE_SPI_DEVICE_1
90 #define SPI1_NSS_PIN NONE
91 #define SPI1_SCK_PIN PA5
92 #define SPI1_MISO_PIN PA6
93 #define SPI1_MOSI_PIN PA7
95 #define USE_SPI_DEVICE_2
96 #define SPI2_NSS_PIN PB12
97 #define SPI2_SCK_PIN PB13
98 #define SPI2_MISO_PIN PB14
99 #define SPI2_MOSI_PIN PB15
101 #define USE_SPI_DEVICE_3
102 #define SPI3_NSS_PIN PA15
103 #define SPI3_SCK_PIN PC10
104 #define SPI3_MISO_PIN PC11
105 #define SPI3_MOSI_PIN PC12
107 #define USE_I2C
108 #define USE_I2C_DEVICE_2
109 #define I2C2_SCL PB10 // PB10, UART3_TX
110 #define I2C2_SDA PB11 // PB11, UART3_RX
111 //#define I2C_DEVICE (I2CDEV_2)
113 #define USE_MAG
114 #define MAG_I2C_BUS BUS_I2C2
115 #define USE_MAG_ALL
117 #define TEMPERATURE_I2C_BUS BUS_I2C2
119 #define USE_BARO
120 #define BARO_I2C_BUS BUS_I2C2
121 #define USE_BARO_BMP085
122 #define USE_BARO_BMP280
123 #define USE_BARO_MS5611
125 #define USE_PITOT_ADC
126 #define PITOT_I2C_BUS BUS_I2C2
128 #define USE_RANGEFINDER
129 #define RANGEFINDER_I2C_BUS BUS_I2C2
131 #define USE_ADC
132 #define ADC_CHANNEL_1_PIN PC1
133 #define ADC_CHANNEL_2_PIN PC2
134 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
135 #define VBAT_ADC_CHANNEL ADC_CHN_2
137 #define USE_LED_STRIP
138 #define WS2811_PIN PB6
140 #define SERIALRX_PROVIDER SERIALRX_SBUS
141 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
142 #define SERIALRX_UART SERIAL_PORT_USART6
144 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
145 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_TELEMETRY | FEATURE_OSD )
147 #define USE_SPEKTRUM_BIND
148 // USART3,
149 #define BIND_PIN PB11
151 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
153 #define TARGET_IO_PORTA (0xffff & ~(BIT(14)|BIT(13)))
154 #define TARGET_IO_PORTB (0xffff & ~(BIT(2)))
155 #define TARGET_IO_PORTC (0xffff & ~(BIT(15)|BIT(14)))
156 #define TARGET_IO_PORTD BIT(2)
158 #define MAX_PWM_OUTPUT_PORTS 4
160 #define USE_DSHOT
161 #define USE_ESC_SENSOR