OS
v1.7.5
Documentation
|
The digital input-channel watcher class. More...
#include <input.hpp>
Public Member Functions | |
watcher (const qOS::duration_t dt=100_ms) | |
Constructor for the input-watcher instance. | |
watcher (const digitalReaderFcn_t &rDigital, const analogReaderFcn_t &rAnalog, const qOS::duration_t timeDebounce=100_ms) | |
Constructor for the input-watcher instance. | |
bool | add (channel &c) noexcept |
Add a channel to the watcher instance. | |
bool | add (channel &c, eventCallback_t cb) noexcept |
Add a channel to the watcher instance. | |
bool | add (channel &c, digitalReaderFcn_t fcn, eventCallback_t cb) noexcept |
Add a channel to the watcher instance. | |
bool | add (channel &c, analogReaderFcn_t fcn, eventCallback_t cb) noexcept |
Add a channel to the watcher instance. | |
bool | remove (channel &c) noexcept |
Remove a channel to the watcher instance. | |
bool | watch (void) noexcept |
Watch for the state and events for all channels registered inside the watcher instance (Non-Blocking call). | |
Additional Inherited Members | |
Protected Member Functions inherited from qOS::node | |
list * | getContainer (void) noexcept |
Get a pointer to the list in which this node is contained. | |
node () | |
The digital input-channel watcher class.
|
inline |
Constructor for the input-watcher instance.
[in] | timeDebounce | The specified time to bypass the bounce of the digital input channels |
|
inline |
Constructor for the input-watcher instance.
[in] | rDigital | A pointer to a function that reads the specific digital input channel |
[in] | rAnalog | A pointer to a function that reads the specific analog input channel |
[in] | dt | The specified time to bypass the bounce of the digital input channels. Is also used as sample time on analog input channels to trigger input::event::STEP and input::event::DELTA events. |
|
noexcept |
Add a channel to the watcher instance.
[in] | c | The input-Channel to watch |
true
on success. Otherwise false
.
|
inlinenoexcept |
Add a channel to the watcher instance.
[in] | c | The input-Channel to watch |
[in] | fcn | The reader function for the analog channel |
[in] | cb | The callback function for the input-channel |
true
on success. Otherwise false
.
|
inlinenoexcept |
Add a channel to the watcher instance.
[in] | c | The input-Channel to watch |
[in] | fcn | The reader function for the digital channel |
[in] | cb | The callback function for the input-channel |
true
on success. Otherwise false
.
|
inlinenoexcept |
Add a channel to the watcher instance.
[in] | c | The input-Channel to watch |
[in] | cb | The callback function for the input-channel |
true
on success. Otherwise false
.
|
noexcept |
Remove a channel to the watcher instance.
[in] | c | The input-Channel to watch |
true
on success. Otherwise false
.
|
noexcept |
Watch for the state and events for all channels registered inside the watcher instance (Non-Blocking call).
true
when the input channels have been completed an updated cycle. Otherwise false
.