RTT::AnalogInInterface Class Reference
[Device Interfaces]

An interface for reading analog input, like for addressing a whole subdevice in comedi. More...

#include <rtt/dev/AnalogInInterface.hpp>

Inheritance diagram for RTT::AnalogInInterface:
RTT::NameServerRegistrator< AnalogInInterface * >

List of all members.

Public Types

enum  AnalogReference { Ground = 0, Common, Differential, Other }
 

This enum can be used to configure the arefSet() function.

More...

Public Member Functions

 AnalogInInterface ()
 Create a not nameserved AnalogInInterface instance.
 AnalogInInterface (const std::string &name)
 Create a nameserved AnalogInInterface.
virtual void rangeSet (unsigned int chan, unsigned int range)=0
 Set the range of a particular channel.
virtual void arefSet (unsigned int chan, unsigned int aref)=0
 Set the analog reference of a particular channel.
virtual int rawRead (unsigned int chan, int &value)=0
 Read a raw value from channel chan.
virtual int read (unsigned int chan, double &value)=0
 Read the real value from channel chan.
virtual unsigned int rawRange () const =0
 Returns the absolute maximal range (e.g.
virtual double lowest (unsigned int chan) const =0
 Returns the current lowest measurable input expressed in MU's for a given channel.
virtual double highest (unsigned int chan) const =0
 Returns the highest measurable input expressed in MU's for a given channel.
virtual double resolution (unsigned int chan) const =0
 Resolution is expressed in bits / MU.
virtual unsigned int nbOfChannels () const =0
 Returns the total number of channels.
unsigned int binaryRange () const
 Returns the binary range (e.g.
int binaryLowest () const
 Returns the binary lowest value.
int binaryHighest () const
 Returns the binary highest value.

Static Public Attributes

static NameServer
< AnalogInInterface * > 
nameserver
 The NameServer for this interface.

Detailed Description

An interface for reading analog input, like for addressing a whole subdevice in comedi.

Unit (MU) : Unit of what is actually read on the analog channel (e.g. Volt)

Definition at line 67 of file AnalogInInterface.hpp.


Member Enumeration Documentation

This enum can be used to configure the arefSet() function.

See also:
http://www.comedi.org
Enumerator:
Common 

Reference to ground.

Differential 

Common reference.

Other 

Differential reference.

Undefined

Definition at line 75 of file AnalogInInterface.hpp.


Constructor & Destructor Documentation

RTT::AnalogInInterface::AnalogInInterface ( const std::string &  name  )  [inline]

Create a nameserved AnalogInInterface.

When name is not "" and unique, it can be retrieved using the AnalogOutInterface::nameserver.

Definition at line 91 of file AnalogInInterface.hpp.


Member Function Documentation

virtual void RTT::AnalogInInterface::arefSet ( unsigned int  chan,
unsigned int  aref 
) [pure virtual]

Set the analog reference of a particular channel.

We took (for now) the comedi API for this, where every aref (eg. Analog reference set to ground (aka AREF_GROUND) corresponds to an unsigned int.

See also:
AnalogReference
int RTT::AnalogInInterface::binaryHighest (  )  const [inline]

Returns the binary highest value.

Deprecated:
Do not use. Should return rawRange() in all implementations.

Definition at line 173 of file AnalogInInterface.hpp.

int RTT::AnalogInInterface::binaryLowest (  )  const [inline]

Returns the binary lowest value.

Deprecated:
Do not use. Should return zero in all implementations.

Definition at line 167 of file AnalogInInterface.hpp.

unsigned int RTT::AnalogInInterface::binaryRange (  )  const [inline]

Returns the binary range (e.g.

12bits AD -> 4096)

Deprecated:
by rawRange()

Definition at line 161 of file AnalogInInterface.hpp.

virtual void RTT::AnalogInInterface::rangeSet ( unsigned int  chan,
unsigned int  range 
) [pure virtual]

Set the range of a particular channel.

We took (for now) the comedi API for this, where every range (eg. -5/+5 V) corresponds to an unsigned int. You should provide a mapping from that int to a particular range in your driver documentation

virtual unsigned int RTT::AnalogInInterface::rawRange (  )  const [pure virtual]

Returns the absolute maximal range (e.g.

12bits AD -> 4096).

virtual int RTT::AnalogInInterface::rawRead ( unsigned int  chan,
int &  value 
) [pure virtual]

Read a raw value from channel chan.

Returns:
0 on sucess.
virtual int RTT::AnalogInInterface::read ( unsigned int  chan,
double &  value 
) [pure virtual]

Read the real value from channel chan.

Returns:
0 on sucess.

Member Data Documentation

The NameServer for this interface.

See also:
NameServer

Definition at line 179 of file AnalogInInterface.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:42 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3