00001 /************************************************************************************************/ 00002 /*! \file daqcard.h 00003 * \brief Header file for the low-level c-code containing the <Hardware/dscud.h>-related functions used with the DAQ card. 00004 * \author $Author: jayhawk_hokie $ 00005 * \version $Revision: 1.5 $ 00006 * \date $Date: 2007/08/02 23:18:28 $ 00007 ************************************************************************************************/ 00008 /*! 00009 * 00010 ************************************************************************************************/ 00011 00012 /* some of these headers might be unneccessary */ 00013 #include <stdio.h> 00014 #include <stdlib.h> 00015 #include <unistd.h> 00016 #include <math.h> 00017 #include <sys/time.h> 00018 #include <sys/timeb.h> 00019 #include <time.h> 00020 /* diamond driver includes */ 00021 #include <Hardware/dscud.h> 00022 00023 /* static int kbhit(); */ 00024 00025 /* macros defined */ 00026 #define ERROR_PREFIX "DMM32 Driver ERROR:" 00027 00028 00029 typedef struct{ 00030 BYTE result; /* returned error code */ 00031 DSCB dscb; /* handle used to refer to the board */ 00032 DSCCB dsccb; /* structure containing board settings */ 00033 DSCADSETTINGS dscadsettings; /* structure containing A/D conversion settings */ 00034 DSCDACODE output_code; /* DA code for desired output voltage */ 00035 /*BYTE channel; seleced channel for DA output */ 00036 DSCADSCAN dscadscan; /* structure containing A/D scan settings */ 00037 /* NOTE changed WORD to SWORD in next line to make compiler happy about dscADScan */ 00038 SWORD* samples; /* sample readings */ 00039 FLOAT voltage; /* actual voltage */ 00040 ERRPARAMS errorParams; 00041 DWORD dwordBuff; 00042 DFLOAT dfloatBuff; 00043 /* change the following */ 00044 BYTE chan38; 00045 BYTE chan37; 00046 BYTE output_b; 00047 BYTE config_bytes; 00048 00049 } card_t; 00050 00051 int InitDAQCard(card_t *mycard); 00052 double ADscan(card_t *mycard, int _channel); 00053 void DAConvert(card_t *mycard, int _channel, int _code); 00054 void ShutDownDAQCard(card_t *mycard); 00055 void DIOOutputByte(card_t *mycard,int port,BYTE output_b); 00056 00057 /* Do not change the comments below - they will be added automatically by CVS*/ 00058 /***************************************************************************** 00059 * $Log: daqcard.h,v $ 00060 * Revision 1.5 2007/08/02 23:18:28 jayhawk_hokie 00061 * Fixed Warnings. 00062 * 00063 * Revision 1.4 2005/02/25 19:42:45 cakinli 00064 * Attempt 5: 00065 * Created Makefiles and organized include directives to reduce the number of 00066 * include paths. Reorganized libraries so that there is now one per source 00067 * directory. Each directory is self-contained in terms of its Makefile. 00068 * The local Makefile in each directory includes src/config.mk, which has all 00069 * the definitions and general and pattern rules. So at most, to see what 00070 * goes into building a target, a person needs to examine the Makefile in 00071 * that directory, and ../config.mk. 00072 * 00073 * Revision 1.3 2004/06/15 15:00:23 shaigunjoe 00074 * Added changes for digital signal 00075 * 00076 * Revision 1.2 2004/05/27 19:27:29 shoemaker 00077 * Made changes corresponding to new daq card settings and calibration methods 00078 * 00079 * Revision 1.1 2004/03/29 17:42:36 shoemaker 00080 * Initial submission of lowlevel c-code related to DAQ card 00081 * 00082 * 00083 ******************************************************************************/