semf
inputcapture.h
Go to the documentation of this file.
1
10#ifndef SEMF_INPUT_INPUTCAPTURE_H_
11#define SEMF_INPUT_INPUTCAPTURE_H_
12
15#include <cstdint>
16#include <climits>
17
18namespace semf
19{
24{
25public:
27 enum Trigger : uint8_t
28 {
32 };
33
34 virtual ~InputCapture() = default;
35
40 virtual unsigned int ticksPerSecond() const = 0;
45 virtual void setMaxTicks(unsigned int maxTicks) = 0;
50 virtual unsigned int maxTicks() const = 0;
52 virtual void start() = 0;
54 virtual void stop() = 0;
59 virtual unsigned int ticks() = 0;
64 virtual void setTrigger(Trigger trigger) = 0;
65
70};
71} /* namespace semf */
72#endif /* SEMF_INPUT_INPUTCAPTURE_H_ */
Class for utilizing the input capture from the uC.
Definition: inputcapture.h:24
virtual void setTrigger(Trigger trigger)=0
Sets the trigger source.
virtual unsigned int maxTicks() const =0
Get the maximum number of ticks from the timer.
virtual void setMaxTicks(unsigned int maxTicks)=0
Set the maximum number of ticks at which the tick counter will overflow.
virtual ~InputCapture()=default
Signal< Error > error
Definition: inputcapture.h:69
virtual void stop()=0
virtual unsigned int ticks()=0
Get the latest number of ticks (at the last change of the input).
virtual void start()=0
virtual unsigned int ticksPerSecond() const =0
Returns the the number of ticks per second (Hardware timer frequency).
Signal for lightweight signal/slot implementation. One signal can be connected to multiple slots and ...
Definition: signal.h:41