Digital I/O operations on a device. More...
#include <cvb/driver/digital_io.hpp>
Public Member Functions | |
DevicePtr | Parent () const noexcept |
Gets the parent device of this interface. | |
int | InputCount () const |
Gets the number of digital input ports of the device. | |
int | OutputCount () const |
Gets the number of digital output ports of the device. | |
bool | ReadInputBit (int port) const |
Reads a single input port from the device. | |
std::bitset< 32 > | ReadInputGroup (int group) const |
Reads a group of input ports from the device. | |
bool | ReadOutputBit (int port) const |
Reads a single output port from the device. | |
std::bitset< 32 > | ReadOutputGroup (int group) const |
Reads a group of output ports from the device. | |
void | WriteOutputBit (int port, bool value) |
Write a single output port to the device. | |
void | WriteOutputGroup (int group, std::bitset< 32 > value) |
Writes the output group to the device. | |
void | WriteOutputGroup (int group, std::bitset< 32 > value, std::bitset< 32 > mask) |
Writes the output group to the device. | |
Digital I/O operations on a device.
|
inline |
Gets the number of digital input ports of the device.
Any | exception derived from std::exception including CvbException. |
|
inline |
Gets the number of digital output ports of the device.
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Gets the parent device of this interface.
Does | not throw any exception. |
|
inline |
Reads a single input port from the device.
[in] | port | Port index to read. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Reads a group of input ports from the device.
[in] | group | Group index to read. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Reads a single output port from the device.
[in] | port | Port index to read. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Reads a group of output ports from the device.
[in] | group | Group index to read. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Write a single output port to the device.
[in] | port | Port index to write. |
[in] | value | Value of port state. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Writes the output group to the device.
[in] | group | Group index to read. |
[in] | value | True for output high state; false for low. |
Any | exception derived from std::exception including CvbException. |
An output group consists of 32 single ports. Non existent ports are ignored. Thus there are only more than one output group if output count is larger than 32.
|
inline |
Writes the output group to the device.
[in] | group | Group index to read. |
[in] | value | Vector of port states. |
[in] | mask | Bit mask for the bits being actually set to the ports. |
Any | exception derived from std::exception including CvbException. |
An output group consists of 32 single ports. Non existent ports are ignored. Thus there are only more than one output group if output count is larger than 32.
We use cookies to improve your experience. By using this documentation, you agree to our use of cookies.