roo_control
API Documentation for roo_control
Loading...
Searching...
No Matches
roo_control::Pcf8574::OutputPort Class Reference

Output-only port. More...

#include <pcf8574.h>

Inheritance diagram for roo_control::Pcf8574::OutputPort:
[legend]
Collaboration diagram for roo_control::Pcf8574::OutputPort:
[legend]

Public Member Functions

 OutputPort (Pcf8574 &extender, uint8_t port)
 
bool setState (BinaryLogicalState state) override
 Updates the state of the switch. Returns true on success.
 
bool getState (BinaryLogicalState &result) const override
 
- Public Member Functions inherited from roo_control::Switch< BinaryLogicalState >
virtual ~Switch ()=default
 
- Public Member Functions inherited from roo_control::Selector< State >
virtual ~Selector ()=default
 
virtual bool getState (State &result) const =0
 Retrieves the current state, or returns false when it cannot be read.
 

Detailed Description

Output-only port.

Reading the state (getState()) returns the last set value without communicating with the extender. Prefer this to Port for output-only ports.

Definition at line 43 of file pcf8574.h.

Constructor & Destructor Documentation

◆ OutputPort()

roo_control::Pcf8574::OutputPort::OutputPort ( Pcf8574 extender,
uint8_t  port 
)

Definition at line 31 of file pcf8574.cpp.

Member Function Documentation

◆ getState()

bool roo_control::Pcf8574::OutputPort::getState ( BinaryLogicalState result) const
override

Definition at line 25 of file pcf8574.cpp.

References roo_control::BINARY_STATE_HIGH, and roo_control::BINARY_STATE_LOW.

◆ setState()

bool roo_control::Pcf8574::OutputPort::setState ( BinaryLogicalState  state)
overridevirtual

Updates the state of the switch. Returns true on success.

Implements roo_control::Switch< BinaryLogicalState >.

Definition at line 21 of file pcf8574.cpp.


The documentation for this class was generated from the following files: