Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / target / SIRINFPV / target.h
blob91a4bee1d2e0bd346013eed1fbb28b81426aa07b
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 "SIRF"
25 #define LED0_PIN PB2
26 #define USE_BEEPER
27 #define BEEPER_PIN PA1
30 #define USE_EXTI
31 #define USE_MPU_DATA_READY_SIGNAL
32 #define USE_GYRO_EXTI
33 #define GYRO_1_EXTI_PIN PA8
34 #define ENSURE_MPU_DATA_READY_IS_LOW
36 #define USE_GYRO
37 #define USE_GYRO_SPI_MPU6000
38 #define USE_GYRO_SPI_MPU6500
40 #define USE_ACC
41 #define USE_ACC_SPI_MPU6000
42 #define USE_ACC_SPI_MPU6500
44 // MPU6000
45 #define GYRO_1_ALIGN CW180_DEG
47 #define GYRO_1_CS_PIN PA4
48 #define GYRO_1_SPI_INSTANCE SPI1
50 // MPU6500
51 //#define GYRO_1_ALIGN CW90_DEG // XXX Must be post-flash configured
53 #define GYRO_1_CS_PIN PA4
54 #define GYRO_1_SPI_INSTANCE SPI1
56 #define USE_VCP
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 6
65 #define USE_ESCSERIAL
66 #define ESCSERIAL_TIMER_TX_PIN PB11 // (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 // PA15
74 #define UART3_TX_PIN PB10 // PB10 (AF7)
75 #define UART3_RX_PIN PB11 // PB11 (AF7)
77 #undef USE_UART1_RX_DMA
78 #undef USE_UART1_TX_DMA
80 #undef USE_I2C
82 #define USE_SPI
83 #define USE_SPI_DEVICE_1
84 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
85 #define USE_SPI_DEVICE_3
87 #define SPI1_NSS_PIN PA4
88 #define SPI1_SCK_PIN PA5
89 #define SPI1_MISO_PIN PA6
90 #define SPI1_MOSI_PIN PA7
92 #define SPI2_NSS_PIN PB12
93 #define SPI2_SCK_PIN PB13
94 #define SPI2_MISO_PIN PB14
95 #define SPI2_MOSI_PIN PB15
97 #define SPI3_NSS_PIN PA15
98 #define SPI3_SCK_PIN PB3
99 #define SPI3_MISO_PIN PB4
100 #define SPI3_MOSI_PIN PB5
101 #define SPI3_TX_DMA_OPT 0 // DMA2_Channel2
102 #define SPI3_RX_DMA_OPT 0 // DMA2_Channel1
104 #define REMAP_TIM17_DMA
106 #define USE_MAX7456
107 #define MAX7456_SPI_INSTANCE SPI3
108 #define MAX7456_SPI_CS_PIN PA15
109 #define MAX7456_DMA_IRQ_HANDLER_ID DMA2_CH1_HANDLER
111 #define USE_VTX_RTC6705
112 #define USE_VTX_RTC6705_SOFTSPI
114 #define RTC6705_SPI_MOSI_PIN PC15
115 #define RTC6705_SPICLK_PIN PC13
116 #define RTC6705_CS_PIN PC14
118 #define USE_SDCARD
119 #define USE_SDCARD_SPI
120 #define SDCARD_SPI_INSTANCE SPI2
121 #define SDCARD_SPI_CS_GPIO SPI2_GPIO
122 #define SDCARD_SPI_CS_PIN SPI2_NSS_PIN
124 // Note, this is the same DMA channel as UART1_RX. Luckily we don't use DMA for USART Rx.
125 #define SDCARD_SPI_DMA_OPT 0 // DMA 1 Channel 5
127 // Performance logging for SD card operations:
128 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
130 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
131 #define USE_ADC
132 #define ADC_INSTANCE ADC1
133 #define VBAT_ADC_PIN PA0
134 #define CURRENT_METER_ADC_PIN PA3
135 #define RSSI_ADC_PIN PA2
137 //#define USE_QUAD_MIXER_ONLY
138 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
141 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
142 #define DEFAULT_FEATURES (FEATURE_RX_SERIAL | FEATURE_OSD)
144 // IO - stm32f303cc in 48pin package
145 #define TARGET_IO_PORTA 0xffff
146 #define TARGET_IO_PORTB 0xffff
147 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
148 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))
150 #define USABLE_TIMER_CHANNEL_COUNT 7
151 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(17))