Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

ComediIO.hh

Go to the documentation of this file.
00001 /*
00002 
00003     ComediIO
00004     Copyright (C) 2002 Jussi Laako
00005     
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <sys/types.h>
00024 #include <comedilib.h>
00025 
00026 #include <Alloc.hh>
00027 
00028 
00029 #ifndef COMEDIIO_HH
00030     #define COMEDIIO_HH
00031 
00032 
00036     class clComediIO
00037     {
00038             int iInSubDev;
00039             char *cpErrorMsg;
00040             comedi_t *comediDev;
00041             lsampl_t iInMaxValue;
00042             clAlloc InScanList;
00043             clAlloc InBuf;
00044             void SetError ();
00045             bool PcmStart (int, double *, int, unsigned int *, unsigned int, 
00046                 bool, bool);
00047             long PcmRead (sampl_t **, long);
00048         public:
00049             enum
00050             {
00051                 VERS_MASK_MAJ = 0x00ff0000,
00052                 VERS_MASK_MIN = 0x0000ff00,
00053                 VERS_MASK_PL = 0x000000ff
00054             };
00055             enum
00056             {
00057                 VERS_SHIFT_MAJ = 16,
00058                 VERS_SHIFT_MIN = 8,
00059                 VERS_SHIFT_PL = 0
00060             };
00061 
00062             clComediIO ();
00063             ~clComediIO ();
00070             bool Open (const char *);
00076             bool Close ();
00082             int GetSubdeviceCount ();
00088             int GetVersionCode ();
00094             const char *GetDriverName ();
00100             const char *GetBoardName ();
00106             const char *GetErrorMsg ()
00107                 { return cpErrorMsg; }
00108             /* --- Subdevice specific --- */
00114             bool PcmInOpen ();
00120             bool PcmInClose ();
00126             int PcmInGetChannelCount ();
00137             bool PcmInStart (double *, int, double, bool = true, bool = false);
00143             bool PcmInStop ();
00151             long PcmInRead (float *, long);
00153             long PcmInRead (double *, long);
00162             bool PcmBufferSizeSet (unsigned int);
00168             int PcmBufferSizeGet ();
00174             size_t PcmGetIntSampleSize ()
00175                 { return sizeof(sampl_t); }
00176     };
00177 
00178 
00179 #endif

Generated on Sun Oct 26 19:11:19 2003 for HASAS by doxygen 1.3.3