Create release.yml
[betaflight.git] / src / main / target / SPRACINGF3EVO / target.h
blob0ff1ba9d16b075167d0f52a1b5789c2abed7655f
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 #ifdef AIORACERF3
24 #define TARGET_BOARD_IDENTIFIER "ARF3"
25 #elif SPRACINGF3MQ
26 #define TARGET_BOARD_IDENTIFIER "SPMQ"
27 #else
28 #define TARGET_BOARD_IDENTIFIER "SPEV"
29 #endif
31 #if !defined(AIORACERF3)
32 #define USE_TARGET_CONFIG
33 #endif
35 #ifdef SPRACINGF3MQ
36 #define BRUSHED_MOTORS
38 #ifndef SPRACINGF3MQ_REV
39 #define SPRACINGF3MQ_REV 2
40 #endif
42 #endif // SPRACINGF3MQ
46 #define LED0_PIN PB8
48 #define USE_BEEPER
49 #define BEEPER_PIN PC15
50 #define BEEPER_INVERTED
52 #define USE_EXTI
53 #define USE_GYRO_EXTI
54 #define GYRO_1_EXTI_PIN PC13
55 #define USE_MPU_DATA_READY_SIGNAL
56 #define ENSURE_MPU_DATA_READY_IS_LOW
58 #define USE_MAG_DATA_READY_SIGNAL
59 #define ENSURE_MAG_DATA_READY_IS_HIGH
61 #define USE_GYRO
62 #define USE_GYRO_SPI_MPU6500
64 #define USE_ACC
65 #define USE_ACC_SPI_MPU6500
67 #define GYRO_1_ALIGN CW180_DEG
69 #define USE_BARO
70 #define USE_BARO_BMP280
72 #define USE_MAG
73 #define USE_MAG_AK8963
74 //#define USE_MAG_HMC5883 // External
76 #define MAG_AK8963_ALIGN CW270_DEG_FLIP
78 //#define USE_RANGEFINDER
79 //#define USE_RANGEFINDER_HCSR04
81 #define USE_VCP
82 #define USE_UART1
83 #define USE_UART2
84 #define USE_UART3
85 // Disabled to make the target fit into flash
86 //#define USE_SOFTSERIAL1
87 //#define USE_SOFTSERIAL2
89 #define SOFTSERIAL1_RX_PIN PA6 // PWM 5
90 #define SOFTSERIAL1_TX_PIN PA7 // PWM 6
92 #define SOFTSERIAL2_RX_PIN PB0 // PWM 7
93 #define SOFTSERIAL2_TX_PIN PB1 // PWM 8
95 #define SERIAL_PORT_COUNT 4
97 #define USE_ESCSERIAL
98 #define ESCSERIAL_TIMER_TX_PIN PA15 // (HARDARE=0,PPM)
100 #define UART1_TX_PIN PA9
101 #define UART1_RX_PIN PA10
103 #define UART2_TX_PIN PA14 // PA14 / SWCLK
104 #define UART2_RX_PIN PA15
106 #define UART3_TX_PIN PB10 // PB10 (AF7)
107 #define UART3_RX_PIN PB11 // PB11 (AF7)
109 #define USE_I2C
110 #define USE_I2C_DEVICE_1
111 #define I2C_DEVICE (I2CDEV_1)
113 #define USE_SPI
114 #define USE_SPI_DEVICE_1 // PB9,3,4,5 on AF5 SPI1 (MPU)
115 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5 SPI2 (SDCard)
117 #define SPI1_NSS_PIN PB9
118 #define SPI1_SCK_PIN PB3
119 #define SPI1_MISO_PIN PB4
120 #define SPI1_MOSI_PIN PB5
122 #define SPI2_NSS_PIN PB12
123 #define SPI2_SCK_PIN PB13
124 #define SPI2_MISO_PIN PB14
125 #define SPI2_MOSI_PIN PB15
127 #define USE_SDCARD
128 #define USE_SDCARD_SPI
129 #define SDCARD_DETECT_INVERTED
130 #define SDCARD_DETECT_PIN PC14
131 #define SDCARD_SPI_INSTANCE SPI2
132 #define SDCARD_SPI_CS_PIN SPI2_NSS_PIN
134 // Note, this is the same DMA channel as UART1_RX. Luckily we don't use DMA for USART Rx.
135 #define SDCARD_DMA_CHANNEL_TX DMA1_Channel5
137 #define GYRO_1_CS_PIN PB9
138 #define GYRO_1_SPI_INSTANCE SPI1
140 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
142 #define USE_ADC
143 #define ADC_INSTANCE ADC2
144 #define RSSI_ADC_PIN PB2
145 #ifdef AIORACERF3
146 #define VBAT_ADC_PIN PA5
147 #define CURRENT_METER_ADC_PIN PA4
148 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
149 #else
150 #define VBAT_ADC_PIN PA4
151 #define CURRENT_METER_ADC_PIN PA5
152 #endif
154 #if !defined(AIORACERF3)
155 #define USE_OSD
156 #define USE_OSD_OVER_MSP_DISPLAYPORT
157 #define USE_MSP_CURRENT_METER
158 #endif
160 #define USE_TRANSPONDER
162 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
164 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
165 #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY)
167 // IO - stm32f303cc in 48pin package
168 #define TARGET_IO_PORTA 0xffff
169 #define TARGET_IO_PORTB 0xffff
170 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
171 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
173 #define USABLE_TIMER_CHANNEL_COUNT 12 // PPM, 8 PWM, UART3 RX/TX, LED Strip
174 #ifdef AIORACERF3
175 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(8) | TIM_N(15) | TIM_N(17))
176 #else
177 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(8) | TIM_N(15) | TIM_N(16))
178 #endif