00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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