Skip to content

Commit 3ff2012

Browse files
committed
add TBS_LUCID_H7_OEM
1 parent c7083a6 commit 3ff2012

4 files changed

Lines changed: 290 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32h743xi(TBS_LUCID_H7_OEM)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
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/.
7+
*
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:
10+
*
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.
15+
*
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.
20+
*
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/.
23+
*/
24+
25+
#include <stdint.h>
26+
27+
#include "platform.h"
28+
29+
#include "fc/config.h"
30+
#include "fc/fc_msp_box.h"
31+
32+
#include "io/piniobox.h"
33+
34+
#include "drivers/pwm_mapping.h"
35+
36+
void targetConfiguration(void)
37+
{
38+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
39+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
40+
pinioBoxConfigMutable()->permanentId[2] = BOX_PERMANENT_ID_USER3;
41+
beeperConfigMutable()->pwmMode = true;
42+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
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/.
7+
*
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:
10+
*
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.
15+
*
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.
20+
*
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/.
23+
*/
24+
25+
#include <stdint.h>
26+
27+
#include "platform.h"
28+
29+
#include "drivers/bus.h"
30+
#include "drivers/io.h"
31+
#include "drivers/pwm_mapping.h"
32+
#include "drivers/timer.h"
33+
#include "drivers/sensor.h"
34+
35+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_mpu6000, DEVHW_MPU6000, GYRO1_SPI_BUS, GYRO1_CS_PIN, GYRO1_EXTI_PIN, 0, DEVFLAGS_NONE, IMU_1_MPU6000_ALIGN);
36+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_icm42688, DEVHW_ICM42605, GYRO1_SPI_BUS, GYRO1_CS_PIN, GYRO1_EXTI_PIN, 0, DEVFLAGS_NONE, IMU_1_ICM42605_ALIGN);
37+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_icm45686, DEVHW_ICM45686, GYRO1_SPI_BUS, GYRO1_CS_PIN, GYRO1_EXTI_PIN, 0, DEVFLAGS_NONE, IMU_1_ICM42605_ALIGN);
38+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_mpu6000, DEVHW_MPU6000, GYRO2_SPI_BUS, GYRO2_CS_PIN, GYRO2_EXTI_PIN, 1, DEVFLAGS_NONE, IMU_2_MPU6000_ALIGN);
39+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_icm42688, DEVHW_ICM42605, GYRO2_SPI_BUS, GYRO2_CS_PIN, GYRO2_EXTI_PIN, 1, DEVFLAGS_NONE, IMU_2_ICM42605_ALIGN);
40+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_icm45686, DEVHW_ICM45686, GYRO2_SPI_BUS, GYRO2_CS_PIN, GYRO2_EXTI_PIN, 1, DEVFLAGS_NONE, IMU_2_ICM42605_ALIGN);
41+
42+
timerHardware_t timerHardware[] = {
43+
DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
44+
DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 1), // S2
45+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 2), // S3
46+
DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 3), // S4
47+
48+
DEF_TIM(TIM4, CH1, PD12, TIM_USE_OUTPUT_AUTO, 0, 4), // S5
49+
DEF_TIM(TIM4, CH2, PD13, TIM_USE_OUTPUT_AUTO, 0, 5), // S6
50+
DEF_TIM(TIM4, CH3, PD14, TIM_USE_OUTPUT_AUTO, 0, 6), // S7
51+
DEF_TIM(TIM4, CH4, PD15, TIM_USE_OUTPUT_AUTO, 0, 0), // S8 DMA_NONE
52+
53+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 11), // S9
54+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 12), // S10
55+
56+
DEF_TIM(TIM15, CH1, PE5, TIM_USE_OUTPUT_AUTO, 0, 13), // S11
57+
DEF_TIM(TIM15, CH2, PE6, TIM_USE_OUTPUT_AUTO, 0, 0), // S12 DMA_NONE
58+
59+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO | TIM_USE_LED, 0, 14), // RGB_LED
60+
61+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER
62+
};
63+
64+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
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/.
7+
*
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:
10+
*
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.
15+
*
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.
20+
*
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/.
23+
*/
24+
25+
26+
#pragma once
27+
28+
#define TARGET_BOARD_IDENTIFIER "LH7O"
29+
30+
#define USBD_PRODUCT_STRING "TBS_LUCID_H7_OEM"
31+
32+
#define USE_TARGET_CONFIG
33+
34+
#define LED0 PE3
35+
#define LED1 PE4
36+
37+
#define BEEPER PA15
38+
#define BEEPER_INVERTED
39+
#define BEEPER_PWM_FREQUENCY 2500
40+
41+
#define USE_VCP
42+
43+
#define USE_UART2
44+
#define UART2_TX_PIN PD5
45+
#define UART2_RX_PIN PD6
46+
47+
#define USE_UART3
48+
#define UART3_TX_PIN PD8
49+
#define UART3_RX_PIN PD9
50+
51+
#define USE_UART4
52+
#define UART4_TX_PIN PB9
53+
#define UART4_RX_PIN PB8
54+
55+
#define USE_UART5
56+
#define UART5_TX_PIN PB13
57+
#define UART5_RX_PIN PB12
58+
59+
#define USE_UART6
60+
#define UART6_TX_PIN PC6
61+
#define UART6_RX_PIN PC7
62+
63+
#define USE_UART7
64+
#define UART7_TX_PIN PE8
65+
#define UART7_RX_PIN PE7
66+
67+
#define USE_UART8
68+
#define UART8_TX_PIN PE1
69+
#define UART8_RX_PIN PE0
70+
71+
#define SERIAL_PORT_COUNT 8
72+
73+
#define USE_DRONECAN
74+
#define CAN1_RX PD0
75+
#define CAN1_TX PD1
76+
#define CAN1_STANDBY PD3
77+
78+
#define USE_SPI
79+
80+
#define USE_SPI_DEVICE_1
81+
#define SPI1_SCK_PIN PA5
82+
#define SPI1_MISO_PIN PA6
83+
#define SPI1_MOSI_PIN PD7
84+
85+
#define USE_SPI_DEVICE_3
86+
#define SPI3_SCK_PIN PB3
87+
#define SPI3_MISO_PIN PB4
88+
#define SPI3_MOSI_PIN PB5
89+
90+
#define USE_SPI_DEVICE_4
91+
#define SPI4_SCK_PIN PE12
92+
#define SPI4_MISO_PIN PE13
93+
#define SPI4_MOSI_PIN PE14
94+
95+
#define USE_DUAL_GYRO
96+
#define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
97+
98+
#define GYRO1_SPI_BUS BUS_SPI1
99+
#define GYRO1_CS_PIN PC15
100+
#define GYRO1_EXTI_PIN PB2
101+
#define GYRO2_SPI_BUS BUS_SPI4
102+
#define GYRO2_CS_PIN PE11
103+
#define GYRO2_EXTI_PIN PE15
104+
105+
#define USE_IMU_MPU6000
106+
#define IMU_1_MPU6000_ALIGN CW90_DEG_FLIP
107+
#define IMU_2_MPU6000_ALIGN CW0_DEG_FLIP
108+
109+
#define USE_IMU_ICM42605
110+
#define USE_IMU_ICM45686
111+
#define IMU_1_ICM42605_ALIGN CW90_DEG_FLIP
112+
#define IMU_2_ICM42605_ALIGN CW0_DEG_FLIP
113+
114+
#define USE_I2C
115+
116+
#define USE_I2C_DEVICE_1
117+
#define I2C1_SCL PB6
118+
#define I2C1_SDA PB7
119+
120+
#define USE_I2C_DEVICE_2
121+
#define I2C2_SCL PB10
122+
#define I2C2_SDA PB11
123+
124+
#define USE_BARO
125+
#define USE_BARO_DPS310
126+
#define USE_BARO_BMP388
127+
#define USE_BARO_BMP390
128+
#define BARO_I2C_BUS BUS_I2C2
129+
130+
#define USE_MAG
131+
#define MAG_I2C_BUS BUS_I2C1
132+
#define USE_MAG_ALL
133+
134+
#define TEMPERATURE_I2C_BUS BUS_I2C2
135+
#define PITOT_I2C_BUS BUS_I2C2
136+
137+
#define USE_RANGEFINDER
138+
#define RANGEFINDER_I2C_BUS BUS_I2C1
139+
140+
#define USE_SDCARD
141+
#define USE_SDCARD_SDIO
142+
#define SDCARD_SDIO_DEVICE SDIODEV_1
143+
#define SDCARD_SDIO_4BIT
144+
145+
#define USE_ADC
146+
#define ADC_INSTANCE ADC1
147+
148+
#define ADC_CHANNEL_1_PIN PC0
149+
#define ADC_CHANNEL_2_PIN PC1
150+
#define ADC_CHANNEL_3_PIN PC5
151+
#define ADC_CHANNEL_4_PIN PC4
152+
#define ADC_CHANNEL_5_PIN PA4
153+
#define ADC_CHANNEL_6_PIN PA7
154+
155+
#define VBAT_ADC_CHANNEL ADC_CHN_1
156+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
157+
#define RSSI_ADC_CHANNEL ADC_CHN_3
158+
#define AIRSPEED_ADC_CHANNEL ADC_CHN_4
159+
160+
#define USE_PINIO
161+
#define USE_PINIOBOX
162+
#define PINIO1_PIN PD10
163+
#define PINIO2_PIN PD11
164+
#define PINIO3_PIN PC13
165+
166+
#define USE_LED_STRIP
167+
#define WS2811_PIN PA8
168+
169+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_LED_STRIP)
170+
#define CURRENT_METER_SCALE 250
171+
172+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
173+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
174+
175+
#define TARGET_IO_PORTA (0xffff & ~(BIT(14) | BIT(13)))
176+
#define TARGET_IO_PORTB 0xffff
177+
#define TARGET_IO_PORTC 0xffff
178+
#define TARGET_IO_PORTD 0xffff
179+
#define TARGET_IO_PORTE 0xffff
180+
181+
#define MAX_PWM_OUTPUT_PORTS 15
182+
#define USE_DSHOT
183+
#define USE_ESC_SENSOR

0 commit comments

Comments
 (0)