2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
19 #define TARGET_BOARD_IDENTIFIER "SPK2"
21 #define USBD_PRODUCT_STRING "Sparky 2.0"
23 #define USBD_SERIALNUMBER_STRING "0x8020000"
33 #define USE_MPU_DATA_READY_SIGNAL
34 #define ENSURE_MPU_DATA_READY_IS_LOW
36 #define USE_IMU_MPU9250
37 #define IMU_MPU9250_ALIGN CW270_DEG
39 #define MPU9250_SPI_BUS BUS_SPI1
40 #define MPU9250_CS_PIN PC4
41 #define GYRO_INT_EXTI PC5
44 #define USE_MAG_MPU9250
46 #define MAG_I2C_BUS BUS_I2C1
47 #define USE_MAG_HMC5883
48 #define USE_MAG_QMC5883
49 #define USE_MAG_IST8310
50 #define USE_MAG_IST8308
51 #define USE_MAG_MAG3110
52 #define USE_MAG_LIS3MDL
54 #define TEMPERATURE_I2C_BUS BUS_I2C1
55 #define BNO055_I2C_BUS BUS_I2C1
58 #define BARO_I2C_BUS BUS_I2C1
59 #define USE_BARO_MS5611
60 #define USE_BARO_BMP085
61 #define USE_BARO_BMP280
63 #define M25P16_CS_PIN PB3
64 #define M25P16_SPI_BUS BUS_SPI3
66 //#define RFM22B_CS_PIN PA15
67 //#define RFM22B_SPI_INSTANCE SPI3
70 #define USE_FLASH_M25P16
71 #define USE_FLASH_TOOLS
74 #define VBUS_SENSING_PIN PA8
76 #define USE_UART_INVERTER
79 #define UART1_RX_PIN PA10
80 #define UART1_TX_PIN PA9
83 #define UART3_RX_PIN PB11
84 #define UART3_TX_PIN PB10
87 #define UART6_RX_PIN PC7
88 #define UART6_TX_PIN PC6 //inverter
89 #define INVERTER_PIN_UART6_RX PC6
91 #define SERIAL_PORT_COUNT 4
95 #define USE_SPI_DEVICE_1 //MPU9250
96 #define SPI1_NSS_PIN PC4
97 #define SPI1_SCK_PIN PA5
98 #define SPI1_MISO_PIN PA6
99 #define SPI1_MOSI_PIN PA7
101 #define USE_SPI_DEVICE_3 //dataflash
102 #define SPI3_NSS_PIN PB3
103 #define SPI3_SCK_PIN PC10
104 #define SPI3_MISO_PIN PC11
105 #define SPI3_MOSI_PIN PC12
108 #define USE_I2C_DEVICE_1
109 #define USE_I2C_DEVICE_2
110 #define I2C_DEVICE_2_SHARES_UART3
113 #define ADC_CHANNEL_1_PIN PC2
114 #define ADC_CHANNEL_2_PIN PC3
115 #define VBAT_ADC_CHANNEL ADC_CHN_2
116 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
118 // #define USE_LED_STRIP
119 // #define WS2811_PIN PA1
121 #define USE_RANGEFINDER
122 #define RANGEFINDER_I2C_BUS BUS_I2C2
124 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
125 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
126 #define SERIALRX_PROVIDER SERIALRX_SBUS
127 #define SERIALRX_UART SERIAL_PORT_USART3
129 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
131 #define MAX_PWM_OUTPUT_PORTS 11
133 #define TARGET_IO_PORTA 0xffff
134 #define TARGET_IO_PORTB 0xffff
135 #define TARGET_IO_PORTC 0xffff
137 #define PCA9685_I2C_BUS BUS_I2C2