vtx: fix VTX_SETTINGS_POWER_COUNT and add dummy entries to saPowerNames
[inav.git] / src / main / target / FRSKYPILOT / target.h
blob19944ac24a706ef743899f52c655bcfb117ab42c
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_DUAL_GYRO
72 #define MPU6500_SPI_BUS BUS_SPI3
73 #define MPU6500_CS_PIN SPI3_NSS_PIN
74 #define IMU_MPU6500_ALIGN CW0_DEG_FLIP
76 #define MPU6000_SPI_BUS BUS_SPI2
77 #define MPU6000_CS_PIN SPI2_NSS_PIN
78 #define IMU_MPU6000_ALIGN CW270_DEG_FLIP
80 // *************** SPI4: SDCARD *******************
82 #define USE_SPI_DEVICE_4
83 #define SPI4_NSS_PIN PE4
84 #define SPI4_SCK_PIN PE2
85 #define SPI4_MISO_PIN PE5
86 #define SPI4_MOSI_PIN PE6
88 #define USE_SDCARD
89 #define USE_SDCARD_SPI
90 #define SDCARD_SPI_BUS BUS_SPI4
91 #define SDCARD_CS_PIN SPI4_NSS_PIN
92 #define SDCARD_DETECT_PIN PE3
93 #define SDCARD_DETECT_INVERTED
95 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
97 // *************** I2C *********************
98 #define USE_I2C
100 #define USE_I2C_DEVICE_3
101 #define I2C3_SCL PA8
102 #define I2C3_SDA PC9
104 #define USE_MAG
105 #define MAG_I2C_BUS BUS_I2C3
106 #define USE_MAG_ALL
108 #define TEMPERATURE_I2C_BUS BUS_I2C3
109 #define PITOT_I2C_BUS BUS_I2C3
111 #define USE_RANGEFINDER
112 #define RANGEFINDER_I2C_BUS BUS_I2C3
114 // *************** UART *****************************
115 #define USE_VCP
116 #define USB_DETECT_PIN PC4
117 #define USE_USB_DETECT
119 #define USE_UART1
120 #define UART1_TX_PIN PA9
121 #define UART1_RX_PIN PA10
123 #define USE_UART2
124 #define UART2_TX_PIN PD5
125 #define UART2_RX_PIN PD6
127 #define USE_UART3
128 #define UART3_TX_PIN PB10
129 #define UART3_RX_PIN PB11
131 #define USE_UART5
132 #define UART5_TX_PIN PB6
133 #define UART5_RX_PIN PB5
134 #define UART5_AF 1
136 // OSD
137 #define USE_UART6
138 #define UART6_TX_PIN PC6
139 #define UART6_RX_PIN PC7
141 // RX connector
142 #define USE_UART7
143 #define UART7_TX_PIN PB4
144 #define UART7_RX_PIN PB3
145 #define UART7_AF 12
147 #define USE_UART8
148 #define UART8_TX_PIN PE1
149 #define UART8_RX_PIN PE0
151 #define SERIAL_PORT_COUNT 8
153 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
154 #define SERIALRX_PROVIDER SERIALRX_FPORT2
155 #define SERIALRX_UART SERIAL_PORT_USART8
157 // *************** ADC *****************************
158 #define USE_ADC
159 #define ADC_INSTANCE ADC1
161 #define ADC_CHANNEL_1_PIN PC2
162 #define ADC_CHANNEL_2_PIN PC3
163 #define ADC_CHANNEL_3_PIN PC1
164 #define ADC_CHANNEL_4_PIN PC0
166 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
167 #define VBAT_ADC_CHANNEL ADC_CHN_2
168 #define RSSI_ADC_CHANNEL ADC_CHN_3
169 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
171 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
172 #define VBAT_SCALE_DEFAULT 1545
173 #define CURRENT_METER_SCALE 171
174 #define CURRENT_METER_OFFSET 3288
176 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
178 #define TARGET_IO_PORTA 0xffff
179 #define TARGET_IO_PORTB 0xffff
180 #define TARGET_IO_PORTC 0xffff
181 #define TARGET_IO_PORTD 0xffff
182 #define TARGET_IO_PORTE 0xffff
184 #ifdef FRSKYPILOT_LED
185 #define USE_LED_STRIP
186 #define WS2811_PIN PA1 // S10 pad for INAV
188 #define MAX_PWM_OUTPUT_PORTS 9
189 #else
190 #define MAX_PWM_OUTPUT_PORTS 12
191 #endif
193 #define USE_DSHOT