|
Open Model Railroad Network (OpenMRN)
|
Simple implementation of the BitEventInterface for going through GPIO ports. More...
#include <EventHandlerTemplates.hxx>
Public Member Functions | |
| GPIOBit (Node *node, EventId event_on, EventId event_off, const Gpio *gpio) | |
| template<class HW > | |
| GPIOBit (Node *node, EventId event_on, EventId event_off, const HW &, const Gpio *g=HW::instance(), decltype(HW::instance) *=0) | |
| EventState | get_current_state () OVERRIDE |
| returns the current hardware state: true for ON, false for OFF. | |
| void | set_state (bool new_value) OVERRIDE |
| Updates the hardware for the new event state. | |
| Node * | node () OVERRIDE |
| returns the OpenLCB virtual node from which to send the respective events when the bit changes. | |
Public Member Functions inherited from openlcb::BitEventInterface | |
| BitEventInterface (uint64_t event_on, uint64_t event_off) | |
| virtual EventState | get_requested_state () |
| Get the requested state. | |
| uint64_t | event_on () |
| returns the event ID for representing the state transition OFF->ON. | |
| uint64_t | event_off () |
| returns the event ID for representing the state transition ON->OFF. | |
Public Attributes | |
| Node * | node_ |
| const Gpio * | gpio_ |
Simple implementation of the BitEventInterface for going through GPIO ports.
The port getter and setter are taken as a GPIO* pointer.
Definition at line 494 of file EventHandlerTemplates.hxx.
|
inline |
Definition at line 497 of file EventHandlerTemplates.hxx.
|
inline |
Definition at line 505 of file EventHandlerTemplates.hxx.
|
inlinevirtual |
returns the current hardware state: true for ON, false for OFF.
Implements openlcb::BitEventInterface.
Definition at line 510 of file EventHandlerTemplates.hxx.
|
inlinevirtual |
returns the OpenLCB virtual node from which to send the respective events when the bit changes.
Implements openlcb::BitEventInterface.
Definition at line 518 of file EventHandlerTemplates.hxx.
|
inlinevirtual |
Updates the hardware for the new event state.
| new_value | is true for state ON, false for state OFF. |
Implements openlcb::BitEventInterface.
Definition at line 514 of file EventHandlerTemplates.hxx.
| const Gpio* openlcb::GPIOBit::gpio_ |
Definition at line 525 of file EventHandlerTemplates.hxx.
| Node* openlcb::GPIOBit::node_ |
Definition at line 524 of file EventHandlerTemplates.hxx.