vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / BLACKPILL_F411 / target.h
blobb6f937bc9b7d933339cf56c2278f8016c3909bdc
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 "BLCKP"
21 #define USBD_PRODUCT_STRING "BLACKPILL_F411"
23 #define LED0 PC13
24 #define LED1 PC14
26 #define BEEPER PB2
27 #define BEEPER_INVERTED
29 // *************** SPI1 Gyro & ACC **********************
30 #define USE_SPI
31 #define USE_SPI_DEVICE_1
33 #define SPI1_SCK_PIN PA5
34 #define SPI1_MISO_PIN PA6
35 #define SPI1_MOSI_PIN PA7
37 #define USE_IMU_MPU6000
38 #define IMU_MPU6000_ALIGN CW0_DEG
39 #define MPU6000_CS_PIN PA4
40 #define MPU6000_SPI_BUS BUS_SPI1
42 #define USE_IMU_MPU9250
43 #define IMU_MPU9250_ALIGN CW0_DEG
44 #define MPU9250_CS_PIN PA4
45 #define MPU9250_SPI_BUS BUS_SPI1
47 #define USE_IMU_MPU6500
48 #define IMU_MPU6500_ALIGN CW0_DEG
49 #define MPU6500_CS_PIN PA4
50 #define MPU6500_SPI_BUS BUS_SPI1
52 // *************** SPI2 OSD OR FLASH*****************************
53 #define USE_SPI_DEVICE_2
54 #define SPI2_SCK_PIN PB13
55 #define SPI2_MISO_PIN PB14
56 #define SPI2_MOSI_PIN PB15
58 #ifdef BLACKPILL_F411_BLACKBOX
59 #define USE_FLASHFS
60 #define USE_FLASH_M25P16
61 #define M25P16_CS_PIN PB12
62 #define M25P16_SPI_BUS BUS_SPI2
63 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
64 #else
65 #define USE_MAX7456
66 #define MAX7456_SPI_BUS BUS_SPI2
67 #define MAX7456_CS_PIN PB12
68 #endif
70 // *************** UART *****************************
71 #define USE_VCP
72 #define VBUS_SENSING_PIN PC15
73 #define VBUS_SENSING_ENABLED
75 #define USE_UART1
76 #define UART1_TX_PIN PA15
77 #define UART1_RX_PIN PB3
79 #define USE_UART2
80 #define UART2_TX_PIN PA2
81 #define UART2_RX_PIN PA3
83 #define USE_SOFTSERIAL1
84 #define SOFTSERIAL_1_TX_PIN PB9 // ST1 pad
85 #define SOFTSERIAL_1_RX_PIN PB9
88 #define USE_SOFTSERIAL2
89 #define SOFTSERIAL_2_TX_PIN PA2 // TX2 pad
90 #define SOFTSERIAL_2_RX_PIN PA2
92 #define SERIAL_PORT_COUNT 5
94 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
95 #define SERIALRX_PROVIDER SERIALRX_SBUS
96 #define SERIALRX_UART SERIAL_PORT_USART2
98 // *************** I2C /Baro/Mag/Pitot ********************
99 #define USE_I2C
100 #define USE_I2C_DEVICE_1
101 #define I2C1_SCL PB6
102 #define I2C1_SDA PB7
104 #define DEFAULT_I2C_BUS BUS_I2C1
106 #define USE_BARO
107 #define BARO_I2C_BUS BUS_I2C1
108 #define USE_BARO_BMP280
109 #define USE_BARO_MS5611
110 #define USE_BARO_BMP085
111 #define USE_BARO_DPS310
112 #define USE_BARO_SPL06
114 #define USE_MAG
115 #define MAG_I2C_BUS BUS_I2C1
116 #define USE_MAG_ALL
118 #define PITOT_I2C_BUS BUS_I2C1
119 #define TEMPERATURE_I2C_BUS BUS_I2C1
121 #define USE_RANGEFINDER
122 #define USE_RANGEFINDER_MSP
123 #define RANGEFINDER_I2C_BUS BUS_I2C1
125 // *************** ADC *****************************
126 #define USE_ADC
127 #define ADC_INSTANCE ADC1
128 #define ADC1_DMA_STREAM DMA2_Stream0
130 #define ADC_CHANNEL_1_PIN PB0
131 #define ADC_CHANNEL_2_PIN PB1
132 #define ADC_CHANNEL_3_PIN PA0
133 #define ADC_CHANNEL_4_PIN PA1
135 #define VBAT_ADC_CHANNEL ADC_CHN_1
136 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
137 #define RSSI_ADC_CHANNEL ADC_CHN_3
138 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
140 // *************** LED2812 ************************
141 #define USE_LED_STRIP
142 #define WS2811_PIN PB10
144 // *************** PINIO ***************************
145 #define USE_PINIO
146 #define USE_PINIOBOX
147 #define PINIO1_PIN PA13 // Camera switcher
149 // *************** OTHERS *************************
150 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
152 #define CURRENT_METER_SCALE 423
154 #define USE_SPEKTRUM_BIND
155 #define BIND_PIN PA3 // RX2
157 #define USE_DSHOT
158 #define USE_ESC_SENSOR
159 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
161 #define TARGET_IO_PORTA 0xffff
162 #define TARGET_IO_PORTB 0xffff
163 #define TARGET_IO_PORTC 0xffff
164 #define TARGET_IO_PORTD (BIT(2))
166 #define MAX_PWM_OUTPUT_PORTS 6