/*
 * Fan_Control.c
 *
 *  Created on: Jun 23, 2022
 *      Author: max
 */

#include "Fan_Control.h"

#include "stm32g4xx_hal_tim.h"

#include <stdint.h>

TIM_HandleTypeDef* fan_pwm_timer;
uint32_t fan_pwm_channel;

void Temp_Ctrl_Init(TIM_HandleTypeDef* htim, uint32_t channel) {
  fan_pwm_timer = htim;
  fan_pwm_channel = channel;
  HAL_TIM_PWM_Start(fan_pwm_timer, fan_pwm_channel);
}

void Temp_Ctrl_Loop() {
  __HAL_TIM_SET_COMPARE(fan_pwm_timer, fan_pwm_channel, 65000);
}
