Skip to content

Commit

Permalink
VIMDronesL431 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 9, 2024
1 parent b4a57e5 commit d45dcc6
Show file tree
Hide file tree
Showing 12 changed files with 637 additions and 7,444 deletions.
80 changes: 49 additions & 31 deletions Inc/targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@
#define MILLIVOLT_PER_AMP 19
#endif
///


#ifdef VIMDRONES_L431
#define FIRMWARE_NAME "VimdroneL431"
#define FILE_NAME "VIMDRONES_L431"
#define DEAD_TIME 45
#define HARDWARE_GROUP_L4_A
#define TARGET_VOLTAGE_DIVIDER 94
#define CURRENT_OFFSET 0
#define MILLIVOLT_PER_AMP 100
#define USE_SERIAL_TELEMETRY
#define EEPROM_START_ADD (uint32_t)0x0801F800
#define APPLICATION_ADDRESS 0x08001000
#endif

#ifdef REF_G431
#define FIRMWARE_NAME "Ref G431 "
#define FILE_NAME "REF_G431" // DISABLE_BUILD
Expand Down Expand Up @@ -2635,43 +2650,46 @@

#ifdef HARDWARE_GROUP_L4_A

#define MCU_L431
#define USE_TIMER_15_CHANNEL_1
#define INPUT_PIN LL_GPIO_PIN_2
#define INPUT_PIN_PORT GPIOA
#define IC_TIMER_CHANNEL LL_TIM_CHANNEL_CH1
#define IC_TIMER_REGISTER TIM15
#define IC_TIMER_POINTER htim15
#define MCU_L431
#define USE_TIMER_15_CHANNEL_1
#define INPUT_PIN LL_GPIO_PIN_2
#define INPUT_PIN_PORT GPIOA
#define IC_TIMER_CHANNEL LL_TIM_CHANNEL_CH1
#define IC_TIMER_REGISTER TIM15
#define IC_TIMER_POINTER htim15

#define INPUT_DMA_CHANNEL LL_DMA_CHANNEL_5
#define DMA_HANDLE_TYPE_DEF hdma_tim15_ch1
#define IC_DMA_IRQ_NAME DMA1_Channel5_IRQn
#define INPUT_DMA_CHANNEL LL_DMA_CHANNEL_5
#define DMA_HANDLE_TYPE_DEF hdma_tim15_ch1
#define IC_DMA_IRQ_NAME DMA1_Channel5_IRQn

#define PHASE_A_GPIO_LOW LL_GPIO_PIN_1
#define PHASE_A_GPIO_PORT_LOW GPIOB
#define PHASE_A_GPIO_HIGH LL_GPIO_PIN_10
#define PHASE_A_GPIO_PORT_HIGH GPIOA
#define PHASE_A_GPIO_LOW LL_GPIO_PIN_1
#define PHASE_A_GPIO_PORT_LOW GPIOB
#define PHASE_A_GPIO_HIGH LL_GPIO_PIN_10
#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_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_7
#define PHASE_C_GPIO_PORT_LOW GPIOA
#define PHASE_C_GPIO_HIGH LL_GPIO_PIN_8
#define PHASE_C_GPIO_PORT_HIGH GPIOA
#define PHASE_C_GPIO_LOW LL_GPIO_PIN_7
#define PHASE_C_GPIO_PORT_LOW GPIOA
#define PHASE_C_GPIO_HIGH LL_GPIO_PIN_8
#define PHASE_C_GPIO_PORT_HIGH GPIOA

#define USE_COMP_1
#define PHASE_A_COMP LL_COMP_INPUT_MINUS_IO3 // pa0
#define PHASE_B_COMP LL_COMP_INPUT_MINUS_IO4 // pa4
#define PHASE_C_COMP LL_COMP_INPUT_MINUS_IO5 // pa5
#define PHASE_A_COMP LL_COMP_INPUT_MINUS_IO2 // pb7
#define PHASE_B_COMP LL_COMP_INPUT_MINUS_IO5 // pa5
#define PHASE_C_COMP LL_COMP_INPUT_MINUS_IO4 // pa4
#define PHASE_COM_COMP LL_COMP_INPUT_PLUS_IO1 // pb4

#define CURRENT_SENSE_ADC_PIN LL_GPIO_PIN_3
#define VOLTAGE_SENSE_ADC_PIN LL_GPIO_PIN_6
#define USE_COMP_2

#define CURRENT_ADC_CHANNEL LL_ADC_CHANNEL_8
#define VOLTAGE_ADC_CHANNEL LL_ADC_CHANNEL_11
#define USE_LED_STRIP
#define WS2812_PIN LL_GPIO_PIN_3

#define CURRENT_ADC_CHANNEL LL_ADC_CHANNEL_8
#define VOLTAGE_ADC_CHANNEL LL_ADC_CHANNEL_11
#define ADC_CHANNEL_TEMP LL_ADC_CHANNEL_6

#endif

Expand Down Expand Up @@ -2905,7 +2923,7 @@
#ifdef MCU_L431
#define STMICRO
#define CPU_FREQUENCY_MHZ 80
#define EEPROM_START_ADD (uint32_t)0x0800F800
#define EEPROM_START_ADD (uint32_t)0x0801F800
#define INTERVAL_TIMER TIM2
#define TEN_KHZ_TIMER TIM6
#define UTILITY_TIMER TIM7
Expand Down
Loading

0 comments on commit d45dcc6

Please sign in to comment.