Dio class for use with Janz char driver.
More...
#include <carma/canbus/JanzDio.h>
Dio class for use with Janz char driver.
Dio provides digital input and output control for Janz Dio cards. The Dio class is tailored for use with Janz CAN cards and the CARMA RJ45 breakout board all contained on a Janz Compact PCI carrier board. As a result the methods available below represent the uses of the dio pins in conjunction with those boards rather than routines to write and read generic data to/from the Dio card.
Definition at line 32 of file JanzDio.h.
carma::canbus::JanzDio::JanzDio |
( |
| ) |
|
Default constructor for hardware emulation.
This constructor opens /dev/null as the 'Dio' device. It is included to allow writes to the Dio class when Janz hardware does not exist on the target system.
- Exceptions
-
carma::canbus::ErrorException | if error opening /dev/null. |
carma::canbus::JanzDio::JanzDio |
( |
const std::string & |
dev, |
|
|
bool |
resetOnStart = false |
|
) |
| |
Single device/port contructor for Dio.
This constructor is for use with a single port on the Janz TTL card.
- Parameters
-
dev | Device name (e.g /dev/mttla_02 for port a on a TTL card residing on modulbus 0 slot 2). |
resetOnStart | will write a resetHi to Dio immediately following startup. This is useful for placing devices in a known state until the user is ready to start them. The user is responsible for reasserting the line low! |
- Exceptions
-
carma::canbus::ErrorException | on error. |
carma::canbus::JanzDio::JanzDio |
( |
const std::string & |
dev0, |
|
|
const std::string & |
dev1, |
|
|
bool |
resetOnStart = false |
|
) |
| |
Multiple port constructor for Dio.
In practice this should be used to control different ports on the same device although this constraint is not necessary.
- Parameters
-
dev0 | First device (e.g. /dev/mttla_02) |
dev1 | Second device (e.g. /dev/mttlb_02) |
resetOnStart | will write a resetHi to Dio immediately following startup. This is useful for placing devices in a known state until the user is ready to start them. The user is responsible for reasserting the line low! |
- Exceptions
-
carma::canbus::ErrorException | on error. |
carma::canbus::JanzDio::JanzDio |
( |
const ::std::vector< ::std::string > & |
devs, |
|
|
bool |
resetOnStart = false |
|
) |
| |
Constructor for an arbitrary number of Dio ports.
- Parameters
-
Vector | of string device names. |
resetOnStart | will write a resetHi to Dio immediately following startup. This is useful for placing devices in a known state until the user is ready to start them. The user is responsible for reasserting the line low! |
- Exceptions
-
carma::canbus::ErrorException | on error. |
carma::canbus::JanzDio::~JanzDio |
( |
| ) |
|
void carma::canbus::JanzDio::clear |
( |
| ) |
|
|
virtual |
Clear (unassert) all lines.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
void carma::canbus::JanzDio::powerOff |
( |
| ) |
|
|
virtual |
Unassert the 'power' line.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
void carma::canbus::JanzDio::powerOn |
( |
| ) |
|
|
virtual |
Assert the 'power' line.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
void carma::canbus::JanzDio::reservedHi |
( |
| ) |
|
|
virtual |
Assert the 'reserved' line.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
void carma::canbus::JanzDio::reservedLo |
( |
| ) |
|
|
virtual |
Unassert the 'reserved' line.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
void carma::canbus::JanzDio::resetHi |
( |
| ) |
|
|
virtual |
Assert the reset line.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
void carma::canbus::JanzDio::resetLo |
( |
| ) |
|
|
virtual |
Unassert the 'reset' line.
- Exceptions
-
carma::canbus::ErrorException | on error. |
Implements carma::canbus::Dio.
The documentation for this class was generated from the following file: