Create release.yml
[betaflight.git] / src / main / target / BETAFLIGHTF4 / target.h
blob1ea0c7bac4fdd56a4669a4a630ae918cbec7d1dd
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #define TARGET_BOARD_IDENTIFIER "BFF4"
24 #define USBD_PRODUCT_STRING "BetaFlightF4"
26 #define LED0_PIN PB5
28 #define USE_BEEPER
29 #define BEEPER_PIN PB4
30 #define BEEPER_INVERTED
32 // PC13 used as inverter select GPIO for UART2
33 #define INVERTER_PIN_UART2 PC13
35 #define GYRO_1_CS_PIN PA4
36 #define GYRO_1_SPI_INSTANCE SPI1
38 #define USE_ACC
39 #define USE_ACC_SPI_MPU6000
40 #define GYRO_1_ALIGN CW180_DEG
42 #define USE_GYRO
43 #define USE_GYRO_SPI_MPU6000
47 // MPU6000 interrupts
48 #define USE_EXTI
49 #define USE_GYRO_EXTI
50 #define GYRO_1_EXTI_PIN PC4
51 #define USE_MPU_DATA_READY_SIGNAL
53 #define USE_BARO
54 #define USE_BARO_BMP280
55 #define USE_BARO_MS5611
57 #define USE_MAG
58 #define USE_MAG_HMC5883
59 #define USE_MAG_QMC5883
60 #define USE_MAG_LIS3MDL
62 #define USE_MAX7456
63 #define MAX7456_SPI_INSTANCE SPI2
64 #define MAX7456_SPI_CS_PIN PB12
66 #define FLASH_CS_PIN PA15
67 #define FLASH_SPI_INSTANCE SPI3
69 #define USE_FLASHFS
70 #define USE_FLASH_M25P16
72 #define USE_VCP
73 #define USE_USB_DETECT
74 #define USB_DETECT_PIN PC5
77 #define USE_UART1
78 #define UART1_RX_PIN PA10
79 #define UART1_TX_PIN PA9
81 #define USE_UART2
82 #define UART2_RX_PIN PA3
83 #define UART2_TX_PIN PA2
86 #define USE_UART3
87 #define UART3_RX_PIN PB11
88 #define UART3_TX_PIN PB10
90 #define USE_UART6
91 #define UART6_RX_PIN PC7
92 #define UART6_TX_PIN PC6
94 #define USE_SOFTSERIAL1
95 #define USE_SOFTSERIAL2
97 #define SERIAL_PORT_COUNT 7 //VCP, USART1, USART2, USART3, USART6, SOFTSERIAL1, SOFTSERIAL2
99 #define USE_ESCSERIAL
100 #define ESCSERIAL_TIMER_TX_PIN PB8 // (Hardware=0, PPM)
102 #define USE_SPI
104 #define USE_SPI_DEVICE_1
106 #define USE_SPI_DEVICE_2
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 USE_SPI_DEVICE_3
113 #define SPI3_NSS_PIN PA15
114 #define SPI3_SCK_PIN PC10
115 #define SPI3_MISO_PIN PC11
116 #define SPI3_MOSI_PIN PC12
118 #define USE_I2C
119 #define USE_I2C_DEVICE_2
120 #define I2C2_SCL NONE // PB10, UART3_TX
121 #define I2C2_SDA NONE // PB11, UART3_RX
122 #define I2C_DEVICE (I2CDEV_2)
124 #define USE_ADC
125 #define CURRENT_METER_ADC_PIN PC1
126 #define VBAT_ADC_PIN PC2
128 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
129 #define SERIALRX_PROVIDER SERIALRX_SBUS
130 #define SERIALRX_UART SERIAL_PORT_USART6
131 #define SBUS_TELEMETRY_UART SERIAL_PORT_USART2
133 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
134 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD )
136 #define TARGET_IO_PORTA (0xffff & ~(BIT(14)|BIT(13)))
137 #define TARGET_IO_PORTB (0xffff & ~(BIT(2)))
138 #define TARGET_IO_PORTC (0xffff & ~(BIT(15)|BIT(14)))
139 #define TARGET_IO_PORTD BIT(2)
141 #define USABLE_TIMER_CHANNEL_COUNT 12
143 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(9) | TIM_N(10) )