Main Page | Files | Data Structures | Functions | Global Variables |

gpiv-trig.h

Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
00002 
00003 /*-----------------------------------------------------------------------------
00004    libgpiv - library for Particle Image Velocimetry
00005 
00006    Copyright (C) 2002, 2003, 2004, 2005
00007    Gerber van der Graaf <gerber_graaf@users.sourceforge.net>
00008 
00009    This file is part of libgpiv.
00010 
00011    Libgpiv is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; either version 2, or (at your option)
00014    any later version.
00015 
00016    This program is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019    GNU General Public License for more details.
00020 
00021    You should have received a copy of the GNU General Public License
00022    along with this program; if not, write to the Free Software Foundation,
00023    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
00024 
00025 
00026 
00027 
00028 -------------------------------------------------------------------------------
00029 LIBRARY:                libgpiv
00030 EXTERNAL FUNCTIONS:
00031                         gpiv_trig_openrtfs
00032                         gpiv_trig_default_parameters
00033                         gpiv_trig_read_parameters
00034                         gpiv_trig_check_parameters_read
00035                         gpiv_trig_parameters_set
00036                         gpiv_trig_test_parameter
00037                         gpiv_trig_fprint_parameters
00038 
00039 LAST MODIFICATION DATE:  $Id: trig.h,v 1.3 2007-06-06 16:59:02 gerber Exp $
00040 ---------------------------------------------------------------------------- */
00041 
00050 #ifndef __LIBGPIV_TRIG_H__
00051 #define __LIBGPIV_TRIG_H__
00052 
00053 
00054 
00055 /* #include <rtai.h> */
00056 /* #include <fcntl.h> */
00057 
00058 /*
00059  * Default values and keys of GpivTrigPar
00060  */
00061 #define GPIV_TRIGPAR_DEFAULT__CAP 250    
00062 #define GPIV_TRIGPAR_DEFAULT__LPW 0.02   
00063 #define GPIV_TRIGPAR_DEFAULT__T2L 0.19   
00064 #define GPIV_TRIGPAR_DEFAULT__DT 10      
00065 #define GPIV_TRIGPAR_DEFAULT__MODE 2     
00066 #define GPIV_TRIGPAR_DEFAULT__CYCLES 1   
00067 #define GPIV_TRIGPAR_DEFAULT__INCR_DT 1  
00069 #define GPIV_TRIGPAR_KEY "TRIG" 
00070 #define GPIV_TRIGPAR_KEY__CAP "Ttime_cap"    
00071 #define GPIV_TRIGPAR_KEY__LPW "Ttime_lpw"   
00072 #define GPIV_TRIGPAR_KEY__T2L "Ttime_t2l"  
00073 #define GPIV_TRIGPAR_KEY__DT "Ttime_dt"    
00074 #define GPIV_TRIGPAR_KEY__MODE "Ttime_mode"     
00075 #define GPIV_TRIGPAR_KEY__CYCLES "Ttime_cycles"   
00076 #define GPIV_TRIGPAR_KEY__INCR_DT "Ttime_incr_dt"  
00078 #define GPIV_TRIGPAR_CAP_MIN 100         
00079 #define GPIV_TRIGPAR_LPW_MIN 0.02        
00080 #define GPIV_TRIGPAR_T2L_MIN 0.19        
00081 #define GPIV_TRIGPAR_DT_MIN 0.10         
00082 #define GPIV_TRIGPAR_MODE_MIN 1          
00083 #define GPIV_TRIGPAR_CYCLES_MIN 1        
00084 #define GPIV_TRIGPAR_INCR_DT_MIN 0.01    
00086 #define GPIV_TRIGPAR_CAP_MAX 1000         
00087 #define GPIV_TRIGPAR_LPW_MAX 0.02         
00088 #define GPIV_TRIGPAR_T2L_MAX 0.19         
00089 #define GPIV_TRIGPAR_DT_MAX 100           
00090 #define GPIV_TRIGPAR_MODE_MAX 6           
00091 #define GPIV_TRIGPAR_CYCLES_MAX 1         
00092 #define GPIV_TRIGPAR_INCR_DT_MAX 20       
00094 #define GPIV_NANO2MILI 0.001 * 0.001            
00095 #define GPIV_MILI2NANO 1000 * 1000              
00102 enum GpivFifo {
00103     GPIV_FIFO_TIMING_PARAMETER = 1,
00104     GPIV_FIFO_START_COMMAND,
00105     GPIV_FIFO_STOP_COMMAND,
00106     GPIV_FIFO_ERROR,
00107     GPIV_FIFO_JITTER,
00108 };
00109 
00113 enum GpivTimingMode {
00114     GPIV_TIMER_MODE__PERIODIC = 1, 
00115     GPIV_TIMER_MODE__DURATION,     
00116     GPIV_TIMER_MODE__ONE_SHOT_IRQ, 
00117     GPIV_TIMER_MODE__TRIGGER_IRQ,  
00118     GPIV_TIMER_MODE__INCREMENT,    
00119     GPIV_TIMER_MODE__DOUBLE,       
00120 };
00121 /*     GPIV_TIMER_MODE__SNAPSHOT, */
00122 /*     GPIV_TIMER_MODE__EXIT, */
00123 
00124 
00125 
00126 typedef struct __GpivTrigTime GpivTrigTime;
00127 
00136 struct __GpivTrigTime {
00137     RTIME cam_acq_period;       
00138     RTIME laser_trig_pw;        
00139     RTIME time2laser;           
00140     RTIME dt;                   
00141     enum GpivTimingMode mode;   
00142     gint cycles;                
00143     RTIME increment;            
00144 };
00145   
00146 
00147   
00148 typedef struct __GpivTrigPar GpivTrigPar;
00149 
00157 struct __GpivTrigPar {
00158     GpivTrigTime ttime; 
00159 
00160     gboolean ttime__cam_acq_period__set; 
00161     gboolean ttime__laser_trig_pw__set;  
00162     gboolean ttime__time2laser__set;     
00163     gboolean ttime__dt__set;             
00164     gboolean ttime__mode__set;           
00165     gboolean ttime__cycles__set;         
00166     gboolean ttime__increment__set;      
00167 };
00168 
00169 
00170 
00180 gint 
00181 gpiv_trig_openrtfs                      (gint                   *init, 
00182                                         gint                    *trig, 
00183                                         gint                    *stop, 
00184                                         gint                    *error
00185                                         );
00186 
00187 
00188 
00196 void
00197 gpiv_trig_default_parameters            (GpivTrigPar            *trig_par_default,
00198                                         const gboolean          force
00199                                         );
00200 
00201 
00202 
00211 void 
00212 gpiv_trig_read_parameters               (FILE                   *fp_par, 
00213                                         GpivTrigPar             *trig_par, 
00214                                         const gboolean          verbose
00215                                         );
00216 
00217 
00218 
00226 gchar *
00227 gpiv_trig_check_parameters_read         (GpivTrigPar            *trig_par,
00228                                         const GpivTrigPar       *trig_par_default
00229                                         );
00230 
00231 
00232 
00240 void
00241 gpiv_trig_parameters_set                (GpivTrigPar            *trig_par,
00242                                         const gboolean          flag
00243                                         );
00244 
00245 
00246 
00254 gchar *
00255 gpiv_trig_test_parameter                (const GpivTrigPar      *trig_par
00256                                         );
00257 
00258 
00259 
00267 void 
00268 gpiv_trig_print_parameters              (FILE                   *fp_par_out, 
00269                                         const GpivTrigPar *trig_par
00270                                         );
00271 
00272 #endif /*__LIBGPIV_TRIG_H__ */

Generated on Tue Nov 20 19:46:20 2007 for Libgpiv by doxygen 1.5.1