|
DUDS
|
Distributed Update of Data from Something
|
Represents a single pin on a DigitalPort. More...
#include <DigitalPin.hpp>
Public Member Functions | |
| DigitalPin ()=default | |
| Constructs a DigitalPin object without a port or pin. More... | |
| DigitalPin (const std::shared_ptr< DigitalPort > &port, unsigned int pin) | |
| Constructs a DigitalPin object with the given port and pin. More... | |
| std::unique_ptr< DigitalPinAccess > | access () const |
| Obtains an access object to the pin. More... | |
| void | access (DigitalPinAccess *acc) const |
| Obtains an access object to the pin. More... | |
| bool | canBeInput () const |
| Returns true if the pin can operate as an input. More... | |
| bool | canBeOutput () const |
| Returns true if the pin can operate as an output. More... | |
| bool | canFloat () const |
| Returns true if the pin can provide a non-input high impedence state (or maybe allow input state?). More... | |
| DigitalPinCap | capabilities () const |
| Returns the capabilities of the represented pin. More... | |
| DigitalPinConfig | configuration () const |
| Returns the current configuration of the represented pin. More... | |
| unsigned int | globalId () const |
| Returns the global pin ID of the represented pin. More... | |
| bool | havePin () const |
| Returns true if this object has been given a pin to represent. More... | |
| unsigned int | localId () const |
| Returns the local pin ID of the represented pin. More... | |
| operator unsigned int () const | |
| Returns the global pin ID of the represented pin. More... | |
| DigitalPinRejectedConfiguration::Reason | proposeConfig (DigitalPinConfig &conf) const |
| Propose a new configuration for the represented pin using the current configuration as the initial configuration. More... | |
| DigitalPinRejectedConfiguration::Reason | proposeConfig (DigitalPinConfig &proposed, DigitalPinConfig &initial) const |
| Propose a new configuration for the represented pin using a hypothetical given initial configuration. More... | |
Public Member Functions inherited from duds::hardware::interface::DigitalPinBase | |
| const std::shared_ptr< DigitalPort > & | port () const |
| Returns the port that grants access to the pin(s) referenced by this object. More... | |
| void | reset () |
| Resets the shared pointer to the DigitalPort so that this object no longer represents a pin. More... | |
Private Attributes | |
| unsigned int | gid |
| Global pin ID. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from duds::hardware::interface::DigitalPinBase | |
| DigitalPinBase ()=default | |
| Cannot be constructed using this base class, but allows the construction of a useless object without a DigitalPort. More... | |
| DigitalPinBase (const std::shared_ptr< DigitalPort > &port) | |
| Initializes the port. More... | |
| ~DigitalPinBase ()=default | |
| Cannot be destructed using this base class to avoid the need for a virtual destructor. More... | |
Represents a single pin on a DigitalPort.
Definition at line 22 of file DigitalPin.hpp.
|
default |
Constructs a DigitalPin object without a port or pin.
| duds::hardware::interface::DigitalPin::DigitalPin | ( | const std::shared_ptr< DigitalPort > & | port, |
| unsigned int | pin | ||
| ) |
Constructs a DigitalPin object with the given port and pin.
| port | A shared pointer to the DigitalPort object that handles the pin. |
| pin | The global pin ID for the pin to represent. |
| PinDoesNotExist | The given pin does not exist in the given port. |
Definition at line 14 of file DigitalPin.cpp.
|
inline |
Obtains an access object to the pin.
Definition at line 46 of file DigitalPin.hpp.
|
inline |
Obtains an access object to the pin.
| acc | A pointer to where the access object will be constructed. It may be default constructed or uninitialized memory. It must not be an access object that currently grants access to any pin. |
Definition at line 56 of file DigitalPin.hpp.
|
inline |
Returns true if the pin can operate as an input.
Definition at line 142 of file DigitalPin.hpp.
|
inline |
Returns true if the pin can operate as an output.
Definition at line 148 of file DigitalPin.hpp.
|
inline |
Returns true if the pin can provide a non-input high impedence state (or maybe allow input state?).
Definition at line 159 of file DigitalPin.hpp.
|
inline |
Returns the capabilities of the represented pin.
Definition at line 86 of file DigitalPin.hpp.
Referenced by canBeInput(), canBeOutput(), and canFloat().
|
inline |
Returns the current configuration of the represented pin.
Definition at line 101 of file DigitalPin.hpp.
|
inline |
Returns the global pin ID of the represented pin.
Definition at line 74 of file DigitalPin.hpp.
|
inline |
Returns true if this object has been given a pin to represent.
Definition at line 62 of file DigitalPin.hpp.
|
inline |
Returns the local pin ID of the represented pin.
Definition at line 68 of file DigitalPin.hpp.
|
inline |
Returns the global pin ID of the represented pin.
Definition at line 80 of file DigitalPin.hpp.
|
inline |
Propose a new configuration for the represented pin using the current configuration as the initial configuration.
The pin's configuration is not changed; this only checks for a valid supported change.
| conf | The proposed configuration. |
Definition at line 113 of file DigitalPin.hpp.
|
inline |
Propose a new configuration for the represented pin using a hypothetical given initial configuration.
The pin's configuration is not changed; this only checks for a valid supported change.
| proposed | The proposed configuration. |
| initial | The initial configuration. It should be a valid configuration for the pin and port, but it doesn't need to be the current configuration. |
Definition at line 130 of file DigitalPin.hpp.
|
private |
Global pin ID.
Definition at line 26 of file DigitalPin.hpp.
Referenced by DigitalPin(), globalId(), and operator unsigned int().