CARMA C++
carma::canbus::JanzDio Class Reference

Dio class for use with Janz char driver. More...

#include <carma/canbus/JanzDio.h>

Inheritance diagram for carma::canbus::JanzDio:
carma::canbus::Dio

Public Member Functions

void clear ()
 Clear (unassert) all lines. More...
 
 JanzDio ()
 Default constructor for hardware emulation. More...
 
 JanzDio (const std::string &dev, bool resetOnStart=false)
 Single device/port contructor for Dio. More...
 
 JanzDio (const std::string &dev0, const std::string &dev1, bool resetOnStart=false)
 Multiple port constructor for Dio. More...
 
 JanzDio (const ::std::vector< ::std::string > &devs, bool resetOnStart=false)
 Constructor for an arbitrary number of Dio ports. More...
 
void powerOff ()
 Unassert the 'power' line. More...
 
void powerOn ()
 Assert the 'power' line. More...
 
void reservedHi ()
 Assert the 'reserved' line. More...
 
void reservedLo ()
 Unassert the 'reserved' line. More...
 
void resetHi ()
 Assert the reset line. More...
 
void resetLo ()
 Unassert the 'reset' line. More...
 
 ~JanzDio ()
 Destructor. More...
 
- Public Member Functions inherited from carma::canbus::Dio
virtual ~Dio ()
 Destructor. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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::ErrorExceptionif 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
devDevice name (e.g /dev/mttla_02 for port a on a TTL card residing on modulbus 0 slot 2).
resetOnStartwill 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::ErrorExceptionon 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
dev0First device (e.g. /dev/mttla_02)
dev1Second device (e.g. /dev/mttlb_02)
resetOnStartwill 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::ErrorExceptionon error.
carma::canbus::JanzDio::JanzDio ( const ::std::vector< ::std::string > &  devs,
bool  resetOnStart = false 
)

Constructor for an arbitrary number of Dio ports.

Parameters
Vectorof string device names.
resetOnStartwill 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::ErrorExceptionon error.
carma::canbus::JanzDio::~JanzDio ( )

Destructor.

Member Function Documentation

void carma::canbus::JanzDio::clear ( )
virtual

Clear (unassert) all lines.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.

void carma::canbus::JanzDio::powerOff ( )
virtual

Unassert the 'power' line.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.

void carma::canbus::JanzDio::powerOn ( )
virtual

Assert the 'power' line.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.

void carma::canbus::JanzDio::reservedHi ( )
virtual

Assert the 'reserved' line.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.

void carma::canbus::JanzDio::reservedLo ( )
virtual

Unassert the 'reserved' line.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.

void carma::canbus::JanzDio::resetHi ( )
virtual

Assert the reset line.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.

void carma::canbus::JanzDio::resetLo ( )
virtual

Unassert the 'reset' line.

Exceptions
carma::canbus::ErrorExceptionon error.

Implements carma::canbus::Dio.


The documentation for this class was generated from the following file: