-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfan.h
38 lines (29 loc) · 1.16 KB
/
fan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//----------------------------------------------------------------------------
//Ìîäóëü óïðàâëåíèÿ âåíòèëÿòîðîì, çàãîëîâî÷íûé ôàéë
//----------------------------------------------------------------------------
#ifndef FAN_H
#define FAN_H
//------------------------------- Êîíñòàíòû: ---------------------------------
#define FAN_MIN_SPEED 25 //ìèíèìàëüíàÿ ñêîðîñòü âåíòèëÿòîðà, %
#define FAN_MAX_SPEED 100 //ìàêñèìàëüíàÿ ñêîðîñòü âåíòèëÿòîðà, %
#define FAN_STARTUP_SPEED 70 //ñêîðîñòü ñòàðòà âåíòèëÿòîðà, %
#define FAN_MIN_RUN 5 //ìèí. âðåìÿ ðàáîòû âåíòèëÿòîðà ïîñëå ñòàðòà, ñ
//----------------------------------------------------------------------------
//------------------------------ Êëàññ TFan: ---------------------------------
//----------------------------------------------------------------------------
class TFan
{
private:
TGpio<PORTB, PIN14> Pin_FAN;
uint8_t Speed;
uint8_t State;
uint8_t RunTimer;
int32_t Reg_Out;
public:
TFan(void);
void Control(int16_t tl, int16_t th, int16_t tget);
void SetSpeed(uint8_t p);
uint8_t GetSpeed(void);
};
//----------------------------------------------------------------------------
#endif