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)
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/>.
22 #define TARGET_BOARD_IDENTIFIER "SPK2"
24 #define USBD_PRODUCT_STRING "Sparky 2.0"
26 #define USBD_SERIALNUMBER_STRING "0x8020000"
34 #define BEEPER_PIN PC9
35 #define BEEPER_INVERTED
37 #define INVERTER_PIN_UART6 PC6
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
50 #define USE_ACC_SPI_MPU9250
51 #define ACC_MPU9250_ALIGN CW270_DEG
54 #define USE_GYRO_SPI_MPU9250
55 #define GYRO_MPU9250_ALIGN CW270_DEG
58 //#define USE_MAG_HMC5883
59 #define USE_MAG_AK8963
61 //#define MAG_HMC5883_ALIGN CW180_DEG
62 #define MAG_AK8963_ALIGN CW270_DEG
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
75 #define USE_FLASH_M25P16
76 #define USE_FLASH_TOOLS
79 #define USE_USB_DETECT
80 #define USB_DETECT_PIN PA8
83 #define UART1_RX_PIN PA10
84 #define UART1_TX_PIN PA9
85 #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2
88 #define UART3_RX_PIN PB11
89 #define UART3_TX_PIN PB10
92 #define UART6_RX_PIN PC7
93 #define UART6_TX_PIN PC6 //inverter
95 #define SERIAL_PORT_COUNT 4
98 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
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
115 #define USE_I2C_DEVICE_1
116 #define I2C_DEVICE (I2CDEV_1)
119 #define VBAT_ADC_PIN PC1
120 #define CURRENT_METER_ADC_PIN PC2
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))