![]() |
OS
v1.8.0
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 dt=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). | |
| bool | operator() (void) |
| Watch for the state and events for all channels registered inside the watcher instance (Non-Blocking call). | |
| size_t | getAnalogChannelsCount (void) const noexcept |
| Returns the number of analog channels monitored by this instance. | |
| size_t | getDigitalChannelsCount (void) const noexcept |
| Returns the number of digital channels monitored by this instance. | |
The digital input-channel watcher class.
|
inlineexplicit |
Constructor for the input-watcher instance.
| [in] | dt | 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 |
Returns the number of analog channels monitored by this instance.
|
noexcept |
Returns the number of digital channels monitored by this instance.
|
inline |
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.
|
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.