18 namespace duds {
namespace hardware {
namespace interface {
20 class PinConfiguration;
125 void write(
bool state);
161 SysFsPort(
const std::vector<unsigned int> &ids,
unsigned int firstid);
172 const std::string &name =
"default" 180 #ifdef HAVE_LIBBOOST_FILESYSTEM 189 unsigned int localPinId,
void write(bool state)
Changes the output value of the pin.
std::vector< FsPin > FsPinVector
Defines the configuration for a digital general purpose I/O pin.
std::fstream direction
The file used to control the I/O direction of the pin.
bool isoutput
True when the pin is configured as an output.
void open(DigitalPinConfig &conf, DigitalPinCap &cap, unsigned int pin)
Opens the value and direction files for the pin.
A type for holding arbitrary port-specific data within a DigitalPinAccess or DigitalPinSetAccess obje...
virtual void configurePort(unsigned int localPinId, const DigitalPinConfig &cfg, DigitalPinAccessBase::PortData *)
Changes the hardware configuration for a single pin.
bool read()
Reads from the value file of the pin and returns the result.
FsPinVector fspins
Internal pin objects for each pin that will be made available through this port object.
Parses configuration data for DigitalPort, DigitalPin, DigitalPinSet, ChipSelectManager, and ChipSelect objects.
A GPIO implementation using the Linux kernel's userspace interface in syfs.
bool curoutval
The current output value for the pin.
void output(unsigned int gid, bool state, DigitalPinAccessBase::PortData *pdata)
Does error checking in advance of calling outputImpl(unsigned int, bool) to change the output of the ...
bool reqoutval
The requested output value for the pin.
virtual bool simultaneousOperations() const
The sysfs interface does not support simultaneous operations; returns false.
virtual void outputImpl(unsigned int lid, bool state, DigitalPinAccessBase::PortData *)
Changes the output state of the given pin.
std::fstream value
The file used to query the pin's input state and change the pins output state.
Defines the capabilites of a digital general purpose I/O pin.
void setDirection(bool output)
Changes the pin's direction between input and output.
static std::shared_ptr< SysFsPort > makeConfiguredPort(PinConfiguration &pc, const std::string &name="default")
Make a SysFsPort object according to the given configuration, and attach to the configuration.
A partial DigitalPort implementation for ports where the configuration of each pin is independent of ...
virtual bool inputImpl(unsigned int gid, DigitalPinAccessBase::PortData *)
Reads input from the given pin.
unsigned int fsid
The GPIO's ID number from the filesystem.
SysFsPort(const std::vector< unsigned int > &ids, unsigned int firstid)
Make a SysFsPort object with the given pins.