PicoLC Arduino Library Arduino library for PicoLC hardware |
Represents one filtered, logical PicoLC input. More...
#include <PicoLCInput.h>
Public Member Functions | |
| bool | read () const |
| Returns the current filtered logical input state. | |
| bool | rising () const |
| Reports a false-to-true logical transition. | |
| bool | falling () const |
| Reports a true-to-false logical transition. | |
| bool | changed () const |
| Reports any logical input transition. | |
| void | filterMillis (uint32_t ms) |
| Sets the required input stability time. | |
| uint32_t | filterMillis () const |
| Returns the configured input stability time. | |
| void | inverted (bool invert) |
| Enables or disables logical input inversion. | |
| bool | inverted () const |
| Returns whether logical input inversion is enabled. | |
Friends | |
| class | PicoLC |
Represents one filtered, logical PicoLC input.
PicoLCInput samples a physical input during PicoLC::update(), applies optional inversion, then applies the configured stability filter before updating its logical state. Edge detection operates only on the resulting logical state.
Instances are created and owned by PicoLC and are accessed through members such as PicoLC::X0 through PicoLC::X3.
Definition at line 18 of file PicoLCInput.h.
| bool PicoLCInput::changed | ( | ) | const |
Reports any logical input transition.
Filtering and inversion are applied before change detection. The result remains true for the current scan and is cleared by the next PicoLC::update().
Definition at line 69 of file PicoLCInput.cpp.
| bool PicoLCInput::falling | ( | ) | const |
Reports a true-to-false logical transition.
Filtering and inversion are applied before edge detection. The result remains true for the current scan and is cleared by the next PicoLC::update().
Definition at line 62 of file PicoLCInput.cpp.
| uint32_t PicoLCInput::filterMillis | ( | ) | const |
Returns the configured input stability time.
Definition at line 47 of file PicoLCInput.cpp.
| void PicoLCInput::filterMillis | ( | uint32_t | ms | ) |
Sets the required input stability time.
A value of zero disables filtering and applies the sampled logical state during the next PicoLC::update(). Changing the duration does not restart an active filter interval; the new value is compared against the existing elapsed interval during the next update.
| ms | Required stability time in milliseconds. |
Definition at line 43 of file PicoLCInput.cpp.
| bool PicoLCInput::inverted | ( | ) | const |
Returns whether logical input inversion is enabled.
Definition at line 39 of file PicoLCInput.cpp.
| void PicoLCInput::inverted | ( | bool | invert | ) |
Enables or disables logical input inversion.
Inversion is applied before filtering and edge detection. This is a setup-time configuration setting. Behavior is undefined if changed while normal scan processing is active.
The new setting takes effect during the next PicoLC::update().
| invert | true to invert the sampled physical input. |
Definition at line 35 of file PicoLCInput.cpp.
| bool PicoLCInput::read | ( | ) | const |
Returns the current filtered logical input state.
The value changes only during PicoLC::update().
Definition at line 51 of file PicoLCInput.cpp.
| bool PicoLCInput::rising | ( | ) | const |
Reports a false-to-true logical transition.
Filtering and inversion are applied before edge detection. The result remains true for the current scan and is cleared by the next PicoLC::update().
Definition at line 55 of file PicoLCInput.cpp.
| friend |
Definition at line 19 of file PicoLCInput.h.