DUDS
Distributed Update of Data from Something
DigitalPort.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2017 Jeff Jackowski
9  */
10 #ifndef DIGITALPORT_HPP
11 #define DIGITALPORT_HPP
12 
15 #include <condition_variable>
16 #include <memory>
17 #include <mutex>
18 
19 namespace duds { namespace hardware { namespace interface {
20 
21 class DigitalPinAccess;
22 class DigitalPinSetAccess;
23 
47 class DigitalPort :
48  boost::noncopyable,
49  public std::enable_shared_from_this<DigitalPort>
50 {
55  mutable std::mutex block;
59  std::condition_variable pinwait;
62 protected:
66  struct PinEntry {
67  // add boost::signals2::signal objects for events
87  PinEntry() : access(nullptr) { }
92  PinEntry(const DigitalPinCap::Flags capf, std::uint16_t cur) :
93  access(nullptr), cap(capf, cur) { }
98  operator bool () const {
99  return cap.exists();
100  }
105  cap = NonexistentDigitalPin;
107  }
108  };
109  typedef std::vector<PinEntry> PinVector;
114  PinVector pins;
115 private:
120  unsigned int idOffset;
125  int waiting;
130  void shutdownAccessRequests();
136  bool areAvailable(const unsigned int *reqpins, std::size_t len);
141  void waitForAvailability(
142  std::unique_lock<std::mutex> &lock,
143  const unsigned int * const reqpins, // global IDs
144  const std::size_t len
145  );
158  void updateAccess(const DigitalPinAccess &oldAcc, DigitalPinAccess *newAcc);
171  void updateAccess(
172  const DigitalPinSetAccess &oldAcc,
173  DigitalPinSetAccess *newAcc
174  );
175 protected:
181  DigitalPort(unsigned int numpins, unsigned int firstid);
194  void shutdown();
195 
196  /* * UnimplementedError
197  * Adds pins to an already constructed port. The pins will be initialized
198  * to an unavailable state to avoid use until after the implementation has
199  * prepared the pin data for use.
200  * @throw PinExists
201  */
202  //void addPins(unsigned int maxId);
203  /* * UnimplementedError
204  * Removes a pin from the port by changing its data to an unavailable state.
205  * This function will block until the pin is not being accessed. Then it
206  * will change the pin's state to unavailble. It will not change the size
207  * of the vector @a pins.
208  */
209  //void removePin(unsigned int localPinId);
210 
217  const DigitalPinConfig &configRef(unsigned int localPinId) const {
218  return pins[localPinId].conf;
219  }
220 
221  std::vector<DigitalPinCap> capabilities(
222  const std::vector<unsigned int> &pvec, bool global
223  ) const;
225  unsigned int gid,
226  DigitalPinConfig &pconf,
227  DigitalPinConfig &iconf
228  ) const = 0;
229  virtual bool proposeConfigImpl(
230  const std::vector<unsigned int> &localPinIds,
231  std::vector<DigitalPinConfig> &propConf,
232  std::vector<DigitalPinConfig> &initConf,
233  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
234  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
235  ) const = 0;
236  virtual bool proposeFullConfigImpl(
237  std::vector<DigitalPinConfig> &propConf,
238  std::vector<DigitalPinConfig> &initConf,
239  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
240  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
241  ) const = 0;
242 
256  unsigned int globalPinId,
257  const DigitalPinConfig &cfg,
259  );
279  void modifyFullConfig(
280  std::vector<DigitalPinConfig> &propConf,
281  std::vector<DigitalPinConfig> &initConf,
283  );
297  void modifyConfig(
298  std::vector<DigitalPinConfig> &cfgs,
300  );
301  void modifyConfig(
302  const std::vector<unsigned int> &pvec,
303  std::vector<DigitalPinConfig> &cfgs,
305  );
316  virtual void configurePort(
317  unsigned int localPinId,
318  const DigitalPinConfig &cfg,
320  ) = 0;
331  virtual void configurePort(
332  const std::vector<DigitalPinConfig> &cfgs,
334  ) = 0;
335 
336  std::vector<DigitalPinConfig> configuration(
337  const std::vector<unsigned int> &pvec, bool global
338  ) const;
339 
345  std::vector<DigitalPinConfig> configurationImpl() const;
356  bool input(unsigned int gid, DigitalPinAccessBase::PortData *pdata);
369  std::vector<bool> input(
370  const std::vector<unsigned int> &pvec,
372  );
380  virtual bool inputImpl(
381  unsigned int gid,
383  ) = 0;
397  virtual std::vector<bool> inputImpl(
398  const std::vector<unsigned int> &pvec,
400  );
413  void output(
414  unsigned int gid,
415  bool state,
417  );
433  void output(
434  const std::vector<unsigned int> &pvec,
435  const std::vector<bool> &state,
437  );
448  virtual void outputImpl(
449  unsigned int lid,
450  bool state,
452  ) = 0;
472  virtual void outputImpl(
473  const std::vector<unsigned int> &pvec,
474  const std::vector<bool> &state,
476  );
485  virtual void madeAccess(DigitalPinAccess &acc);
494  virtual void madeAccess(DigitalPinSetAccess &acc);
501  virtual void retiredAccess(const DigitalPinAccess &acc) noexcept;
508  virtual void retiredAccess(const DigitalPinSetAccess &acc) noexcept;
518  const DigitalPinAccessBase &acc
519  ) {
520  return acc.portdata;
521  }
531  template <typename T>
532  static void portDataPtr(const DigitalPinAccessBase &acc, T **ptr) {
533  *ptr = (T*)acc.portdata.pointer;
534  }
535 
536 public:
541  virtual ~DigitalPort();
548  virtual bool simultaneousOperations() const = 0;
556  DigitalPinCap capabilities(unsigned int globalPinId) const;
561  std::vector<DigitalPinCap> capabilities() const;
572  std::vector<DigitalPinCap> capabilities(
573  const std::vector<unsigned int> &pvec
574  ) const {
575  return capabilities(pvec, true);
576  }
590  std::vector<DigitalPinCap> capabilitiesLocalIds(
591  const std::vector<unsigned int> &pvec
592  ) const {
593  return capabilities(pvec, false);
594  }
604  DigitalPinConfig configuration(unsigned int globalPinId) const;
609  std::vector<DigitalPinConfig> configuration() const;
620  std::vector<DigitalPinConfig> configuration(
621  const std::vector<unsigned int> &pvec
622  ) const {
623  return configuration(pvec, true);
624  }
638  std::vector<DigitalPinConfig> configurationLocalIds(
639  const std::vector<unsigned int> &pvec
640  ) const {
641  return configuration(pvec, false);
642  }
659  unsigned int gid,
660  DigitalPinConfig &pconf,
661  DigitalPinConfig &iconf
662  ) const;
676  unsigned int gid,
677  DigitalPinConfig &pconf
678  ) const {
679  // should these parameters really not be const?
681  return proposeConfig(gid, pconf, onc);
682  }
691  bool proposeConfig(
692  const std::vector<unsigned int> &globalPinIds,
693  std::vector<DigitalPinConfig> &propConf,
694  std::vector<DigitalPinConfig> &initConf,
695  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
696  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
697  ) const;
699  const std::vector<unsigned int> &localPinIds,
700  std::vector<DigitalPinConfig> &propConf,
701  std::vector<DigitalPinConfig> &initConf,
702  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
703  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
704  ) const;
705  // above with current config for initial
707  const std::vector<unsigned int> &pins,
708  std::vector<DigitalPinConfig> &propConf,
709  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
710  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
711  ) const {
712  std::vector<DigitalPinConfig> initConf;
713  return proposeConfig(pins, propConf, initConf, insertReason);
714  }
716  const std::vector<unsigned int> &pins,
717  std::vector<DigitalPinConfig> &propConf,
718  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
719  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
720  ) const {
721  std::vector<DigitalPinConfig> initConf;
722  return proposeConfigLocalIds(pins, propConf, initConf, insertReason);
723  }
724  bool proposeFullConfig(
725  std::vector<DigitalPinConfig> &propConf,
726  std::vector<DigitalPinConfig> &initConf,
727  std::function<void(DigitalPinRejectedConfiguration::Reason)> insertReason
728  = std::function<void(DigitalPinRejectedConfiguration::Reason)>()
729  ) const;
730  /*
731  // (index-idOffset) == pin ID to reconfigure
732  template <std::size_t N>
733  void configure(DigitalPinConfig (&a)[N]);
734  typedef std::initializer_list<DigitalPinConfig> ConfigList;
735  void configure(const ConfigList &cfgs, int start = 0);
736  void configure(const std::vector<DigitalPinConfig> &cfgs, int start = 0);
737  // use DigitalPinConfig with ID as key
738  template <class C>
739  void configure(const C &cfgs);
740  // configure one pin
741  void configure(unsigned int id, const DigitalPinConfig &cfg);
742  */
748  unsigned int offset() const {
749  return idOffset;
750  }
757  unsigned int localId(unsigned int globalId) const {
758  return globalId - idOffset;
759  }
764  std::vector<unsigned int> localIds(
765  const std::vector<unsigned int> &globalIds
766  ) const;
775  unsigned int globalId(unsigned int localId) const {
776  return localId + idOffset;
777  }
782  std::vector<unsigned int> globalIds(
783  const std::vector<unsigned int> &localIds
784  ) const;
789  unsigned int size() const {
790  return pins.size();
791  }
796  bool exists(unsigned int gid) const;
797  /*
798  * Obtains a DigitalPin object from the port.
799  * @param id The global pin ID to get.
800 
801  @todo REDO this !!!
802 
803  */ /*
804  std::shared_ptr<DigitalPin> pin(unsigned int id) const {
805  std::lock_guard<duds::general::Spinlock> lock(spin);
806  return pins.at(localId(id));
807  } */
820  virtual bool independentConfig(
821  unsigned int gid,
822  const DigitalPinConfig &newcfg,
823  const DigitalPinConfig &initcfg
824  ) const = 0;
831  virtual bool independentConfig() const = 0;
832 
833  void poll();
834  // gets input state & records changes
835  void pollInput();
836  // calls event signals for changed pins
837  void pollSignal();
838 
839  // ------------- Update docs -------------
875  void access(
876  const unsigned int *pins,
877  const unsigned int len,
878  std::unique_ptr<DigitalPinAccess> *acc
879  );
880  // gcc probably won't figure out array length for acc
881  template <std::size_t Len>
882  void access(
883  const unsigned int pins[Len],
884  std::unique_ptr<DigitalPinAccess> acc[Len]
885  ) {
886  access(pins, Len, acc);
887  }
888  std::unique_ptr<DigitalPinAccess> access(const unsigned int pin);
889  /*
890  * Obtain access objects to use a set of pins.
891  *
892  * The access objects to all requested pins are either all obtained, or
893  * not obtained. If not all the access objects can be obtained, and no
894  * exception is thrown, the calling thread will block and attempt to get
895  * the access objects later when they might all be available. Barring an
896  * exception or destruction of the PinStore, the thread will continue to
897  * block until all the access objects are obtained.
898  *
899  * @param pins An array of pin id values. All values must be for pins
900  * already in @a store, and values <B>must not</B> be repeated.
901  * The value @a -1 will be skipped over; the corresponding
902  * object in @a acc will be made using the default constructor.
903  * @param len The length of both the @a acc and @a pins arrays.
904  * @param acc A unique pointer to an array of DigitalPinAccess objects.
905  * @pre @a acc contains one of:
906  * - An allocated array of default constructed unused
907  * DigitalPinAccess objects of length @a len.
908  * - An allocated but uninitialized array long enough for
909  * @a len DigitalPinAccess objects.
910  * - An allocated array of destructed DigitalPinAccess
911  * objects of length @a len.
912  * - An empty unique pointer.
913  * @warning No check is performed to assure any supplied constructed
914  * access object is not already in use. The object's
915  * @ref DigitalPinAccess::havePin() "havePin()" function
916  * @b must return false. If this condition is not met, some
917  * pins may be considered to be in-use as long as the process
918  * continues to run, much like a memory leak.
919  * @post If @a acc was empty, it will be given an array of length
920  * @a len. If it was not empty, the given array will be used.
921  * If a PinDoesNotExist or ObjectDestructedError exception is
922  * thrown, @a acc will not be modified. Any other exception
923  * may be thrown after @a acc is modified.
924  * @throw PinDoesNotExist A requested pin does not exist within this
925  * port.
926  * @throw ObjectDestructedError The PinStore object was destructed before the
927  * request could be fullfilled.
928  * @throw PinInUse A pin was requested twice or more; there is a
929  * repeated value in @a pins. If thrown, @a acc
930  * may be modified.
931  */ /*
932  void access(
933  const unsigned int *pins,
934  const unsigned int len
935  std::unique_ptr<DigitalPinAccess[]> &acc,
936  ); */
982  void access(
983  const unsigned int *pins,
984  const unsigned int len,
985  DigitalPinAccess *acc
986  );
987  void access(
988  const std::vector<unsigned int> &pins,
989  DigitalPinAccess *acc
990  ) {
991  access(&(pins[0]), pins.size(), acc);
992  }
993 
994  // had trouble with one length; not sure two will work
996  template <std::size_t alen, std::size_t plen>
997  void access(const unsigned int pins[plen], DigitalPinAccess acc[alen]) {
998  static_assert(alen == plen,
999  "The arrays must have the same number of objects.");
1000  access(pins, alen, acc);
1001  }
1037  void access(
1038  const unsigned int *pins,
1039  const unsigned int len,
1040  DigitalPinSetAccess &acc
1041  );
1042  void access(
1043  const unsigned int *begin,
1044  const unsigned int *end,
1045  DigitalPinSetAccess &acc
1046  ) {
1047  access(begin, end - begin, acc);
1048  }
1049  void access(
1050  const std::vector<unsigned int> &pins,
1051  DigitalPinSetAccess &acc
1052  ) {
1053  access(&(pins[0]), pins.size(), acc);
1054  }
1055  std::unique_ptr<DigitalPinSetAccess> access(
1056  const std::vector<unsigned int> &pins
1057  );
1058  // Would need forward iterators, not input iterators, to use the iterators
1059  // instead of vector. Will traverse range at least twice.
1060  template <class InputIter>
1061  void access(
1062  const InputIter &begin,
1063  const InputIter &end,
1064  DigitalPinSetAccess &acc
1065  ) {
1066  std::vector<unsigned int> pvec(begin, end);
1067  access(&(pvec[0]), pvec.size(), acc);
1068  }
1069 
1070  // ------------- Update above docs -------------
1071 
1072  /*
1073  Todo:
1074  Maybe have a function to handle polling for events that can be used
1075  in place of or in addition to interrupts?
1076  */
1077 
1078 };
1079 
1083 typedef boost::error_info<struct Info_DigitalPortAffected, const DigitalPort*>
1085 
1086 /*
1087 
1088 Why is this here?
1089 
1090 inline unsigned int DigitalPinAccess::globalId() const {
1091  return port->globalId(pid);
1092 }
1093 inline const DigitalPinConfig &DigitalPinAccess::config() const noexcept {
1094  return port()->configRef(pid);
1095 }
1096 
1097 inline void DigitalPinAccess::configure(const DigitalPinConfig &conf) {
1098  port->configure(pid, conf);
1099 }
1100 
1101 inline unsigned int DigitalPinSetAccess::globalId(unsigned int pos) const {
1102  unsigned int lid = pins.at(pos);
1103  if (lid == -1) {
1104  return lid;
1105  } else {
1106  return port->globalId(lid);
1107  }
1108 }
1109 
1110 */
1111 
1112 } } }
1113 
1114 #endif // #ifndef DIGITALPORT_HPP
bool proposeFullConfig(std::vector< DigitalPinConfig > &propConf, std::vector< DigitalPinConfig > &initConf, std::function< void(DigitalPinRejectedConfiguration::Reason)> insertReason=std::function< void(DigitalPinRejectedConfiguration::Reason)>()) const
void access(const std::vector< unsigned int > &pins, DigitalPinAccess *acc)
virtual ~DigitalPort()
Derived classes should call shutdown() early in their destructors.
Definition: DigitalPort.cpp:18
void access(const InputIter &begin, const InputIter &end, DigitalPinSetAccess &acc)
void markNonexistent()
Modify the pin to be non-existent.
virtual bool simultaneousOperations() const =0
True if the implementation supports operating on multiple pins simultaneously.
Provides access to multiple pins on a DigitalPort.
bool input(unsigned int gid, DigitalPinAccessBase::PortData *pdata)
Does error checking in advance of calling inputImpl(unsigned int) to read the input of the given pin...
unsigned int offset() const
Returns the offset for the port&#39;s pins.
std::vector< unsigned int > localIds(const std::vector< unsigned int > &globalIds) const
Converts the provided global pin IDs to local pin IDs.
Definition: DigitalPort.cpp:60
DigitalPinAccessBase * access
A pointer to an access object, or nullptr if no access object for the pin exists. ...
Definition: DigitalPort.hpp:73
void access(const unsigned int *begin, const unsigned int *end, DigitalPinSetAccess &acc)
static DigitalPinAccessBase::PortData & portData(const DigitalPinAccessBase &acc)
Returns a reference to the port specific data in the given DigitalPinAccessBase object.
Defines the configuration for a digital general purpose I/O pin.
constexpr DigitalPinCap NonexistentDigitalPin
The capabilities of a non-existent pin.
bool areAvailable(const unsigned int *reqpins, std::size_t len)
Checks a set of pins to see if they are all currently available.
unsigned int localId(unsigned int globalId) const
Returns the local ID for a pin given the global ID.
DigitalPinConfig modifyConfig(unsigned int globalPinId, const DigitalPinConfig &cfg, DigitalPinAccessBase::PortData *pdata)
Modifies the configuration of a single pin with an independent configuration.
virtual bool independentConfig() const =0
Returns true if all pins always have an independent configuration from all other pins.
const DigitalPinConfig & configRef(unsigned int localPinId) const
Returns a reference to a pin&#39;s configuration on behalf of an access object.
bool exists(unsigned int gid) const
Returns true if the pin exists in this port.
Definition: DigitalPort.cpp:50
Represents an interface to a group of hardware related digital GPIO lines.
Definition: DigitalPort.hpp:47
DigitalPinConfig conf
The configuration for the pin.
Definition: DigitalPort.hpp:78
unsigned int globalId(unsigned int localId) const
Returns the global ID for a pin given the local ID.
virtual void configurePort(unsigned int localPinId, const DigitalPinConfig &cfg, DigitalPinAccessBase::PortData *pdata)=0
Changes the hardware configuration for a single pin.
bool proposeConfig(const std::vector< unsigned int > &pins, std::vector< DigitalPinConfig > &propConf, std::function< void(DigitalPinRejectedConfiguration::Reason)> insertReason=std::function< void(DigitalPinRejectedConfiguration::Reason)>()) const
static void portDataPtr(const DigitalPinAccessBase &acc, T **ptr)
Provides a pointer to type T stored in the port specific data of the given DigitalPinAccessBase objec...
A type for holding arbitrary port-specific data within a DigitalPinAccess or DigitalPinSetAccess obje...
virtual void madeAccess(DigitalPinAccess &acc)
Called after a new access object is made to allow a port implementation to take further action...
boost::error_info< struct Info_DigitalPortAffected, const DigitalPort * > DigitalPortAffected
Added to exceptions thrown by DigitalPort objects.
PortData portdata
Port specific information.
PinEntry(const DigitalPinCap::Flags capf, std::uint16_t cur)
Initializes access to nullptr and cap using the values specified.
Definition: DigitalPort.hpp:92
void modifyFullConfig(std::vector< DigitalPinConfig > &propConf, std::vector< DigitalPinConfig > &initConf, DigitalPinAccessBase::PortData *pdata)
Does the work of the modifyConfig() functions in the case that the whole port configuration must be c...
std::vector< DigitalPinConfig > configurationLocalIds(const std::vector< unsigned int > &pvec) const
Returns the configuration of all the pins requested by local ID.
The base class for the digital pin access classes.
void shutdownAccessRequests()
Used by the shutdown functions to force any thread waiting on access to pins to quit waiting and fail...
std::mutex block
Used to serialize access to internal data for thread-safe operation.
Definition: DigitalPort.hpp:55
bool proposeConfigLocalIds(const std::vector< unsigned int > &localPinIds, std::vector< DigitalPinConfig > &propConf, std::vector< DigitalPinConfig > &initConf, std::function< void(DigitalPinRejectedConfiguration::Reason)> insertReason=std::function< void(DigitalPinRejectedConfiguration::Reason)>()) const
virtual bool proposeFullConfigImpl(std::vector< DigitalPinConfig > &propConf, std::vector< DigitalPinConfig > &initConf, std::function< void(DigitalPinRejectedConfiguration::Reason)> insertReason=std::function< void(DigitalPinRejectedConfiguration::Reason)>()) const =0
virtual void retiredAccess(const DigitalPinAccess &acc) noexcept
Called just before an access object is retired to allow a port implementation to take further action...
unsigned int idOffset
An offset used to translate pin identification numbers between global scope and local scope...
constexpr bool exists() const
Returns true if the pin exists and is usable by this process.
void shutdown()
Waits for access to all pins so that any user of access objects may finish with their operation...
Definition: DigitalPort.cpp:20
PinEntry()
Initializes access to nullptr; other fields are left uninitialized.
Definition: DigitalPort.hpp:87
std::vector< unsigned int > globalIds(const std::vector< unsigned int > &localIds) const
Converts the provided local pin IDs to global pin IDs.
Definition: DigitalPort.cpp:78
std::vector< DigitalPinCap > capabilities() const
Returns the capabilities of all pins in the port.
unsigned int size() const
The maximum number of pins on the port.
void updateAccess(const DigitalPinAccess &oldAcc, DigitalPinAccess *newAcc)
Transfers or relinquishes access to pins.
Provides access to a single pin on a DigitalPort.
int waiting
A count of the threads waiting to access pins.
void * pointer
A pointer available for use by DigitalPort implementations to manage additional implementation specif...
std::vector< DigitalPinConfig > configuration(const std::vector< unsigned int > &pvec) const
Returns the configuration of all the pins requested by global ID.
void access(const unsigned int pins[plen], DigitalPinAccess acc[alen])
This is a nice idea that may fail at compile time.
std::vector< DigitalPinCap > capabilitiesLocalIds(const std::vector< unsigned int > &pvec) const
Returns the capabilities of all the pins requested by local ID.
virtual void outputImpl(unsigned int lid, bool state, DigitalPinAccessBase::PortData *pdata)=0
Changes the output state of the given 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 ...
std::condition_variable pinwait
Used to efficently wait for resources to become available.
Definition: DigitalPort.hpp:59
void access(const std::vector< unsigned int > &pins, DigitalPinSetAccess &acc)
DigitalPort(unsigned int numpins, unsigned int firstid)
Initializes internal data.
Definition: DigitalPort.cpp:15
bool proposeConfigLocalIds(const std::vector< unsigned int > &pins, std::vector< DigitalPinConfig > &propConf, std::function< void(DigitalPinRejectedConfiguration::Reason)> insertReason=std::function< void(DigitalPinRejectedConfiguration::Reason)>()) const
DigitalPinRejectedConfiguration::Reason proposeConfig(unsigned int gid, DigitalPinConfig &pconf, DigitalPinConfig &iconf) const
Proposes a configuration change for a single pin.
Defines the capabilites of a digital general purpose I/O pin.
virtual bool inputImpl(unsigned int gid, DigitalPinAccessBase::PortData *pdata)=0
Reads input from the given pin.
static constexpr Flags OperationNoChange
No change to any pin operation.
void access(const unsigned int pins[Len], std::unique_ptr< DigitalPinAccess > acc[Len])
std::vector< DigitalPinConfig > configurationImpl() const
Returns the configuration of all pins in the port.
std::vector< DigitalPinCap > capabilities(const std::vector< unsigned int > &pvec) const
Returns the capabilities of all the pins requested by global ID.
PinVector pins
Data on each pin handled by the port.
Construction option for initializing all fields to defaul values.
DigitalPinCap cap
The capabilities of the pin.
Definition: DigitalPort.hpp:83
Data stored for each pin controlled by the port.
Definition: DigitalPort.hpp:66
std::vector< DigitalPinConfig > configuration() const
Returns the configuration of all pins in the port.
virtual DigitalPinRejectedConfiguration::Reason proposeConfigImpl(unsigned int gid, DigitalPinConfig &pconf, DigitalPinConfig &iconf) const =0
DigitalPinRejectedConfiguration::Reason proposeConfig(unsigned int gid, DigitalPinConfig &pconf) const
Proposes a configuration change for a single pin from the port&#39;s current configuration.
void waitForAvailability(std::unique_lock< std::mutex > &lock, const unsigned int *const reqpins, const std::size_t len)
Waits for all pins to become available.