Fix WS2812 led definition
[inav.git] / src / main / target / SPARKY2 / target.h
blob76d6e93099fa8c4d7806017b42428afb31539a5f
1 /*
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/>.
18 #pragma once
19 #define TARGET_BOARD_IDENTIFIER "SPK2"
21 #define USBD_PRODUCT_STRING "Sparky 2.0"
22 #ifdef OPBL
23 #define USBD_SERIALNUMBER_STRING "0x8020000"
24 #endif
26 #define LED0 PB5
27 #define LED1 PB4
28 #define LED2 PB6
30 #define BEEPER PC9
32 #define USE_IMU_MPU9250
33 #define IMU_MPU9250_ALIGN CW270_DEG
35 #define MPU9250_SPI_BUS BUS_SPI1
36 #define MPU9250_CS_PIN PC4
38 #define USE_MAG
39 #define USE_MAG_MPU9250
41 #define MAG_I2C_BUS BUS_I2C1
42 #define USE_MAG_HMC5883
43 #define USE_MAG_QMC5883
44 #define USE_MAG_IST8310
45 #define USE_MAG_IST8308
46 #define USE_MAG_MAG3110
47 #define USE_MAG_LIS3MDL
49 #define TEMPERATURE_I2C_BUS BUS_I2C1
51 #define USE_BARO
52 #define BARO_I2C_BUS BUS_I2C1
53 #define USE_BARO_MS5611
54 #define USE_BARO_BMP085
55 #define USE_BARO_BMP280
57 #define M25P16_CS_PIN PB3
58 #define M25P16_SPI_BUS BUS_SPI3
60 //#define RFM22B_CS_PIN PA15
61 //#define RFM22B_SPI_INSTANCE SPI3
63 #define USE_FLASHFS
64 #define USE_FLASH_M25P16
65 #define USE_FLASH_TOOLS
67 #define USE_VCP
68 #define VBUS_SENSING_PIN PA8
70 #define USE_UART_INVERTER
72 #define USE_UART1
73 #define UART1_RX_PIN PA10
74 #define UART1_TX_PIN PA9
76 #define USE_UART3
77 #define UART3_RX_PIN PB11
78 #define UART3_TX_PIN PB10
80 #define USE_UART6
81 #define UART6_RX_PIN PC7
82 #define UART6_TX_PIN PC6 //inverter
83 #define INVERTER_PIN_UART6_RX PC6
85 #define SERIAL_PORT_COUNT 4
87 #define USE_SPI
89 #define USE_SPI_DEVICE_1 //MPU9250
90 #define SPI1_NSS_PIN PC4
91 #define SPI1_SCK_PIN PA5
92 #define SPI1_MISO_PIN PA6
93 #define SPI1_MOSI_PIN PA7
95 #define USE_SPI_DEVICE_3 //dataflash
96 #define SPI3_NSS_PIN PB3
97 #define SPI3_SCK_PIN PC10
98 #define SPI3_MISO_PIN PC11
99 #define SPI3_MOSI_PIN PC12
101 #define USE_I2C
102 #define USE_I2C_DEVICE_1
103 #define USE_I2C_DEVICE_2
104 #define I2C_DEVICE_2_SHARES_UART3
106 #define USE_ADC
107 #define ADC_CHANNEL_1_PIN PC2
108 #define ADC_CHANNEL_2_PIN PC3
109 #define VBAT_ADC_CHANNEL ADC_CHN_2
110 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
112 // #define USE_LED_STRIP
113 // #define WS2811_PIN PA1
115 #define USE_RANGEFINDER
116 #define RANGEFINDER_I2C_BUS BUS_I2C2
118 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
119 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
120 #define SERIALRX_PROVIDER SERIALRX_SBUS
121 #define SERIALRX_UART SERIAL_PORT_USART3
123 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
125 #define MAX_PWM_OUTPUT_PORTS 11
127 #define TARGET_IO_PORTA 0xffff
128 #define TARGET_IO_PORTB 0xffff
129 #define TARGET_IO_PORTC 0xffff