12 namespace duds {
namespace hardware {
namespace interface {
143 maxOutputCurrent(cur)
152 return (capabilities & (
153 Input | OutputPushPull | OutputDriveHigh | OutputDriveLow |
154 ControllablePulldown | ControllablePullup | InterruptOnEvent
162 return (capabilities & OutputDriveMask) !=
Flags::Zero();
206 typedef boost::error_info<
static constexpr Flags OutputDriveMask
A mask of all output flags that involve driving the line.
static constexpr Flags Input
Input operation is supported.
static constexpr Flags EventEdgeRising
The pin supports setting an event flag on the rising edge.
constexpr DigitalPinCap(const Flags cap, std::uint16_t cur=0)
Construct fully initiallized.
constexpr bool operator==(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
static constexpr Flags OutputDriveLow
The output is or can be an open collector or open drain type.
Defines the configuration for a digital general purpose I/O pin.
constexpr DigitalPinCap NonexistentDigitalPin
The capabilities of a non-existent pin.
constexpr bool canOutput() const
Returns true if the port is capable of output.
boost::error_info< struct Info_DigitalPinCap, DigitalPinCap > DigitalPinCapInfo
static constexpr Flags OutputDriveHigh
The output is or can be an open emitter type.
static constexpr Flags EventEdgeChange
The pin supports setting an event flag on an edge change.
static constexpr BitFlags Zero()
Makes a bit flags container with all flags cleared.
static constexpr Flags EventLevelHigh
The pin supports setting an event flag on a high level.
constexpr DigitalPinCap::Flags operator|(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
static constexpr BitFlags Bit(std::uint16_t b)
Makes a bit flags container with a single bit set that is specified by digit number rather than value...
std::uint16_t maxOutputCurrent
The maximum output current in milliamps (?) the pin can manage, or zero if unspecified or not applica...
static constexpr Flags ControllablePullup
The use of the pin's pull-up resistor can be controlled by software.
Flags capabilities
The capabilities of a digital pin.
constexpr DigitalPinCap::Flags operator&(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
constexpr bool operator!=(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
DigitalPinConfig::Flags firstOutputDriveConfigFlags() const
Returns the output configuration flags that corresponds to the result of firstOutputDriveFlag().
static constexpr Flags EventLevelLow
The pin supports setting an event flag on a low level.
duds::general::BitFlags< struct DigitalPinFlags, std::uint16_t > Flags
A container of flags that control the operation of a digital pin.
constexpr bool exists() const
Returns true if the pin exists and is usable by this process.
ConversationVector & operator<<(ConversationVector &cv, const Int &i)
Insertion operator to add an integer to a ConversationVector object.
static constexpr Flags OutputPushPull
The output can drive the line either low or high.
static constexpr Flags OutputHighImpedance
The pin supports a high impedance state without input.
constexpr BitsType flags() const
Returns the value stored in the object.
DigitalPinCap()=default
Construct uninitialized.
Defines the capabilites of a digital general purpose I/O pin.
static constexpr Flags InterruptOnEvent
The pin supports triggering an interrupt when an event occurs.
Flags firstOutputDriveFlag() const
Checks the flags in OutputDriveMask, starting with OutputPushPull, and returns the first match found ...
static constexpr Flags HasPulldown
The pin has a pull-down resistor.
DigitalPinRejectedConfiguration::Reason compatible(const DigitalPinConfig &cfg) const
Returns a set of flags that indicate certain incompatible conditions in the given pin configuration i...
static constexpr Flags ControllablePulldown
The use of the pin's pull-down resistor can be controlled by software.
constexpr DigitalPinCap::Flags operator^(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
static constexpr Flags EventEdgeFalling
The pin supports setting an event flag on the falling edge.
static constexpr Flags HasPullup
The pin has a pull-up resistor.