nidas  v1.2-1520
Public Member Functions | Private Attributes | List of all members
nidas::dynld::ViperDIO Class Reference

Support for the digital IO on an Arcom Viper. More...

#include <ViperDIO.h>

Public Member Functions

 ViperDIO ()
 
 ~ViperDIO ()
 
void setDeviceName (const std::string &val)
 
const std::string & getDeviceName () const
 
const std::string & getName () const
 
int getFd () const
 
void open () throw (nidas::util::IOException)
 Open the DIO device. More...
 
void close () throw (nidas::util::IOException)
 Close the DIO device. More...
 
int getNumOutputs () const
 Return number of DOUT pins on this device (8). More...
 
int getNumInputs () const
 Return number of DIN pins on this device (8). More...
 
void clearOutputs (const nidas::util::BitArray &which) throw (nidas::util::IOException, nidas::util::InvalidParameterException)
 Clear, to low state, viper digital output ports OUT0-7, as selected by bits 0-7 of which. More...
 
void setOutputs (const nidas::util::BitArray &which) throw (nidas::util::IOException, nidas::util::InvalidParameterException)
 Set, to high state, viper digital output ports OUT0-7, as selected by bits 0-7 of which. More...
 
void setOutputs (const nidas::util::BitArray &which, const nidas::util::BitArray &val) throw (nidas::util::IOException, nidas::util::InvalidParameterException)
 Set ports OUT0-7, selected by bits 0-7 of which, to 0(low) or high(1) based on bits 0-7 of val. More...
 
nidas::util::BitArray getOutputs () throw (nidas::util::IOException)
 Get current settings of OUT0-7. More...
 
nidas::util::BitArray getInputs () throw (nidas::util::IOException)
 get current settings of IN0-7 More...
 

Private Attributes

std::string _devName
 
int _fd
 The file descriptor of this device. More...
 
int _noutputs
 How many DOUT pins are on this device? More...
 
int _ninputs
 How many DIN pins are on this device? More...
 

Detailed Description

Support for the digital IO on an Arcom Viper.

There are 8 independent inputs, IN0-7, and 8 independent outputs OUT0-7. The value of the inputs can be read, and the value of the outputs written or read.

Constructor & Destructor Documentation

ViperDIO::ViperDIO ( )
ViperDIO::~ViperDIO ( )

References _fd, and close().

Member Function Documentation

void ViperDIO::clearOutputs ( const nidas::util::BitArray which)
throw (nidas::util::IOException,
nidas::util::InvalidParameterException
)

Clear, to low state, viper digital output ports OUT0-7, as selected by bits 0-7 of which.

References VIPER_DIO_CLEAR.

void ViperDIO::close ( )
throw (nidas::util::IOException
)

Close the DIO device.

References _fd.

Referenced by ~ViperDIO().

const std::string& nidas::dynld::ViperDIO::getDeviceName ( ) const
inline

References _devName.

int nidas::dynld::ViperDIO::getFd ( ) const
inline

References _fd.

n_u::BitArray ViperDIO::getInputs ( )
throw (nidas::util::IOException
)

get current settings of IN0-7

References _devName, _fd, nidas::util::BitArray::setBits(), and VIPER_DIO_GET_DIN.

const std::string& nidas::dynld::ViperDIO::getName ( ) const
inline

References _devName.

int nidas::dynld::ViperDIO::getNumInputs ( ) const
inline

Return number of DIN pins on this device (8).

Value will be 0 if the device has not been opened, or -1 if the open failed.

References _ninputs.

int nidas::dynld::ViperDIO::getNumOutputs ( ) const
inline

Return number of DOUT pins on this device (8).

Value will be 0 if the device has not been opened, or -1 if the open failed.

References _noutputs.

Referenced by main().

n_u::BitArray ViperDIO::getOutputs ( )
throw (nidas::util::IOException
)

Get current settings of OUT0-7.

References _devName, _fd, nidas::util::BitArray::setBits(), and VIPER_DIO_GET_DOUT.

Referenced by main().

void ViperDIO::open ( )
throw (nidas::util::IOException
)

Open the DIO device.

References _devName, _fd, _ninputs, _noutputs, VIPER_DIO_GET_NIN, and VIPER_DIO_GET_NOUT.

Referenced by main().

void nidas::dynld::ViperDIO::setDeviceName ( const std::string &  val)
inline

References _devName.

Referenced by main().

void ViperDIO::setOutputs ( const nidas::util::BitArray which)
throw (nidas::util::IOException,
nidas::util::InvalidParameterException
)

Set, to high state, viper digital output ports OUT0-7, as selected by bits 0-7 of which.

References VIPER_DIO_SET.

Referenced by main().

void ViperDIO::setOutputs ( const nidas::util::BitArray which,
const nidas::util::BitArray val 
)
throw (nidas::util::IOException,
nidas::util::InvalidParameterException
)

Set ports OUT0-7, selected by bits 0-7 of which, to 0(low) or high(1) based on bits 0-7 of val.

References VIPER_DIO_SET_TO_VAL.

Member Data Documentation

std::string nidas::dynld::ViperDIO::_devName
private
int nidas::dynld::ViperDIO::_fd
private

The file descriptor of this device.

Referenced by close(), getFd(), getInputs(), getOutputs(), open(), and ~ViperDIO().

int nidas::dynld::ViperDIO::_ninputs
private

How many DIN pins are on this device?

Referenced by getNumInputs(), and open().

int nidas::dynld::ViperDIO::_noutputs
private

How many DOUT pins are on this device?

Referenced by getNumOutputs(), and open().


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