14 namespace duds {
namespace hardware {
namespace interface {
138 EventNone | EventEdgeRising | EventEdgeFalling |
208 OutputDriveLow | OutputDriveHigh | OutputPushPull |
261 const std::uint16_t minOut = 0,
262 const std::uint16_t maxOut = 0
265 minOutputCurrent(minOut),
266 maxOutputCurrent(maxOut)
276 options(
Flags::Zero()),
349 typedef boost::error_info<
350 struct Info_DigitalPinConfig, DigitalPinConfig
353 inline std::ostream &
operator<<(std::ostream &os,
const DigitalPinConfig &c) {
359 const DigitalPinConfig &cap,
367 const DigitalPinConfig &cap
373 const DigitalPinConfig &cap,
381 const DigitalPinConfig &cap
387 const DigitalPinConfig &cap,
395 const DigitalPinConfig &cap
401 const DigitalPinConfig &cap,
409 const DigitalPinConfig &cap
415 const DigitalPinConfig &cap,
423 const DigitalPinConfig &cap
boost::error_info< struct Info_DigitalPinConfig, DigitalPinConfig > DigitalPinConfigInfo
static constexpr Flags DirMask
A bit mask for all direction flags.
constexpr bool operator==(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
static constexpr Flags DirInput
Configure the pin for input.
static constexpr Flags DirImmaterial
Do not care about the pin's direction.
static constexpr Flags InterruptMask
A bit mask for the interrupt configuration flags.
static constexpr Flags InterruptNone
Configure the pin to not trigger an interrupt.
Defines the configuration for a digital general purpose I/O pin.
static constexpr Flags EventNoChange
Do not change the pin's event configuration.
static constexpr Flags EventNone
Configure the pin to not flag an event when the input state changes.
static constexpr BitFlags Zero()
Makes a bit flags container with all flags cleared.
static constexpr Flags EventLevelHigh
Configure the pin to flag an event on a high level input.
static constexpr Flags OutputHighImpedance
Configure the pin to have a high impedance or floating output.
static constexpr Flags InputPulldown
Configure the pin to have a pull-down resistor.
static constexpr Flags EventEdge
Configure the pin to flag an event on any edge.
static constexpr Flags InterruptImmaterial
Do not care about the pin's interrupt configuration.
static constexpr Flags OutputPushPull
Configure the pin to drive output both high and low.
static constexpr Flags EventEdgeFalling
Configure the pin to flag an event on the falling edge.
constexpr DigitalPinCap::Flags operator|(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
static constexpr Flags OutputImmaterial
Do not care about the pin's output configuration.
duds::general::BitFlags< struct DigitalPinConfigFlags, std::uint32_t > Flags
A container of flags that control the operation of a digital pin.
static constexpr BitFlags Bit(std::uint32_t b)
Makes a bit flags container with a single bit set that is specified by digit number rather than value...
static constexpr Flags InputPullMask
A bit mask for the pull-up and pull-down resistor flags.
static constexpr Flags InputPullImmaterial
Do not care about the pin's use of a pull-up or pull-down resistor.
constexpr DigitalPinCap::Flags operator&(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
constexpr bool operator!=(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
static constexpr Flags InterruptNoChange
Do not change the pin's interrupt configuration.
static constexpr Flags OutputDriveLow
Configure the pin to be able to drive the output low.
static constexpr Flags InputPullup
Configure the pin to have a pull-up resistor.
void reverseCombine(const DigitalPinConfig &oldCfg)
Combines an old (initial) configuration with a new configuration in this object and stores the result...
static constexpr Flags OutputDriveHigh
Configure the pin to be able to drive the output high.
std::uint16_t maxOutputCurrent
The selected maximum output current in milliamps (?) for the pin, or zero for no change and immateria...
DigitalPinRejectedConfiguration::Reason compatible(const DigitalPinCap &cap) const
Returns a set of flags that indicate certain incompatible conditions in the given pin configuration i...
static constexpr Flags DirNoChange
Do not change the pin's direction.
DigitalPinConfig()=default
Construct uninitialized.
Various errors involving the use of digital GPIO hardware.
void combine(const DigitalPinConfig &newCfg)
Combines this configuration with a newer configuration taking into account requests to not change cer...
static constexpr Flags OutputNoChange
Do not change the pin's output configuration.
std::uint16_t minOutputCurrent
The selected minimum output current in milliamps (?) for the pin, or zero for no change and immateria...
ConversationVector & operator<<(ConversationVector &cv, const Int &i)
Insertion operator to add an integer to a ConversationVector object.
static constexpr Flags OutputMask
A bit mask for the output options.
static constexpr Flags EventLevelLow
Configure the pin to flag an event on a low level input.
static constexpr Flags InputNoPull
Configure the pin to not use a pull-up or pull-down resistor.
constexpr DigitalPinConfig(const Flags opt, const std::uint16_t minOut=0, const std::uint16_t maxOut=0)
Construct with initial flags and current values.
static constexpr Flags DirOutput
Configure the pin for output.
constexpr BitsType flags() const
Returns the value stored in the object.
static constexpr Flags InterruptOnEvent
Configure the pin to trigger an interrupt when an event occurs.
Defines the capabilites of a digital general purpose I/O pin.
static constexpr Flags EventMask
A bit mask for the event configuration flags.
static constexpr Flags OperationNoChange
No change to any pin operation.
void checkValidity() const
Checks for the use of obviously invalid data, such as the use of mutually exclusive options...
Flags options
The control options requested for a digital pin.
static constexpr Flags OutputState
The set output state for the pin.
constexpr DigitalPinCap::Flags operator^(const DigitalPinCap &cap, const DigitalPinCap::Flags &flg)
Construction option for initializing all fields to defaul values.
constexpr DigitalPinConfig(const ClearAll)
Construct with all values initialized to zero.
static constexpr Flags EventEdgeRising
Configure the pin to flag an event on the rising edge.
static constexpr Flags InputPullNoChange
Do not change the use or non-use of a pull-up or pull-down resistor.
static constexpr Flags EventImmaterial
Do not care about the pin's event configuration.
static constexpr Flags InputState
The last known input state from the pin.