24 lines
585 B
C
24 lines
585 B
C
/**** Includes ****/
|
|
#include "hal/udccd_hal.h"
|
|
#include "config.h"
|
|
|
|
/**** Public function definitions ****/
|
|
void Init_HW(void)
|
|
{
|
|
hwConfig_t hwCfg;
|
|
hwCfg.adc_clk_prescaler = ADC_DIV2;
|
|
hwCfg.adc_auto_wake = 1;
|
|
// 64kHz PWM
|
|
hwCfg.pwm_timer_prescaler = TIM_DIV1;
|
|
hwCfg.pwm_timer_top = 0x01FF;
|
|
// 1.9Hz..62.5kHz Speed input
|
|
hwCfg.freq_timer_prescaler = TIM_DIV64;
|
|
// 1kHz systick
|
|
hwCfg.systick_timer_top = 125;
|
|
hwCfg.systick_timer_prescaler = TIM_DIV64;
|
|
// No extra features
|
|
hwCfg.uart_prescaler = 0;
|
|
hwCfg.disable_unused = 0;
|
|
hwCfg.en_watchdog = 0;
|
|
HAL_Init_Min(&hwCfg);
|
|
} |