This file is indexed.

/usr/include/gpiv/gpiv-trig.h is in libgpiv3-dev 0.6.1-3build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */

/*-----------------------------------------------------------------------------
   libgpiv - library for Particle Image Velocimetry

   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Gerber van der Graaf
   <gerber_graaf@users.sourceforge.net>

   This file is part of libgpiv.

   Libgpiv is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  




-------------------------------------------------------------------------------
LIBRARY:                libgpiv
EXTERNAL FUNCTIONS:
                        gpiv_trig_openrtfs
                        gpiv_trig_default_parameters
                        gpiv_trig_read_parameters
                        gpiv_trig_check_parameters_read
                        gpiv_trig_parameters_set
                        gpiv_trig_test_parameter
                        gpiv_trig_fprint_parameters

LAST MODIFICATION DATE:  $Id: gpiv-trig.h,v 1.2 2008-04-09 06:10:28 gerber Exp $
---------------------------------------------------------------------------- */

/*!
\file                   gpiv-trig.h
\brief                  module for triggering lightsource(s) and camera(s) using RTAI

SOURCES:                lib/trig.c, lib/trig_par.c

LAST MODIFICATION DATE:  $Id: gpiv-trig.h,v 1.2 2008-04-09 06:10:28 gerber Exp $
 */
#ifndef __LIBGPIV_TRIG_H__
#define __LIBGPIV_TRIG_H__



/* #include <rtai.h> */
/* #include <fcntl.h> */

/*
 * Default values and keys of GpivTrigPar
 */
#define GPIV_TRIGPAR_DEFAULT__CAP 250    /**< Default parameter for cam_acq_period of __GpivTrigTime */
#define GPIV_TRIGPAR_DEFAULT__LPW 0.02   /**< Default parameter for laser_trig_pw of __GpivTrigTime */
#define GPIV_TRIGPAR_DEFAULT__T2L 0.19   /**< Default parameter for time2laser of __GpivTrigTime */
#define GPIV_TRIGPAR_DEFAULT__DT 10      /**< Default parameter for dt of __GpivTrigTime */
#define GPIV_TRIGPAR_DEFAULT__MODE 2     /**< Default parameter for mode of __GpivTrigTime */
#define GPIV_TRIGPAR_DEFAULT__CYCLES 1   /**< Default parameter for cycles of __GpivTrigTime */
#define GPIV_TRIGPAR_DEFAULT__INCR_DT 1  /**< Default parameter for increment of __GpivTrigTime */

#define GPIV_TRIGPAR_KEY "TRIG"	/**< Key of trigger parameters */
#define GPIV_TRIGPAR_KEY__CAP "Ttime_cap"    /**< Key for cam_acq_period of __GpivTrigTime */
#define GPIV_TRIGPAR_KEY__LPW "Ttime_lpw"   /**< Key for laser_trig_pw of __GpivTrigTime */
#define GPIV_TRIGPAR_KEY__T2L "Ttime_t2l"  /**< Key for time2laser of __GpivTrigTime */
#define GPIV_TRIGPAR_KEY__DT "Ttime_dt"    /**< Key for dt of __GpivTrigTime */
#define GPIV_TRIGPAR_KEY__MODE "Ttime_mode"     /**< Key for mode of __GpivTrigTime */
#define GPIV_TRIGPAR_KEY__CYCLES "Ttime_cycles"   /**< Key for cycles of __GpivTrigTime */
#define GPIV_TRIGPAR_KEY__INCR_DT "Ttime_incr_dt"  /**< Key for increment of __GpivTrigTime */

#define GPIV_TRIGPAR_CAP_MIN 100         /**< Minimum value for cam_acq_period of __GpivTrigTime */
#define GPIV_TRIGPAR_LPW_MIN 0.02        /**< Minimum value for  laser_trig_pw of __GpivTrigTime */
#define GPIV_TRIGPAR_T2L_MIN 0.19        /**< Minimum value for  time2laser of __GpivTrigTime */
#define GPIV_TRIGPAR_DT_MIN 0.10         /**< Minimum value for  dt of __GpivTrigTime */
#define GPIV_TRIGPAR_MODE_MIN 1          /**< Minimum value for  mode of __GpivTrigTime */
#define GPIV_TRIGPAR_CYCLES_MIN 1        /**< Minimum value for  cycles of __GpivTrigTime */
#define GPIV_TRIGPAR_INCR_DT_MIN 0.01    /**< Minimum value for  increment of __GpivTrigTime */

#define GPIV_TRIGPAR_CAP_MAX 1000         /**< Maximum value for cam_acq_period of __GpivTrigTime */
#define GPIV_TRIGPAR_LPW_MAX 0.02         /**< Maximum value for  laser_trig_pw of __GpivTrigTime */
#define GPIV_TRIGPAR_T2L_MAX 0.19         /**< Maximum value for  time2laser of __GpivTrigTime */
#define GPIV_TRIGPAR_DT_MAX 100           /**< Maximum value for  dt of __GpivTrigTime */
#define GPIV_TRIGPAR_MODE_MAX 6           /**< Maximum value for  mode of __GpivTrigTime */
#define GPIV_TRIGPAR_CYCLES_MAX 1         /**< Maximum value for  cycles of __GpivTrigTime */
#define GPIV_TRIGPAR_INCR_DT_MAX 20       /**< Maximum value for  increment of __GpivTrigTime */

#define GPIV_NANO2MILI 0.001 * 0.001            /**< Constant to convert from nano ro milliseconds */
#define GPIV_MILI2NANO 1000 * 1000              /**< Constant to convert from milli to nanseconds */



/**
 * Fifo values
 */
enum GpivFifo {
    GPIV_FIFO_TIMING_PARAMETER = 1,
    GPIV_FIFO_START_COMMAND,
    GPIV_FIFO_STOP_COMMAND,
    GPIV_FIFO_ERROR,
    GPIV_FIFO_JITTER,
};

/**
 * Operating mode
 */
enum GpivTimingMode {
    GPIV_TIMER_MODE__PERIODIC = 1, /**< Indefinite until interrupted */
    GPIV_TIMER_MODE__DURATION,     /**< During specific amount of cycles */
    GPIV_TIMER_MODE__ONE_SHOT_IRQ, /**< Check. Single shot after irq signal */
    GPIV_TIMER_MODE__TRIGGER_IRQ,  /**< Check. Trigger on irq signal */
    GPIV_TIMER_MODE__INCREMENT,    /**< Incremented __GpivTrigTime::dt */
    GPIV_TIMER_MODE__DOUBLE,       /**< Check. Double exposure */
};
/*     GPIV_TIMER_MODE__SNAPSHOT, */
/*     GPIV_TIMER_MODE__EXIT, */



typedef struct __GpivTrigTime GpivTrigTime;

/*!
 * \brief Trigger parameters
 *
 * Used for triggering camera and light source (mostly a double-cavity Nd/YAGG laser)
 * and defining separation time between the frames of a PIV image pair etc. 
 * The parameters might be loaded from the configuration resources, 
 * with gpiv_scan_resourcefiles() or with gpiv_scan_parameter().
 */
struct __GpivTrigTime {
    RTIME cam_acq_period;       /**< camera acquisition period time in ns (period) */
    RTIME laser_trig_pw;        /**< laser trigger pulse width in ns (tp) */
    RTIME time2laser;           /**< time from laser trigger->Hi (tl) until laser pulse: 0.19 ms in ns */
    RTIME dt;                   /**< time between 2 laser exposures in ns */
    enum GpivTimingMode mode;   /**< operating mode (indefinite/interrupt/definite) */
    gint cycles;                /**< number of cycles, equal to the number of image pairs to be recorded */
    RTIME increment;            /**< increment in dt (ms) */
};
  

  
typedef struct __GpivTrigPar GpivTrigPar;

/*!
 * \brief Whether elements of __GpivTrigTime have been set
 *
 * These boolean parameters are set when parameters of  __GpivTrigTime have been
 * defined. Only for __GpivTrigTime, the __set parameters have been 
 * defined in a separate structure in this library.
 */
struct __GpivTrigPar {
    GpivTrigTime ttime; 

    gboolean ttime__cam_acq_period__set; /**< flag if cam_acq_period has been defined */
    gboolean ttime__laser_trig_pw__set;  /**< flag if laser_trig_pw has been defined */
    gboolean ttime__time2laser__set;     /**< flag if time2laser has been defined */
    gboolean ttime__dt__set;             /**< flag if dt has been defined */
    gboolean ttime__mode__set;           /**< flag if mode has been defined */
    gboolean ttime__cycles__set;         /**< flag if cycles has been defined */
    gboolean ttime__increment__set;      /**< flag if increment has been defined */
};



/**
 *      Opens communication channels to camlasco-rtl kernel module.
 *
 *      @param[in] init         initialization or uploading of trigger parameters
 *      @param[in] trig         trigger signel
 *      @param[in] stop         stop signal
 *      @param[in] error        error signal
 *      @return                 void
 */
gint 
gpiv_trig_openrtfs			(gint			*init, 
					gint			*trig, 
					gint			*stop, 
					gint			*error
					);



/**
 *      Sets default GpivTrigPar parameter values.
 *
 *      @param[in] force                flag to enforce parameters set to defaults
 *      @param[out] trig_par_default    structure of triggering parameters
 *      @return                         void
 */
void
gpiv_trig_default_parameters		(GpivTrigPar		*trig_par_default,
					const gboolean		force
					);



/**
 *      Read all GpivTrigPar parameters.
 *
 *      @param[in] fp_par       file pointer to parameter file
 *      @param[out] trig_par    triggering parameters
 *      @param[in] verbose      flag to print parametrs to stdout
 *      @return                 void
 */
void 
gpiv_trig_read_parameters		(FILE			*fp_par, 
					GpivTrigPar		*trig_par, 
					const gboolean		verbose
					);



/**
 *      Check out if all GpivTrigPar parameters have been read.
 *
 *      @param[in] trig_par_default     default trigger parameters. If NULL, library default
 *                                      values are used.
 *      @param[out] trig_par            trigger parameters
 *      @return                         NULL on success or *err_msg on failure
 */
gchar *
gpiv_trig_check_parameters_read		(GpivTrigPar		*trig_par,
					const GpivTrigPar	*trig_par_default
					);



/**
 *      Sets flags for __set variables of GpivTrigPar.
 *
 *      @param[in] flag         flag to be set 
 *      @param[out] trig_par    triggering parameters
 *      @return                 void
 */
void
gpiv_trig_parameters_set		(GpivTrigPar		*trig_par,
					const gboolean		flag
					);



/**
 *      Testing GpivTrigPar parameters on valid values.
 *
 *      @param[in]  trig_par    trigger parameters   
 *      @param[out] trig_par    trigger parameters
 *      @return                 NULL on success or *err_msg on failure
 */ 
gchar *
gpiv_trig_test_parameter		(const GpivTrigPar	*trig_par
					);



/**
 *      Prints GpivTrigPar parameters to fp_par_out.
 *
 *      @param[in] fp_par_out   output file
 *      @param[in] trig_par     triggering parameters
 *      @return                 void
 */
void 
gpiv_trig_print_parameters		(FILE			*fp_par_out, 
					const GpivTrigPar *trig_par
					);

#endif /*__LIBGPIV_TRIG_H__ */