From 6933b1b9652eb8a65b785289a16c5aa469289cc4 Mon Sep 17 00:00:00 2001 From: CRazy <1760886894@qq.com> Date: Mon, 29 Jul 2024 11:24:45 +0800 Subject: [PATCH] add target 'HGLRC_G071' add target 'HGLRC_G071' add target commit --- Inc/targets.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ g071makefile.mk | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/Inc/targets.h b/Inc/targets.h index 37484e86..23bf854a 100644 --- a/Inc/targets.h +++ b/Inc/targets.h @@ -801,6 +801,18 @@ #define SIXTY_FOUR_KB_MEMORY #endif +#ifdef HGLRC_G071 +#define FILE_NAME "HGLRC_G071" +#define FIRMWARE_NAME "HGLRC G071" +#define DEAD_TIME 60 +#define MILLIVOLT_PER_AMP 67 +#define CURRENT_OFFSET 0 +#define TARGET_VOLTAGE_DIVIDER 110 +#define HARDWARE_GROUP_G0_L +#define USE_SERIAL_TELEMETRY +#define SIXTY_FOUR_KB_MEMORY +#endif + #ifdef SEQURE_G071 #define FILE_NAME "SEQURE_G071" #define FIRMWARE_NAME "SEQURE G071 " @@ -1748,6 +1760,57 @@ #endif +#ifdef HARDWARE_GROUP_G0_L + +#define MCU_G071 +#define N_VARIANT +#define USE_TIMER_16_CHANNEL_1 +#define INPUT_PIN LL_GPIO_PIN_6 +#define INPUT_PIN_PORT GPIOA +#define IC_TIMER_CHANNEL LL_TIM_CHANNEL_CH1 +#define IC_TIMER_REGISTER TIM16 +#define IC_TIMER_POINTER htim16 + +#define INPUT_DMA_CHANNEL LL_DMA_CHANNEL_1 +#define DMA_HANDLE_TYPE_DEF hdma_tim16_ch1 +#define IC_DMA_IRQ_NAME DMA1_Channel1_IRQn + +#define PHASE_A_GPIO_LOW LL_GPIO_PIN_7 +#define PHASE_A_GPIO_PORT_LOW GPIOA +#define PHASE_A_GPIO_HIGH LL_GPIO_PIN_8 +#define PHASE_A_GPIO_PORT_HIGH GPIOA + +#define PHASE_B_GPIO_LOW LL_GPIO_PIN_0 +#define PHASE_B_GPIO_PORT_LOW GPIOB +#define PHASE_B_GPIO_HIGH LL_GPIO_PIN_9 +#define PHASE_B_GPIO_PORT_HIGH GPIOA + +#define PHASE_C_GPIO_LOW LL_GPIO_PIN_15 +#define PHASE_C_GPIO_PORT_LOW GPIOB +#define PHASE_C_GPIO_HIGH LL_GPIO_PIN_10 +#define PHASE_C_GPIO_PORT_HIGH GPIOA + +#define PHASE_A_COMP LL_COMP_INPUT_MINUS_IO3 // pa0 +#define PHASE_B_COMP LL_COMP_INPUT_MINUS_IO3 // pa2 +#define PHASE_C_COMP LL_COMP_INPUT_MINUS_IO2 // pb7 + +#define PHASE_A_EXTI_LINE LL_EXTI_LINE_17 +#define PHASE_A_COMP_NUMBER COMP1 + +#define PHASE_B_EXTI_LINE LL_EXTI_LINE_18 +#define PHASE_B_COMP_NUMBER COMP2 + +#define PHASE_C_EXTI_LINE LL_EXTI_LINE_18 +#define PHASE_C_COMP_NUMBER COMP2 + +#define VOLTAGE_ADC_PIN LL_GPIO_PIN_5 +#define VOLTAGE_ADC_CHANNEL LL_ADC_CHANNEL_5 + +#define CURRENT_ADC_PIN LL_GPIO_PIN_4 +#define CURRENT_ADC_CHANNEL LL_ADC_CHANNEL_4 + +#endif + #ifdef HARDWARE_GROUP_G4_A #define MCU_G431 diff --git a/g071makefile.mk b/g071makefile.mk index 99fdfbef..ef35782f 100644 --- a/g071makefile.mk +++ b/g071makefile.mk @@ -1,7 +1,7 @@ TARGETS_G071 := \ PWM_ENABLE_G071 OPEN_DRAIN_G071 OPEN_DRAIN_B_G071 GEN_64K_G071 DT120_64K_G071 IFLIGHT_BLITZ_G071 \ - NEUTRONRC_G071 AIKON_PRO_G071 TMOTOR_G071 + NEUTRONRC_G071 AIKON_PRO_G071 TMOTOR_G071 HGLRC_G071 HAL_FOLDER_G071 := $(HAL_FOLDER)/g071