blob: 165d7534919ac660f55c21d5bed4b27401c2e14d (
plain)
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
39
40
41
42
43
44
45
46
|
/*
* RemoteFan.h
*
* Created on: 3 Sep 2019
* Author: David
*/
#ifndef SRC_FANS_REMOTEFAN_H_
#define SRC_FANS_REMOTEFAN_H_
#include "Fan.h"
#if SUPPORT_CAN_EXPANSION
#include "GCodes/GCodeResult.h"
class RemoteFan : public Fan
{
public:
RemoteFan(unsigned int fanNum, CanAddress boardNum) noexcept;
~RemoteFan() noexcept;
bool Check(bool checkSensors) noexcept override; // update the fan PWM returning true if it is a thermostatic fan that is on
bool IsEnabled() const noexcept override;
int32_t GetRPM() const noexcept override { return lastRpm; }
float GetPwm() const noexcept override { return lastPwm; }
GCodeResult SetPwmFrequency(PwmFrequency freq, const StringRef& reply) noexcept override;
GCodeResult ReportPortDetails(const StringRef& str) const noexcept override;
void UpdateFromRemote(CanAddress src, const FanReport& report) noexcept override;
GCodeResult ConfigurePort(const char *pinNames, PwmFrequency freq, const StringRef& reply) noexcept;
protected:
bool UpdateFanConfiguration(const StringRef& reply) noexcept override;
GCodeResult Refresh(const StringRef& reply) noexcept override;
private:
int32_t lastRpm;
float lastPwm;
uint32_t whenLastReportReceived;
CanAddress boardNumber;
};
#endif
#endif /* SRC_FANS_REMOTEFAN_H_ */
|