Merge ../libgpiv-omp into fft-omp
[libgpiv.git] / lib / trig.c
blob5a51e9a8fb6c8e08257665fc38b4f23c2598dd52
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
4 /*
5 libgpiv - library for Particle Image Velocimetry
7 Copyright (C) 2004, 2005, 2006, 2007, 2008
8 Gerber van der Graaf <gerber_graaf@users.sourceforge.net>
9 Julio Soria <julio.soria@eng.monash.edu.au>
11 This file is part of libgpiv.
13 Libgpiv is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2, or (at your option)
16 any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 ------------------------------------------------------------------------------
30 FILENAME: trig.c
31 LIBRARY: libgpiv
32 EXTERNAL FUNCTIONS:
33 gpiv_trig_openrtfs
36 LAST MODIFICATION DATE: $Id: trig.c,v 1.2 2007-11-23 16:16:15 gerber Exp $
37 --------------------------------------------------------------------------- */
40 #ifdef ENABLE_TRIG
41 #include "gpiv.h"
45 gint
46 gpiv_trig_openrtfs (gint *init,
47 gint *trig,
48 gint *stop,
49 gint *error
51 /*-----------------------------------------------------------------------------
52 * DESCRIPTION:
53 * Opens communication channels to camlasco-rtl kernel module
55 * INPUTS:
56 * init: initialization or uploading of trigger parameters
57 * trig: ?
58 * stop: stop signal
59 * error: error signal
61 * OUTPUTS:
62 * piv_trig_par_default: structure of data aquisition parameters
64 * RETURNS:
65 *---------------------------------------------------------------------------*/
67 gint ok = 0;
69 if((*init = open("/dev/rtf/1", O_WRONLY )) < 0) {
70 printf("fail in \"init\" FIFO open\n");
71 return ok;
74 if((*trig = open("/dev/rtf/2", O_WRONLY )) < 0) {
75 printf("fail in \"trig\" FIFO open\n");
76 return ok;
79 if((*stop = open("/dev/rtf/3", O_WRONLY )) < 0) {
80 printf("fail in \"stop\" FIFO open\n");
81 return ok;
84 if((*error = open("/dev/rtf/4", O_RDONLY )) < 0) {
85 printf("fail in \"error\" FIFO open\n");
86 return ok;
89 ok = 1;
90 return ok;
95 #endif /* ENABLE_TRIG */