New memory section types for DMA
[betaflight.git] / src / main / target / SPARKY2 / target.h
blobbf7cb926c30f6b84e293132788e489d9af636c82
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 DEBUG_MPU_DATA_READY_INTERRUPT
44 #define USE_MPU_DATA_READY_SIGNAL
45 #define ENSURE_MPU_DATA_READY_IS_LOW
47 #define GYRO_1_CS_PIN PC4
48 #define GYRO_1_SPI_INSTANCE SPI1
50 #define USE_ACC
51 #define USE_ACC_SPI_MPU9250
53 #define USE_GYRO
54 #define USE_GYRO_SPI_MPU9250
55 #define GYRO_1_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 FLASH_CS_PIN PB3
69 #define FLASH_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
86 #define USE_UART3
87 #define UART3_RX_PIN PB11
88 #define UART3_TX_PIN PB10
90 #define USE_UART6
91 #define UART6_RX_PIN PC7
92 #define UART6_TX_PIN PC6 //inverter
94 #define SERIAL_PORT_COUNT 4
96 #define USE_ESCSERIAL
97 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
99 #define USE_SPI
101 #define USE_SPI_DEVICE_1 //MPU9250
102 #define SPI1_NSS_PIN PC4
103 #define SPI1_SCK_PIN PA5
104 #define SPI1_MISO_PIN PA6
105 #define SPI1_MOSI_PIN PA7
107 #define USE_SPI_DEVICE_3 //dataflash
108 #define SPI3_NSS_PIN PB3
109 #define SPI3_SCK_PIN PC10
110 #define SPI3_MISO_PIN PC11
111 #define SPI3_MOSI_PIN PC12
113 #define USE_I2C
114 #define USE_I2C_DEVICE_1
115 #define I2C1_SCL PB8
116 #define I2C1_SDA PB9
117 #define I2C_DEVICE (I2CDEV_1)
119 #define USE_ADC
120 #define VBAT_ADC_PIN PC1
121 #define CURRENT_METER_ADC_PIN PC2
123 #undef USE_LED_STRIP
125 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
126 #define SERIALRX_PROVIDER SERIALRX_SBUS
127 #define SERIALRX_UART SERIAL_PORT_USART6
129 #define TARGET_IO_PORTA 0xffff
130 #define TARGET_IO_PORTB 0xffff
131 #define TARGET_IO_PORTC 0xffff
133 #define USABLE_TIMER_CHANNEL_COUNT 11
134 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(12))