35#ifndef _OPENLCB_POLLEDPRODUCER_HXX_
36#define _OPENLCB_POLLEDPRODUCER_HXX_
47template <
class Debouncer,
class BaseBit>
51 template <
typename... Fields>
54 : BaseBit(bit_args...)
55 , debouncer_(debounce_args)
58 debouncer_.initialize(BaseBit::get_current_state() == EventState::VALID);
63 return debouncer_.current_state() ? EventState::VALID : EventState::INVALID;
66 void set_state(
bool new_value)
OVERRIDE
68 debouncer_.override(new_value);
73 if (debouncer_.update_state(BaseBit::get_current_state() == EventState::VALID))
An object that can schedule itself on an executor to run.
void SendEventReport(WriteHelper *writer, Notifiable *done)
Requests the event associated with the current value of the bit to be produced (unconditionally): sen...
Event handler for a single-bit producer, e.g.
Producer class for GPIO bits.
void poll_33hz(WriteHelper *helper, Notifiable *done) OVERRIDE
This function will be called approximately 33 times per second by the refresh loop.
Abstract base class for components that need repeated execution (with a specified frequency,...
A statically allocated buffer for sending one message to the OpenLCB bus.
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
EventState
Allowed states of producers and consumers.