add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / FRSKYPILOT / target.h
blob539b465461cf96160e336ad25f08285a5b9a461b
1 /*
2 * This file is part of INAV.
4 * INAV 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 * INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
19 #pragma once
21 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
22 #define USE_TARGET_CONFIG
24 #define TARGET_BOARD_IDENTIFIER "FRP"
25 #define USBD_PRODUCT_STRING "FrSkyPilot"
27 #define LED0 PA3
28 #define LED1 PC5
30 #define BEEPER PA0
31 #define BEEPER_INVERTED
32 #define BEEPER_PWM_FREQUENCY 4000
34 #define USE_SPI
36 // *************** SPI1 BARO **********************
38 #define USE_SPI_DEVICE_1
39 #define SPI1_NSS_PIN PA4
40 #define SPI1_SCK_PIN PA5
41 #define SPI1_MISO_PIN PA6
42 #define SPI1_MOSI_PIN PA7
44 #define USE_BARO
45 #define USE_BARO_SPL06
46 #define SPL06_SPI_BUS BUS_SPI1
47 #define SPL06_CS_PIN SPI1_NSS_PIN
49 // *************** SPI2/3 IMUs *******************
51 // IMU box
52 #define USE_SPI_DEVICE_2
53 #define SPI2_NSS_PIN PB12
54 #define SPI2_SCK_PIN PB13
55 #define SPI2_MISO_PIN PB14
56 #define SPI2_MOSI_PIN PB15
58 // IMU on-board
59 #define USE_SPI_DEVICE_3
60 #define SPI3_NSS_PIN PA15
61 #define SPI3_SCK_PIN PC10
62 #define SPI3_MISO_PIN PC11
63 #define SPI3_MOSI_PIN PC12
65 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
67 #define USE_IMU_MPU6000
68 #define USE_IMU_MPU6500
70 #define USE_EXTI
71 #define USE_MPU_DATA_READY_SIGNAL
73 //#define USE_ONBOARD_IMU
74 //#define USE_BOX_IMU
75 #define USE_DUAL_GYRO
77 //#if defined(USE_ONBOARD_IMU)
78 #define MPU6500_EXTI_PIN PE8
79 #define MPU6500_SPI_BUS BUS_SPI3
80 #define MPU6500_CS_PIN SPI3_NSS_PIN
81 #define IMU_MPU6500_ALIGN CW0_DEG_FLIP
83 //#elif defined(USE_BOX_IMU)
84 #define MPU6000_EXTI_PIN NONE
85 #define MPU6000_SPI_BUS BUS_SPI2
86 #define MPU6000_CS_PIN SPI2_NSS_PIN
87 #define IMU_MPU6000_ALIGN CW270_DEG_FLIP // XXX check
89 //#endif // IMU SELECTION
91 // *************** SPI4: SDCARD *******************
93 #define USE_SPI_DEVICE_4
94 #define SPI4_NSS_PIN PE4
95 #define SPI4_SCK_PIN PE2
96 #define SPI4_MISO_PIN PE5
97 #define SPI4_MOSI_PIN PE6
99 #define USE_SDCARD
100 #define USE_SDCARD_SPI
101 #define SDCARD_SPI_BUS BUS_SPI4
102 #define SDCARD_CS_PIN SPI4_NSS_PIN
103 #define SDCARD_DETECT_PIN PE3
104 #define SDCARD_DETECT_INVERTED
106 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
108 // *************** I2C *********************
109 #define USE_I2C
111 #define USE_I2C_DEVICE_3
112 #define I2C3_SCL PA8
113 #define I2C3_SDA PC9
115 #define USE_MAG
116 #define MAG_I2C_BUS BUS_I2C3
117 #define USE_MAG_HMC5883
118 #define USE_MAG_QMC5883
119 #define USE_MAG_IST8310
120 #define USE_MAG_IST8308
121 #define USE_MAG_MAG3110
122 #define USE_MAG_LIS3MDL
124 #define TEMPERATURE_I2C_BUS BUS_I2C3
125 #define BNO055_I2C_BUS BUS_I2C3
126 #define PITOT_I2C_BUS BUS_I2C3
128 #define USE_RANGEFINDER
129 #define RANGEFINDER_I2C_BUS BUS_I2C3
131 // *************** UART *****************************
132 #define USE_VCP
133 #define USB_DETECT_PIN PC4
134 #define USE_USB_DETECT
136 #define USE_UART1
137 #define UART1_TX_PIN PA9
138 #define UART1_RX_PIN PA10
140 #define USE_UART2
141 #define UART2_TX_PIN PD5
142 #define UART2_RX_PIN PD6
144 #define USE_UART3
145 #define UART3_TX_PIN PB10
146 #define UART3_RX_PIN PB11
148 #define USE_UART5
149 #define UART5_TX_PIN PB6
150 #define UART5_RX_PIN PB5
151 #define UART5_AF 1
153 // OSD
154 #define USE_UART6
155 #define UART6_TX_PIN PC6
156 #define UART6_RX_PIN PC7
158 // RX connector
159 #define USE_UART7
160 #define UART7_TX_PIN PB4
161 #define UART7_RX_PIN PB3
162 #define UART7_AF 12
164 #define USE_UART8
165 #define UART8_TX_PIN PE1
166 #define UART8_RX_PIN PE0
168 #define SERIAL_PORT_COUNT 8
170 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
171 #define SERIALRX_PROVIDER SERIALRX_FPORT2
172 #define SERIALRX_UART SERIAL_PORT_USART8
174 // *************** ADC *****************************
175 #define USE_ADC
176 #define ADC_INSTANCE ADC1
178 #define ADC_CHANNEL_1_PIN PC2
179 #define ADC_CHANNEL_2_PIN PC3
180 #define ADC_CHANNEL_3_PIN PC1
181 #define ADC_CHANNEL_4_PIN PC0
183 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
184 #define VBAT_ADC_CHANNEL ADC_CHN_2
185 #define RSSI_ADC_CHANNEL ADC_CHN_3
186 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
188 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
189 #define VBAT_SCALE_DEFAULT 1545
190 #define CURRENT_METER_SCALE 171
191 #define CURRENT_METER_OFFSET 3288
193 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
195 #define TARGET_IO_PORTA 0xffff
196 #define TARGET_IO_PORTB 0xffff
197 #define TARGET_IO_PORTC 0xffff
198 #define TARGET_IO_PORTD 0xffff
199 #define TARGET_IO_PORTE 0xffff
201 #ifdef FRSKYPILOT_LED
202 #define USE_LED_STRIP
203 #define WS2811_PIN PA1 // S10 pad for iNav
205 #define MAX_PWM_OUTPUT_PORTS 9
206 #else
207 #define MAX_PWM_OUTPUT_PORTS 12
208 #endif
210 #define USE_DSHOT