nidas v1.2.3
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 ()
 Open the DIO device.
 
void close ()
 Close the DIO device.
 
int getNumOutputs () const
 Return number of DOUT pins on this device (8).
 
int getNumInputs () const
 Return number of DIN pins on this device (8).
 
void clearOutputs (const nidas::util::BitArray &which)
 Clear, to low state, viper digital output ports OUT0-7, as selected by bits 0-7 of which.
 
void setOutputs (const nidas::util::BitArray &which)
 Set, to high state, viper digital output ports OUT0-7, as selected by bits 0-7 of which.
 
void setOutputs (const nidas::util::BitArray &which, const nidas::util::BitArray &val)
 Set ports OUT0-7, selected by bits 0-7 of which, to 0(low) or high(1) based on bits 0-7 of val.
 
nidas::util::BitArray getOutputs ()
 Get current settings of OUT0-7.
 
nidas::util::BitArray getInputs ()
 get current settings of IN0-7
 

Private Attributes

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

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()

ViperDIO::~ViperDIO ( )

References _fd, and close().

Member Function Documentation

◆ clearOutputs()

void ViperDIO::clearOutputs ( const nidas::util::BitArray & which)

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

Exceptions
nidas::util::IOException
nidas::util::InvalidParameterException

References _devName, _fd, _noutputs, nidas::core::getSample(), and VIPER_DIO_CLEAR.

◆ close()

void ViperDIO::close ( )

Close the DIO device.

Exceptions
nidas::util::IOException

References _fd, and close().

Referenced by close(), and ~ViperDIO().

◆ getDeviceName()

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

References _devName.

◆ getFd()

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

References _fd.

◆ getInputs()

n_u::BitArray ViperDIO::getInputs ( )

get current settings of IN0-7

Exceptions
nidas::util::IOException

References _devName, _fd, nidas::core::getSample(), and VIPER_DIO_GET_DIN.

◆ getName()

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

References _devName.

◆ getNumInputs()

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.

◆ getNumOutputs()

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 nidas::dynld::raf::CVIProcessor::attachLVInput().

◆ getOutputs()

n_u::BitArray ViperDIO::getOutputs ( )

Get current settings of OUT0-7.

Exceptions
nidas::util::IOException

References _devName, _fd, nidas::core::getSample(), and VIPER_DIO_GET_DOUT.

◆ open()

void ViperDIO::open ( )

◆ setDeviceName()

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

◆ setOutputs() [1/2]

void ViperDIO::setOutputs ( const nidas::util::BitArray & which)

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

Exceptions
nidas::util::IOException
nidas::util::InvalidParameterException

References _devName, _fd, _noutputs, nidas::core::getSample(), and VIPER_DIO_SET.

◆ setOutputs() [2/2]

void ViperDIO::setOutputs ( const nidas::util::BitArray & which,
const nidas::util::BitArray & val )

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

Exceptions
nidas::util::IOException

throws nidas::util::InvalidParameterException

References _devName, _fd, _noutputs, nidas::core::getSample(), and VIPER_DIO_SET_TO_VAL.

Member Data Documentation

◆ _devName

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

◆ _fd

int nidas::dynld::ViperDIO::_fd
private

The file descriptor of this device.

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

◆ _ninputs

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

How many DIN pins are on this device?

Referenced by getNumInputs(), and open().

◆ _noutputs

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

How many DOUT pins are on this device?

Referenced by clearOutputs(), getNumOutputs(), open(), setOutputs(), and setOutputs().


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