Mock implementation of DigitalInOut for testing.
Records the times at which the state is changed using a provided clock. This class cannot be instantiated directly. Instead, use DigitalInOutMock<kCapacity>.
Classes | |
| struct | Event |
Public Types | |
| using | State = ::pw::digital_io::State |
| using | Clock = ::pw::chrono::VirtualSystemClock |
Public Member Functions | |
| pw::InlineDeque< Event > & | events () |
Public Member Functions inherited from pw::digital_io::DigitalInOut | |
| Result< State > | GetState () |
| Result< bool > | IsStateActive () |
| Status | SetState (State state) |
| Status | SetStateActive () |
| Status | SetStateInactive () |
Public Member Functions inherited from pw::digital_io::DigitalIoOptional | |
| constexpr bool | provides_input () const |
| constexpr bool | provides_output () const |
| constexpr bool | provides_interrupt () const |
| Result< State > | GetState () |
| Status | SetState (State state) |
| Result< bool > | IsStateActive () |
| Status | SetStateActive () |
| Status | SetStateInactive () |
| Status | SetInterruptHandler (InterruptTrigger trigger, InterruptHandler &&handler) |
| Status | ClearInterruptHandler () |
| Status | EnableInterruptHandler () |
| Status | DisableInterruptHandler () |
| Status | Enable () |
| Status | Disable () |
Protected Member Functions | |
| DigitalInOutMockImpl (Clock &clock, pw::InlineDeque< Event > &events) | |
Private Member Functions | |
| pw::Status | DoEnable (bool) override |
| pw::Result< State > | DoGetState () override |
| pw::Status | DoSetState (State state) override |