Create release.yml
[betaflight.git] / src / main / target / BEEROTORF4 / target.h
blob74f309fb081d3045724c93963cca387a470a1811
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
22 #define TARGET_BOARD_IDENTIFIER "BRF4"
24 #define USBD_PRODUCT_STRING "BeeRotorF4"
26 #define LED0_PIN PB4
28 #define USE_BEEPER
29 #define BEEPER_PIN PB3
30 #define BEEPER_INVERTED
32 // Tim_UP 1 (motors 1 & 2) conflicts with Tim 4 Ch 3 (LED_STRIP)
33 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_OFF
35 // ICM20689 interrupt
36 #define USE_EXTI
37 #define USE_GYRO_EXTI
38 #define GYRO_1_EXTI_PIN PA8
39 #define USE_MPU_DATA_READY_SIGNAL
40 #define ENSURE_MPU_DATA_READY_IS_LOW
42 #define GYRO_1_CS_PIN SPI1_NSS_PIN
43 #define GYRO_1_SPI_INSTANCE SPI1
45 #define USE_ACC
46 #define USE_ACC_SPI_ICM20689
48 #define USE_GYRO
49 #define USE_GYRO_SPI_ICM20689
50 #define GYRO_1_ALIGN CW270_DEG
52 #define USE_BARO
53 #define USE_BARO_BMP280
55 #define USE_MAX7456
56 #define MAX7456_SPI_INSTANCE SPI3
57 #define MAX7456_SPI_CS_PIN SPI3_NSS_PIN
59 #define SPI3_TX_DMA_OPT 0 // DMA 1 Stream 5 Channel 0
60 #define SPI3_RX_DMA_OPT 0 // DMA 1 Stream 0 Channel 0
62 #define USE_SDCARD
63 #define USE_SDCARD_SPI
64 #define SDCARD_DETECT_PIN PC3
65 #define SDCARD_DETECT_INVERTED
66 #define SDCARD_SPI_INSTANCE SPI2
67 #define SDCARD_SPI_CS_PIN SPI2_NSS_PIN
68 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
70 #define USE_VCP
71 #define USE_USB_DETECT
72 #define USB_DETECT_PIN PC5
74 #define USE_UART1
75 #define UART1_RX_PIN PA10
76 #define UART1_TX_PIN PA9
78 //SerialRX
79 #define USE_UART2
80 #define UART2_RX_PIN PA3 //Shared with PPM
81 #define UART2_TX_PIN PA2
83 #define INVERTER_PIN_UART2 PC15
85 //Telemetry
86 #define USE_UART3
87 #define UART3_RX_PIN PB11
88 #define UART3_TX_PIN PB10
90 #define INVERTER_PIN_UART3 PC14
92 #define SERIAL_PORT_COUNT 4
94 #define USE_ESCSERIAL
95 #define ESCSERIAL_TIMER_TX_PIN PA3 // (HARDARE=0,PPM)
97 #define USE_SPI
99 //ICM20689
100 #define USE_SPI_DEVICE_1
101 #define SPI1_NSS_PIN PA4
102 #define SPI1_SCK_PIN PA5
103 #define SPI1_MISO_PIN PA6
104 #define SPI1_MOSI_PIN PA7
106 //SDCard
107 #define USE_SPI_DEVICE_2
108 #define SPI2_NSS_PIN PB12
109 #define SPI2_SCK_PIN PB13
110 #define SPI2_MISO_PIN PB14
111 #define SPI2_MOSI_PIN PB15
113 //MAX7456 / SPI RX
114 #define USE_SPI_DEVICE_3
115 #define SPI3_NSS_PIN PA15
116 #define SPI3_SCK_PIN PC10
117 #define SPI3_MISO_PIN PC11
118 #define SPI3_MOSI_PIN PC12
119 //#define SPI_RX_CS_PIN PD2
121 #define USE_I2C
122 #define USE_I2C_DEVICE_1
123 #define I2C_DEVICE (I2CDEV_1)
124 #define I2C1_SCL PB6
125 #define I2C1_SDA PB7
127 #define USE_ADC
128 #define ADC_INSTANCE ADC1 // Default added
129 #define ADC1_DMA_OPT 0 // DMA 2 Stream 0 Channel 0
132 #define VBAT_ADC_PIN PC0
134 #define CURRENT_METER_ADC_PIN PC1
136 #define RSSI_ADC_PIN PC2
138 #define USE_TRANSPONDER
140 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_AIRMODE )
141 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
142 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
143 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
145 #define SERIALRX_PROVIDER SERIALRX_SBUS
146 #define SERIALRX_UART SERIAL_PORT_USART2
148 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
150 #define TARGET_IO_PORTA 0xffff
151 #define TARGET_IO_PORTB 0xffff
152 #define TARGET_IO_PORTC 0xffff
153 #define TARGET_IO_PORTD (BIT(2))
155 #define USABLE_TIMER_CHANNEL_COUNT 10
156 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(9) )