Digital IO library¶
The Digital IO Library is used to read or write a digital signal from a n number of channels based on different modes and a pulse width.
The available modes are : - NONE - HIGH - LOW - TOGGLE - PULSE
The library defined an interface which allow to easily extends to different types of IO device.
-
class DigitalDevice
Subclassed by DummyDIO
Public Functions
-
inline DigitalDevice(std::string type)
-
std::string type() const
-
virtual std::string description() const
-
virtual uint32_t nchannels() const = 0
-
virtual DigitalState read_state() const = 0
-
virtual void write_state(DigitalState &state) = 0
-
inline DigitalDevice(std::string type)
-
class DigitalState
Public Functions
-
inline DigitalState(uint32_t nchannels = 0)
-
uint32_t nchannels() const
-
std::vector<bool>::reference operator[](uint32_t channel)
-
bool state(uint32_t channel) const
-
std::vector<bool> &state()
-
std::vector<bool> state(std::vector<uint32_t> channels) const
-
void set_state(uint32_t channel, bool value)
-
void set_state(std::vector<uint32_t> channels, bool value)
-
void set_state(bool value)
-
void set_state(std::vector<bool> values)
-
void set_state(std::vector<uint32_t> channels, std::vector<bool> values)
-
void toggle_state(uint32_t channel)
-
void toggle_state(std::vector<uint32_t> channels)
-
std::string to_string(std::string high = "1", std::string low = "0", std::string spacer = "") const
-
inline DigitalState(uint32_t nchannels = 0)
Available devices¶
Dummy IO¶
Only classical read/write state.
-
class DummyDIO : public DigitalDevice
Public Functions
-
inline DummyDIO(uint32_t nchannels)
-
virtual uint32_t nchannels() const
-
virtual DigitalState read_state() const
-
virtual void write_state(DigitalState &state)
-
inline DummyDIO(uint32_t nchannels)
Advantech IO¶
Implementation present in past version of Falcon but removed because it needs a separate/private set of libraries. It can be re-implemented in a separate extension if needed in the future.