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
42 #define GYRO_1_EXTI_PIN PC5
43 #define USE_MPU_DATA_READY_SIGNAL
44 #define ENSURE_MPU_DATA_READY_IS_LOW
46 #define GYRO_1_CS_PIN PC4
47 #define GYRO_1_SPI_INSTANCE SPI1
50 #define USE_ACC_SPI_MPU9250
53 #define USE_GYRO_SPI_MPU9250
54 #define GYRO_1_ALIGN CW270_DEG
57 //#define USE_MAG_HMC5883
58 #define USE_MAG_AK8963
60 //#define MAG_HMC5883_ALIGN CW180_DEG
61 #define MAG_AK8963_ALIGN CW270_DEG
64 #define USE_BARO_MS5611
65 //#define USE_BARO_BMP280
67 #define FLASH_CS_PIN PB3
68 #define FLASH_SPI_INSTANCE SPI3
70 //#define RFM22B_CS_PIN PA15
71 //#define RFM22B_SPI_INSTANCE SPI3
74 #define USE_FLASH_M25P16
75 #define USE_FLASH_TOOLS
78 #define USE_USB_DETECT
79 #define USB_DETECT_PIN PA8
82 #define UART1_RX_PIN PA10
83 #define UART1_TX_PIN PA9
86 #define UART3_RX_PIN PB11
87 #define UART3_TX_PIN PB10
90 #define UART6_RX_PIN PC7
91 #define UART6_TX_PIN PC6 //inverter
93 #define SERIAL_PORT_COUNT 4
96 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
100 #define USE_SPI_DEVICE_1 //MPU9250
101 #define SPI1_NSS_PIN PC4
102 #define SPI1_SCK_PIN PA5
103 #define SPI1_MISO_PIN PA6
104 #define SPI1_MOSI_PIN PA7
106 #define USE_SPI_DEVICE_3 //dataflash
107 #define SPI3_NSS_PIN PB3
108 #define SPI3_SCK_PIN PC10
109 #define SPI3_MISO_PIN PC11
110 #define SPI3_MOSI_PIN PC12
113 #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 TARGET_IO_PORTA 0xffff
129 #define TARGET_IO_PORTB 0xffff
130 #define TARGET_IO_PORTC 0xffff
132 #define USABLE_TIMER_CHANNEL_COUNT 11
133 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(12))