12 namespace duds {
namespace hardware {
namespace interface {
15 unsigned int total = (
unsigned int)
pinvec.size() + len;
16 if (total >
pinvec.capacity()) {
28 old.port()->updateAccess(old,
this);
45 const std::vector<unsigned int> &pos
47 std::vector<unsigned int> pins;
48 pins.reserve(pos.size());
49 std::vector<unsigned int>::const_iterator iter = pos.cbegin();
50 for (; iter != pos.cend(); ++iter) {
51 if ((*iter != -1) && (*iter >=
pinvec.size())) {
56 pins.push_back(
pinvec[*iter]);
62 std::vector<DigitalPinConfig> c(
pinvec.size(), conf);
67 std::vector<bool> s(
pinvec.size(), state);
Provides access to multiple pins on a DigitalPort.
DigitalPort * port() const
Returns a pointer to the port that controls the pin(s) that are operated through this object...
Defines the configuration for a digital general purpose I/O pin.
std::vector< unsigned int > subset(const std::vector< unsigned int > &pos) const
Produces a vector with port local pin IDs that are a subset of the pins in this access object...
DigitalPinConfig modifyConfig(unsigned int globalPinId, const DigitalPinConfig &cfg, DigitalPinAccessBase::PortData *pdata)
Modifies the configuration of a single pin with an independent configuration.
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
A pin required for the operation does not exist or is unavailable to the process. ...
DigitalPinConfig modifyConfig(unsigned int pos, const DigitalPinConfig &conf) const
Modifies the configuration of a pin.
DigitalPinSetAccess & operator=(DigitalPinSetAccess &&old) noexcept
A move assignment.
void reset()
Loses the pointer to the DigitalPort rendering the access object useless.
boost::error_info< struct Info_PinId, unsigned int > PinErrorId
The pin global ID involved in the error.
PortData portdata
Port specific information.
DigitalPinAccessBase & operator=(DigitalPinAccessBase &&old) noexcept
Allows moving access objects.
void reserveAdditional(unsigned int len)
Reserves additional space in pins so that upcoming pushes onto the vector will not cause multiple mem...
void updateAccess(const DigitalPinAccess &oldAcc, DigitalPinAccess *newAcc)
Transfers or relinquishes access to pins.
bool havePins() const
Returns true if this object has been given any pins to access.
void output(unsigned int pos, bool state) const
Changes the output state of a 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 ...
unsigned int globalId(unsigned int pos) const
Returns the global pin ID of the pin at the given position inside this set of pins.
std::vector< unsigned int > pinvec
The port local pin IDs this object may use.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
void retire() noexcept
Relinquish access.