Skip to content

Commit

Permalink
l431: minimal changes for build and bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 10, 2024
1 parent 80f3236 commit f417d2d
Show file tree
Hide file tree
Showing 12 changed files with 938 additions and 7,015 deletions.
57 changes: 57 additions & 0 deletions Inc/targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@
#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_B
#define TARGET_VOLTAGE_DIVIDER 94
#define CURRENT_OFFSET 0
#define MILLIVOLT_PER_AMP 100
#define USE_SERIAL_TELEMETRY
#endif

#ifdef REF_G431
#define FIRMWARE_NAME "Ref G431 "
#define FILE_NAME "REF_G431" // DISABLE_BUILD
Expand Down Expand Up @@ -2709,6 +2722,50 @@

#endif

#ifdef HARDWARE_GROUP_L4_B

#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 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_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_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 USE_COMP_2

#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

/************************************ MCU COMMON PERIPHERALS
* **********************************************/

Expand Down
Loading

0 comments on commit f417d2d

Please sign in to comment.