Merge pull request #10641 from iNavFlight/mmosca-gf20
[inav.git] / src / main / target / TBS_LUCID_FC / target.h
blob9baab07355d70e00fa266b77e8341d187d92253f
1 /*
2 * This file is part of INAV Project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
25 #pragma once
27 #define TARGET_BOARD_IDENTIFIER "LUFC"
29 #define USBD_PRODUCT_STRING "TBS Lucid FC"
31 #define LED0 PC14
32 #define LED1 PC15
34 #define BEEPER_INVERTED
35 #define BEEPER PC13
37 #define USE_VCP
39 #define USE_UART1
40 #define UART1_TX_PIN PA9
41 #define UART1_RX_PIN PA10
43 #define USE_UART2
44 #define UART2_AF 6
45 #define UART2_TX_PIN PB0
46 #define UART2_RX_PIN PB0
48 #define USE_UART3
49 #define USE_UART3_PIN_SWAP
50 #define UART3_TX_PIN PB11
51 #define UART3_RX_PIN PB10
53 #define USE_UART4
54 #define UART4_TX_PIN PH3
55 #define UART4_RX_PIN PH2
57 #define USE_UART5
58 #define UART5_TX_PIN PB9
59 #define UART5_RX_PIN PD2
61 #define USE_UART7
62 #define UART7_TX_PIN PB4
63 #define UART7_RX_PIN PB3
65 #define USE_UART8
66 #define UART8_TX_PIN PC2
67 #define UART8_RX_PIN PC3
69 #define SERIAL_PORT_COUNT 8
71 #define USE_SPI
73 #define USE_SPI_DEVICE_1
74 #define SPI1_SCK_PIN PA5
75 #define SPI1_MISO_PIN PA6
76 #define SPI1_MOSI_PIN PA7
78 #define USE_SPI_DEVICE_2
79 #define SPI2_SCK_PIN PB13
80 #define SPI2_MISO_PIN PB14
81 #define SPI2_MOSI_PIN PB15
83 #define USE_SPI_DEVICE_3
84 #define SPI3_SCK_PIN PC10
85 #define SPI3_MISO_PIN PC11
86 #define SPI3_MOSI_PIN PC12
88 #define USE_IMU_MPU6000
89 #define IMU_MPU6000_ALIGN CW0_DEG_FLIP
90 #define MPU6000_SPI_BUS BUS_SPI1
91 #define MPU6000_CS_PIN PA4
93 #define USE_IMU_ICM42605
94 #define IMU_ICM42605_ALIGN CW270_DEG_FLIP
95 #define ICM42605_CS_PIN PA4
96 #define ICM42605_SPI_BUS BUS_SPI1
98 #define USE_MAX7456
99 #define MAX7456_SPI_BUS BUS_SPI2
100 #define MAX7456_CS_PIN PB12
102 #define USE_FLASHFS
103 #define USE_FLASH_M25P16
104 #define M25P16_SPI_BUS BUS_SPI3
105 #define M25P16_CS_PIN PA15
107 #define USE_I2C
108 #define USE_I2C_DEVICE_1
109 #define I2C1_SCL PB6
110 #define I2C1_SDA PC7
112 #define USE_BARO
113 #define USE_BARO_BMP388
114 #define BARO_I2C_BUS BUS_I2C1
116 #define USE_MAG
117 #define USE_MAG_ALL
118 #define MAG_I2C_BUS BUS_I2C1
120 #define USE_LED_STRIP
121 #define WS2811_PIN PA8
123 #define USE_PINIO
124 #define USE_PINIOBOX
125 #define PINIO1_PIN PA13
126 #define PINIO2_PIN PA14
128 #define USE_ADC
129 #define ADC_INSTANCE ADC1
130 #define ADC1_DMA_STREAM DMA2_CHANNEL7
131 #define ADC_CHANNEL_1_PIN PC0
132 #define ADC_CHANNEL_2_PIN PC1
133 #define ADC_CHANNEL_3_PIN PC5
134 #define VBAT_ADC_CHANNEL ADC_CHN_1
135 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
137 #define TARGET_IO_PORTA 0xffff
138 #define TARGET_IO_PORTB 0xffff
139 #define TARGET_IO_PORTC 0xffff
140 #define TARGET_IO_PORTD (BIT(2) | BIT(12) | BIT(13))
141 #define TARGET_IO_PORTH (BIT(2) | BIT(3))
143 #define USE_DSHOT
144 #define USE_ESC_SENSOR
145 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
146 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
147 #define MAX_PWM_OUTPUT_PORTS 6
149 #define DEFAULT_FEATURES \
150 (FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_OSD | \
151 FEATURE_LED_STRIP)
153 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
154 #define SERIALRX_PROVIDER SERIALRX_CRSF
155 #define SERIALRX_UART SERIAL_PORT_USART5