Merge branch 'feature/e-endstop' into merge-abc-with-homing
[clinton/Smoothieware.git] / src / libs / Pwm.h
CommitLineData
11f8ba4e
MM
1#ifndef _PWM_H
2#define _PWM_H
3
4#include <stdint.h>
5
6#include "Pin.h"
7#include "Module.h"
8
9class Pwm : public Module, public Pin {
10public:
11 Pwm();
12
13 void on_module_load(void);
14 uint32_t on_tick(uint32_t);
15
11f8ba4e
MM
16 Pwm* max_pwm(int);
17 int max_pwm(void);
18
19 void pwm(int);
f181397a 20 int get_pwm() const { return _pwm; }
11f8ba4e
MM
21 void set(bool);
22
989d0e94 23private:
11f8ba4e
MM
24 int _max;
25 int _pwm;
26 int _sd_accumulator;
27 bool _sd_direction;
28};
29
30#endif /* _PWM_H */