Add Winbond 25Q128 flash driver
[betaflight.git] / src / main / target / SPARKY2 / target.h
blobd2689104df56e1522d861d22b4ac5d91bfcb027e
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 USE_GYRO_EXTI
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
49 #define USE_ACC
50 #define USE_ACC_SPI_MPU9250
52 #define USE_GYRO
53 #define USE_GYRO_SPI_MPU9250
54 #define GYRO_1_ALIGN CW270_DEG
56 #define USE_MAG
57 //#define USE_MAG_HMC5883
58 #define USE_MAG_AK8963
60 //#define MAG_HMC5883_ALIGN CW180_DEG
61 #define MAG_AK8963_ALIGN CW270_DEG
63 #define USE_BARO
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
73 #define USE_FLASHFS
74 #define USE_FLASH_M25P16
75 #define USE_FLASH_TOOLS
77 #define USE_VCP
78 #define USE_USB_DETECT
79 #define USB_DETECT_PIN PA8
81 #define USE_UART1
82 #define UART1_RX_PIN PA10
83 #define UART1_TX_PIN PA9
85 #define USE_UART3
86 #define UART3_RX_PIN PB11
87 #define UART3_TX_PIN PB10
89 #define USE_UART6
90 #define UART6_RX_PIN PC7
91 #define UART6_TX_PIN PC6 //inverter
93 #define SERIAL_PORT_COUNT 4
95 #define USE_ESCSERIAL
96 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
98 #define USE_SPI
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
112 #define USE_I2C
113 #define USE_I2C_DEVICE_1
114 #define I2C1_SCL PB8
115 #define I2C1_SDA PB9
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 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))