Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / target / X_RACERSPI / target.h
blob93aac6b71858d6a76668b6641b232e1eb50b9d21
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 "XRC3"
25 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE
28 #define LED0_PIN PC14
29 #define USE_BEEPER
30 #define BEEPER_PIN PC15
31 #define BEEPER_INVERTED
33 #define USE_MAG_DATA_READY_SIGNAL
34 #define ENSURE_MAG_DATA_READY_IS_HIGH
36 #define MPU6000_CS_PIN PA15
37 #define MPU6000_SPI_INSTANCE SPI1
40 #define USE_GYRO
41 #define USE_GYRO_SPI_MPU6000
42 #define GYRO_MPU6000_ALIGN CW270_DEG
44 #define USE_ACC
45 #define USE_ACC_SPI_MPU6000
46 #define ACC_MPU6000_ALIGN CW270_DEG
48 // MPU6000 interrupts
49 #define USE_EXTI
50 #define MPU_INT_EXTI PC13
51 #define USE_MPU_DATA_READY_SIGNAL
54 #define USE_FLASHFS
55 #define USE_FLASH_M25P16
57 #define USE_UART1
58 #define USE_UART2
59 #define USE_UART3
60 #define USE_SOFTSERIAL1
61 #define USE_SOFTSERIAL2
63 #define SERIAL_PORT_COUNT 5
65 #define USE_ESCSERIAL
66 #define ESCSERIAL_TIMER_TX_PIN PA0 // (HARDARE=0,PPM)
68 #define UART1_TX_PIN PA9
69 #define UART1_RX_PIN PA10
71 #define UART2_TX_PIN PA2 // PA14 / SWCLK
72 #define UART2_RX_PIN PA3
74 #define UART3_TX_PIN PB10 // PB10 (AF7)
75 #define UART3_RX_PIN PB11 // PB11 (AF7)
77 #define SOFTSERIAL1_RX_PIN PB0 // PWM 5
78 #define SOFTSERIAL1_TX_PIN PB1 // PWM 6
79 #define RANGEFINDER_HCSR04_SOFTSERIAL1_EXCLUSIVE
81 #define USE_I2C
82 #define USE_I2C_DEVICE_1
83 #define I2C_DEVICE (I2CDEV_1)
85 #define USE_SPI
86 #define USE_SPI_DEVICE_1
87 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
88 //GPIO_AF_1
90 #define SPI1_NSS_PIN PA15
91 #define SPI1_SCK_PIN PB3
92 #define SPI1_MISO_PIN PB4
93 #define SPI1_MOSI_PIN PB5
95 #define SPI2_NSS_PIN PB12
96 #define SPI2_SCK_PIN PB13
97 #define SPI2_MISO_PIN PB14
98 #define SPI2_MOSI_PIN PB15
100 #define M25P16_CS_PIN PB12
101 #define M25P16_SPI_INSTANCE SPI2
103 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
104 #define USE_ADC
105 #define ADC_INSTANCE ADC2
106 #define VBAT_ADC_PIN PA4
107 #define CURRENT_METER_ADC_PIN PA5
108 #define RSSI_ADC_PIN PB2
110 #define REMAP_TIM17_DMA
111 // UART1 TX uses DMA1_Channel4, which is also used by dshot on motor 4
112 #if defined(USE_UART1_TX_DMA) && defined(USE_DSHOT)
113 #undef USE_UART1_TX_DMA
114 #endif
116 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
118 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
120 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
122 // IO - stm32f303cc in 48pin package
123 #define TARGET_IO_PORTA 0xffff
124 #define TARGET_IO_PORTB 0xffff
125 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
126 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))
128 #define USABLE_TIMER_CHANNEL_COUNT 17
129 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(15) | TIM_N(16) | TIM_N(17) )