ams-slave-22/Core/Inc/FanControl.h
2022-06-24 04:38:23 +02:00

22 lines
467 B
C

#ifndef INC_FAN_CONTROL_H
#define INC_FAN_CONTROL_H
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_def.h"
#include "stm32f4xx_hal_tim.h"
typedef enum { FANS_OFF, FANS_ON } FanState;
extern FanState fan_state;
HAL_StatusTypeDef fan_ctrl_init(TIM_HandleTypeDef* handle, uint32_t channel);
void fan_ctrl_update();
/**
* @brief Set the power of the fan (0 -> off, 100 -> full power).
*/
void fan_ctrl_set_power(uint32_t percent);
#endif // INC_FAN_CONTROL_H