Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / target / SPARKY2 / target.h
blobc55e4de9bb772f0abe01a8e91edcee1ab80233de
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 "SPK2"
24 #define USBD_PRODUCT_STRING "Sparky 2.0"
25 #ifdef OPBL
26 #define USBD_SERIALNUMBER_STRING "0x8020000"
27 #endif
29 #define LED0_PIN PB5
30 #define LED1_PIN PB4
31 #define LED2_PIN PB6
33 #define USE_BEEPER
34 #define BEEPER_PIN PC9
35 #define BEEPER_INVERTED
37 #define INVERTER_PIN_UART6 PC6
39 // MPU9250 interrupt
40 #define USE_EXTI
41 #define MPU_INT_EXTI PC5
42 //#define DEBUG_MPU_DATA_READY_INTERRUPT
43 #define USE_MPU_DATA_READY_SIGNAL
44 #define ENSURE_MPU_DATA_READY_IS_LOW
46 #define MPU9250_CS_PIN PC4
47 #define MPU9250_SPI_INSTANCE SPI1
49 #define USE_ACC
50 #define USE_ACC_SPI_MPU9250
51 #define ACC_MPU9250_ALIGN CW270_DEG
53 #define USE_GYRO
54 #define USE_GYRO_SPI_MPU9250
55 #define GYRO_MPU9250_ALIGN CW270_DEG
57 #define USE_MAG
58 //#define USE_MAG_HMC5883
59 #define USE_MAG_AK8963
61 //#define MAG_HMC5883_ALIGN CW180_DEG
62 #define MAG_AK8963_ALIGN CW270_DEG
64 #define USE_BARO
65 #define USE_BARO_MS5611
66 //#define USE_BARO_BMP280
68 #define M25P16_CS_PIN PB3
69 #define M25P16_SPI_INSTANCE SPI3
71 //#define RFM22B_CS_PIN PA15
72 //#define RFM22B_SPI_INSTANCE SPI3
74 #define USE_FLASHFS
75 #define USE_FLASH_M25P16
76 #define USE_FLASH_TOOLS
78 #define USE_VCP
79 #define USE_USB_DETECT
80 #define USB_DETECT_PIN PA8
82 #define USE_UART1
83 #define UART1_RX_PIN PA10
84 #define UART1_TX_PIN PA9
85 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
87 #define USE_UART3
88 #define UART3_RX_PIN PB11
89 #define UART3_TX_PIN PB10
91 #define USE_UART6
92 #define UART6_RX_PIN PC7
93 #define UART6_TX_PIN PC6 //inverter
95 #define SERIAL_PORT_COUNT 4
97 #define USE_ESCSERIAL
98 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
100 #define USE_SPI
102 #define USE_SPI_DEVICE_1 //MPU9250
103 #define SPI1_NSS_PIN PC4
104 #define SPI1_SCK_PIN PA5
105 #define SPI1_MISO_PIN PA6
106 #define SPI1_MOSI_PIN PA7
108 #define USE_SPI_DEVICE_3 //dataflash
109 #define SPI3_NSS_PIN PB3
110 #define SPI3_SCK_PIN PC10
111 #define SPI3_MISO_PIN PC11
112 #define SPI3_MOSI_PIN PC12
114 #define USE_I2C
115 #define USE_I2C_DEVICE_1
116 #define I2C_DEVICE (I2CDEV_1)
118 #define USE_ADC
119 #define VBAT_ADC_PIN PC1
120 #define CURRENT_METER_ADC_PIN PC2
122 #undef USE_LED_STRIP
124 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
125 #define SERIALRX_PROVIDER SERIALRX_SBUS
126 #define SERIALRX_UART SERIAL_PORT_USART6
128 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
130 #define TARGET_IO_PORTA 0xffff
131 #define TARGET_IO_PORTB 0xffff
132 #define TARGET_IO_PORTC 0xffff
134 #define USABLE_TIMER_CHANNEL_COUNT 11
135 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(12) | TIM_N(8) | TIM_N(9))