Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / target / SPARKY / target.h
blob70167cb8f785fd15c39a17964db7a82accf6d4ca
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
23 #define TARGET_BOARD_IDENTIFIER "SPKY" // SParKY
25 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE
27 #define LED0_PIN PB4 // Blue (Rev 1 & 2) - PB4
28 #define LED1_PIN PB5 // Green (Rev 1) / Red (Rev 2) - PB5
30 #define USE_BEEPER
31 #define BEEPER_PIN PA1
32 #define BEEPER_INVERTED
34 // MPU6050 interrupts
35 #define USE_EXTI
36 #define MPU_INT_EXTI PA15
37 #define USE_MPU_DATA_READY_SIGNAL
39 // MPU 9150 INT connected to PA15, pulled up to VCC by 10K Resistor, contains MPU6050 and AK8975 in single component.
40 #define USE_GYRO
41 #define USE_GYRO_MPU6050
42 #define GYRO_MPU6050_ALIGN CW270_DEG
44 #define USE_ACC
45 #define USE_ACC_MPU6050
46 #define ACC_MPU6050_ALIGN CW270_DEG
48 #define USE_BARO
49 #define USE_BARO_MS5611
50 #define USE_BARO_BMP280
52 #define USE_MAG
53 #define USE_MAG_AK8975
55 #define MAG_AK8975_ALIGN CW180_DEG_FLIP
57 #define USE_VCP
58 #define USE_UART1 // Conn 1 - TX (PB6) RX PB7 (AF7)
59 #define USE_UART2 // Input - RX (PA3)
60 #define USE_UART3 // Servo out - 10/RX (PB11) 11/TX (PB10)
61 #define USE_SOFTSERIAL1
62 #define USE_SOFTSERIAL2
64 #define SERIAL_PORT_COUNT 6
66 #define AVOID_UART2_FOR_PWM_PPM
68 #define USE_ESCSERIAL
69 #define ESCSERIAL_TIMER_TX_PIN PB15 // (HARDARE=0)
71 #define UART1_TX_PIN PB6
72 #define UART1_RX_PIN PB7
74 #define UART2_TX_PIN PA2 // PA2 - Clashes with PWM6 input.
75 #define UART2_RX_PIN PA3
77 #define UART3_TX_PIN PB10 // PB10 (AF7)
78 #define UART3_RX_PIN PB11 // PB11 (AF7)
80 // Note: PA5 and PA0 are N/C on the sparky - potentially use for ADC or LED STRIP?
82 #define USE_I2C
83 #define USE_I2C_DEVICE_2
84 #define I2C_DEVICE (I2CDEV_2)
85 #define I2C2_SCL PA9
86 #define I2C2_SDA PA10
88 #define USE_ADC
89 #define ADC_INSTANCE ADC2
90 #define VBAT_ADC_PIN PA4
91 #define CURRENT_METER_ADC_PIN PA7
93 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
95 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
97 //#define USE_RANGEFINDER
98 //#define USE_RANGEFINDER_HCSR04
99 //#define RANGEFINDER_HCSR04_ECHO_PIN PB1
100 //#define RANGEFINDER_HCSR04_TRIGGER_PIN PA2
102 // available IO pins (from schematics)
103 //#define TARGET_IO_PORTA (BIT(1)|BIT(2)|BIT(3)|BIT(4)|BIT(6)|BIT(7)|BIT(8)|BIT(9)|BIT(10)|BIT(11)|BIT(12)|BIT(13)|BIT(14)|BIT(15))
104 //#define TARGET_IO_PORTB (BIT(0)|BIT(1)|BIT(10)|BIT(11)|BIT(14)|BIT(15)|BIT(3)|BIT(4)|BIT(5)|BIT(6)|BIT(7)|BIT(8)|BIT(9))
105 // !!TODO - check following lines are correct
106 #define TARGET_IO_PORTA (BIT(1)|BIT(2)|BIT(3)|BIT(4)|BIT(5)|BIT(6)|BIT(7)|BIT(8)|BIT(9)|BIT(10)|BIT(11)|BIT(12)|BIT(13)|BIT(14)|BIT(15))
107 #define TARGET_IO_PORTB (BIT(0)|BIT(1)|BIT(6)|BIT(10)|BIT(11)|BIT(14)|BIT(15)|BIT(3)|BIT(4)|BIT(5)|BIT(6)|BIT(7)|BIT(8)|BIT(9)|BIT(12)|BIT(13))
108 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
110 #define USABLE_TIMER_CHANNEL_COUNT 11
111 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(15) | TIM_N(17))