ReduxLib C++ 2024.1.1-beta0
|
#include <CanandcolorDigoutSlot.h>
Classes | |
struct | CompareAffine |
struct | CompareImmidiate |
struct | Disabled |
struct | PrevClauseTrueFor |
struct | PrevSlotTrueFor |
Public Types | |
using | DigoutSlotType = std::variant< Disabled, CompareImmidiate, CompareAffine, PrevSlotTrueFor, PrevClauseTrueFor > |
Public Member Functions | |
template<std::convertible_to< DigoutSlotType > T> | |
constexpr | DigoutSlot (T slot) |
constexpr uint64_t | ToSettingData () const |
Static Public Member Functions | |
static constexpr DigoutSlot | FromSettingData (uint64_t data) |
Public Attributes | |
DigoutSlotType | slotType |
Represents a digout "slot" which helps determine the digital output's value.
When a CanandcolorDigout is set in the DigoutMode::DigoutSlot mode, the value of the digital output pin (high or low) is determined by a set of up to 16 "digout slots". These slots can each evaluate a single boolean expression, e.g. "Is the proximity sensor reading above 0.5" or "Is the blue channel reading greater than the red channel minus an offset", and are often able to read from CanandcolorDataSource to accomplish this.
Each slot can be chained by logical AND, OR, or XOR to form compound expressions of "clauses". All clauses have to evaluate to true for the digital output pin's value to be true. If a slot is not joined to the next indexed slot, it terminates a clause – terminating slots without any preceding joining slots are single-slot or "singleton" clauses.
Digout slots can take one of a few forms:
While the boolean outputs are to the digital output pads, the boolean state of each slot is also available over CAN. This DigoutSlotState can be retreived using Canandcolor.GetDigoutState.
using redux::sensors::canandcolor::digout::DigoutSlot::DigoutSlotType = std::variant<Disabled, CompareImmidiate, CompareAffine, PrevSlotTrueFor, PrevClauseTrueFor> |
The std::variant type alias of valid digout slot configs
|
inlineconstexpr |
Constructor for DigoutSlot (shouldn't need to be accessed, usually)
slot | the actual underlying slot data |
|
inlinestaticconstexpr |
Deserializes a 48-bit setting value into a DigoutSlot object.
data | setting data |
|
inlineconstexpr |
Serializes the DigoutSlot to a value that can be written in a set settings packet.
DigoutSlotType redux::sensors::canandcolor::digout::DigoutSlot::slotType |
The actual underlying digout slot config specified