Follow this link to skip to the main content

analog_in_impl.h

Go to the documentation of this file.
00001 // -*-c++-*- 
00002 //---------------------------< /-/ CLARAty /-/ >------------------------------
00003 /** 
00004  * @file  analog_in_impl.h
00005  *
00006  * Analog input implementation.
00007  *
00008  * <br>@b Designer(s):  Issa Nesnas,
00009  *                      Won Kim
00010  * <br>@b Author(s):    Won Kim,
00011  *                      Issa Nesnas
00012  * <br>@b Date:         August 16, 2002
00013  *
00014  * <b>Software License:</b><br>
00015  * <code>  http://claraty.jpl.nasa.gov/license/open_src/  or
00016  *         file: license/open_src.txt  </code>
00017  *
00018  * &copy; 2006, Jet Propulsion Laboratory, California Institute of Technology<br>
00019  *
00020  * $Revision: 1.5 $
00021  */ 
00022 //-----------------------------------------------------------------------------
00023 
00024 #if !defined (__ANALOG_IN_IMPL_H)
00025 #define __ANALOG_IN_IMPL_H
00026 
00027 #include "claraty/share.h"
00028 
00029 namespace claraty {
00030 
00031 /**
00032  * @ingroup hardware_pkg
00033  *
00034  * Analog input implementation.
00035  */
00036 //@{
00037 //@}
00038 
00039 
00040 #if 0
00041 // scan mode
00042 const int AI_DISABLE_SCAN               = 0;    // disable scan
00043 const int AI_UNIFORM_CONT               = 1;    // uniform continuous
00044 const int AI_UNIFORM_SINGLE             = 2;    // uniform single
00045 const int AI_BURST_CONT                 = 3;    // burst continuous
00046 const int AI_BURST_SINGLE               = 4;    // burst single
00047 const int AI_EXT_TRIG                   = 5;    // external trigger
00048 const int AI_BURST_SINGLE_PER_CHANNEL   = 6;    // special for AI.input()
00049 #endif
00050 
00051 //-------------------------------------------------------------------------
00052 //---------------<< analaog_in_impl Class >>----------------------
00053 //-------------------------------------------------------------------------
00054 
00055 class AI_impl {
00056 
00057 public:
00058   // AI_impl ();                // use default constructor
00059 
00060   virtual void set_scan_mode(int scan_mode, int int_mode, int timer_mode, 
00061     int conv_time = -1, int timer_prescaler = -1) {}
00062   virtual void set_start_end_channels(int start_ch, int end_ch) {}
00063   virtual void conv_start() {}
00064   virtual void conv_wait() {}
00065   virtual int conv_read(int channel) {}
00066   virtual void conv_stop() {}
00067 
00068   virtual void set_ch_gain(int channel, int gain_index) {}
00069   virtual void calibrate() {}
00070 
00071   virtual float get_gain_for_V(int channel) {return 0.;}        // unit in V
00072   virtual float get_offset_for_V(int channel) {return 0.;}      // unit in V
00073 
00074   virtual int input(int channel) = 0;   // pure virtual; reading digital number
00075 };
00076 //-------------------------------------------------------------------------
00077 
00078 
00079 class AI_impl_null : public AI_impl
00080 {
00081 public:
00082   int input(int channel) {return 0;}    // null input
00083 };
00084 //-------------------------------------------------------------------------
00085 
00086 } // namespace claraty
00087 
00088 #endif // __ANALOG_IN_IMPL_H