add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / SPRACINGF3 / target.h
blob3d907a99b2b54518fc0f31d584de0cb1d2531451
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
20 #define TARGET_BOARD_IDENTIFIER "SRF3"
22 #define LED0 PB3
24 #define BEEPER PC15
25 #define BEEPER_INVERTED
27 #define USE_EXTI
28 #define GYRO_INT_EXTI PC13
29 #define EXTI_CALLBACK_HANDLER_COUNT 2 // MPU data ready and MAG data ready
30 #define USE_MPU_DATA_READY_SIGNAL
31 #define ENSURE_MPU_DATA_READY_IS_LOW
33 #define USE_IMU_MPU6050
34 #define IMU_MPU6050_ALIGN CW270_DEG
35 #define MPU6050_I2C_BUS BUS_I2C1
37 #define USE_BARO
38 #define BARO_I2C_BUS BUS_I2C1
39 #define USE_BARO_MS5611
40 #define USE_BARO_BMP085
41 #define USE_BARO_BMP280
43 #define USE_MAG
44 #define MAG_I2C_BUS BUS_I2C1
45 #define USE_MAG_HMC5883
46 #define USE_MAG_QMC5883
47 #define USE_MAG_IST8310
48 #define USE_MAG_IST8308
49 #define USE_MAG_MAG3110
50 #define USE_MAG_LIS3MDL
52 #define USE_FLASHFS
53 #define USE_FLASH_M25P16
55 #define USE_UART1
56 #define USE_UART2
57 #define USE_UART3
58 #define USE_SOFTSERIAL1
59 #define USE_SOFTSERIAL2
60 #define SERIAL_PORT_COUNT 5
62 #define UART1_TX_PIN PA9
63 #define UART1_RX_PIN PA10
65 #define UART2_TX_PIN PA14 // PA14 / SWCLK
66 #define UART2_RX_PIN PA15
68 #define UART3_TX_PIN PB10 // PB10 (AF7)
69 #define UART3_RX_PIN PB11 // PB11 (AF7)
71 #define SOFTSERIAL_1_RX_PIN PB4
72 #define SOFTSERIAL_1_TX_PIN PB5
73 #define SOFTSERIAL_2_RX_PIN PB0
74 #define SOFTSERIAL_2_TX_PIN PB1
76 #define USE_I2C
77 #define USE_I2C_DEVICE_1
79 #define USE_SPI
80 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
82 #define M25P16_CS_PIN PB12
83 #define M25P16_SPI_BUS BUS_SPI2
85 #define BOARD_HAS_VOLTAGE_DIVIDER
86 #define USE_ADC
87 #define ADC_INSTANCE ADC2
88 #define ADC_CHANNEL_1_PIN PA4
89 #define ADC_CHANNEL_2_PIN PA5
90 #define ADC_CHANNEL_3_PIN PB2
91 #define VBAT_ADC_CHANNEL ADC_CHN_1
92 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
93 #define RSSI_ADC_CHANNEL ADC_CHN_3
95 #define USE_LED_STRIP
96 #define WS2811_PIN PA8
98 #define USE_RANGEFINDER
99 #define RANGEFINDER_I2C_BUS BUS_I2C1
101 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
103 #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_VBAT)
104 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
106 #define USE_SPEKTRUM_BIND
107 #define BIND_PIN PB11 // UART3
109 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
111 // Number of available PWM outputs
112 #define MAX_PWM_OUTPUT_PORTS 12
114 // IO - stm32f303cc in 48pin package
115 #define TARGET_IO_PORTA 0xffff
116 #define TARGET_IO_PORTB 0xffff
117 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
118 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))