mv-bms/Core/Src/PWM_control.c
2024-05-24 21:13:02 +03:00

30 lines
858 B
C

#include "PWM_control.h"
#include "stm32f3xx_hal_tim.h"
#include <stdint.h>
uint8_t powerground_status;
uint8_t battery_cooling_status;
TIM_HandleTypeDef powerground1, powerground2, battery_cooling;
void PWM_control_init(TIM_HandleTypeDef powerground1, TIM_HandleTypeDef powerground2, TIM_HandleTypeDef battery_cooling){
powerground_status = 0;
battery_cooling = 0;
HAL_TIM_PWM_Start(&powerground1, 1);
HAL_TIM_PWM_Start(&powerground2, 4);
HAL_TIM_PWM_Start(&battery_cooling, 3);
//__HAL_TIM_SET_COMPARE(&powerground1, 1, 0);
//__HAL_TIM_SET_COMPARE(&powerground2, 4, 0);
//__HAL_TIM_SET_COMPARE(&battery_cooling, 3, 0);
}
void PWM_powerground_control(uint8_t percent){
//uint8_t duty_cycle = (percent/100) * 65536;
//__HAL_TIM_SET_COMPARE(&powerground1, 1, 0);
}
void PWM_battery_cooling_control(uint8_t percent){
}