DUDS
Distributed Update of Data from Something
VirtualPort.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) 2018 Jeff Jackowski
9  */
11 
12 namespace duds { namespace hardware { namespace interface {
13 
14 class PinConfiguration;
15 
20 namespace test {
21 
28 
35 public:
42  VirtualPort(unsigned int numpins, unsigned int firstid = 0);
59  const std::vector<unsigned int> &ids,
60  unsigned int firstid = 0
61  );
75  static std::shared_ptr<VirtualPort> makeConfiguredPort(
76  PinConfiguration &pc,
77  const std::string &name = "default"
78  );
79  virtual ~VirtualPort();
80 protected:
88  void initPin(std::uint32_t offset, unsigned int pid);
89  // virtual functions required by Digitalport
90  virtual void configurePort(
91  unsigned int localPinId,
92  const DigitalPinConfig &cfg,
94  );
95  virtual bool inputImpl(
96  unsigned int gid,
98  );
99  virtual std::vector<bool> inputImpl(
100  const std::vector<unsigned int> &pvec,
102  );
103  virtual void outputImpl(
104  unsigned int lid,
105  bool state,
107  );
108  virtual void outputImpl(
109  const std::vector<unsigned int> &pvec,
110  const std::vector<bool> &state,
112  );
113 public:
117  virtual bool simultaneousOperations() const;
118 };
119 
120 } } } } // namespaces
121 
Defines the configuration for a digital general purpose I/O pin.
Base class for all errors specific to using the VirtualPort class.
Definition: VirtualPort.hpp:27
A type for holding arbitrary port-specific data within a DigitalPinAccess or DigitalPinSetAccess obje...
Partially implements a DigitalPort for use with testing without a port.
Definition: VirtualPort.hpp:34
Parses configuration data for DigitalPort, DigitalPin, DigitalPinSet, ChipSelectManager, and ChipSelect objects.
A partial DigitalPort implementation for ports where the configuration of each pin is independent of ...
Base exception type for all errors about pins.
Definition: PinErrors.hpp:26