LLC2_API
|
00001 /* ------------------------------------------------------------------------- */ 00002 /* file ll2-api.h */ 00003 /* ------------------------------------------------------------------------- */ 00004 /* Copyright (C) 2011 Peter Milne, D-TACQ Solutions Ltd 00005 * <Peter dot Milne at D hyphen TACQ dot com> 00006 * Created on: Sep 14, 2011 00007 * Author: pgm 00008 00009 http://www.d-tacq.com 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of Version 2 of the GNU General Public License 00013 as published by the Free Software Foundation; 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 00023 /* ------------------------------------------------------------------------- */ 00024 00025 /** @file ll2-api.h C API definition for LOWLATENCY2. 00026 * 00027 */ 00028 00029 #ifndef LLC2_API_H_ 00030 #define LLC2_API_H_ 00031 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 typedef enum { OK, ERR=-1 } STATUS_OK; 00038 00039 /** instantiate system 00040 * @param config_file .xml file with system definition 00041 * @param argc pass in argc argv for optional command line initialization set zero if not required 00042 * @param argv optional command line argv array 00043 */ 00044 STATUS_OK RtSetup( 00045 const char* config_file, int argc, const char* argv[]); 00046 00047 /** arm the capture 00048 * @param ao_values initial ao values 00049 * @param do_values initial do_values 00050 */ 00051 STATUS_OK RtArm( 00052 const short* ao_values, 00053 const unsigned* do_values); 00054 00055 /** set next outputs, wait for and return next sample 00056 * @param ao_values next ao_values 00057 * @param do_values next do_values 00058 * @param ai_values latest ai sample 00059 * @param di_values latest di sample 00060 * @param status_values latest status values 00061 */ 00062 STATUS_OK RtIO( 00063 const short* ao_values, 00064 const unsigned* do_values, 00065 short* ai_values, 00066 unsigned* di_values, 00067 unsigned* status_values); 00068 00069 /** stop and cleanup. */ 00070 STATUS_OK RtDone(void); 00071 00072 #ifdef __cplusplus 00073 } /* closing brace for extern "C" */ 00074 #endif 00075 00076 /** status offsets<br> 00077 * [ 0] contents of MAIL BOX 0 */ 00078 #define LLC_SYNC2V_IN_MBOX0 LLCV2_STATUS_MBOX0 00079 /** [ 1] contents of MAIL BOX 1 */ 00080 #define LLC_SYNC2V_IN_MBOX1 LLCV2_STATUS_MBOX1 00081 /** [ 2] contents of MAIL BOX 2 */ 00082 #define LLC_SYNC2V_IN_MBOX2 LLCV2_STATUS_MBOX2 00083 /** [ 3] contents of MAIL BOX 3 */ 00084 #define LLC_SYNC2V_IN_MBOX3 LLCV2_STATUS_MBOX3 00085 /** [ 4] DIO6 value */ 00086 #define LLC_SYNC2V_IN_DIO6 LLCV2_STATUS_DIO 00087 /** [ 5] Garbage for SYNC2V*/ 00088 #define LLC_SYNC2V_IN_TINST LLCV2_STATUS_TINST 00089 /** [ 6] HW TLATCH 11:0 */ 00090 #define LLC_SYNC2V_IN_TLATCH LLCV2_STATUS_TLATCH 00091 /** [ 7] 0xdeadbeef */ 00092 #define LLC_SYNC2V_IN_BDR LLCV2_STATUS_BDR 00093 /** [ 8] Iteration */ 00094 #define LLC_SYNC2V_IN_ITER (LLCV2_STATUS_BDR+1) 00095 /** [ 9] DI32 values */ 00096 #define LLC_SYNC2V_IN_DI32 (LLCV2_STATUS_BDR+2) 00097 /** [10] ITER last error */ 00098 #define LLC_SYNC2V_IN_LASTE (LLCV2_STATUS_BDR+3) 00099 /** [11] SW TLATCH 31:0 [OPT] lags one cycle */ 00100 #define LLC_SYNC2V_IN_TLAT32 (LLCV2_STATUS_BDR+4) 00101 /** [12] Version ID */ 00102 #define LLC_SYNC2V_IN_VERID (LLCV2_STATUS_BDR+5) 00103 /** [13] Sample Count */ 00104 #define LLC_SYNC2V_IN_SCOUNT (LLCV2_STATUS_BDR+6) 00105 /** [14] FIFSTAT fifo status register */ 00106 #define LLC_SYNC2V_IN_FIFSTA (LLCV2_STATUS_BDR+7) 00107 /** [15] Last DO64 outval */ 00108 #define LLC_SYNC2V_IN_DO64 (LLCV2_STATUS_BDR+8) 00109 #define LLC_SYNC2V_IN_LAST (LLCV2_STATUS_MBOX0+15) /* [15] */ 00110 #define LLC_SYNC2V_IDLE_PAT 0x2f2fc0de /* fills remainder */ 00111 00112 00113 #endif /* LLC2_API_H_ */