1COMEDI_SET_CLOCK_SOU(3) Comedi reference COMEDI_SET_CLOCK_SOU(3)
2
3
4
6 comedi_set_clock_source - set master clock for a subdevice
7
9 #include <comedilib.h>
10
11 int comedi_set_clock_source(comedi_t * device, unsigned int subdevice,
12 unsigned int channel, unsigned int clock,
13 unsigned int period_ns);
14
16 alpha
17
19 This function selects a master clock for a subdevice. The clock
20 parameter selects the master clock, and is driver-dependant. If the
21 subdevice does not support configuring its master clocks on a
22 per-channel basis, then the channel parameter will be ignored. The
23 period_ns parameter specifies the clock's period in nanoseconds. It may
24 left unspecified by using a value of zero. Drivers will ignore the
25 clock period if they already know what the clock period should be for
26 the specified clock (e.g. for an on-board 20MHz oscillator). Certain
27 boards which use a phase-locked loop to synchronize to external clock
28 sources must be told the period of the external clock. Specifying a
29 clock period for an external clock may also allow the driver to support
30 TRIG_TIMER sources in commands while using the external clock.
31
32 The clock may be queried with the comedi_get_clock_source function.
33
34 This function is only useable on subdevices that provide support for
35 the INSN_CONFIG_SET_CLOCK_SRC configuration instruction.
36
38 0 on success, -1 on error.
39
41 David Schleef <ds@schleef.org>
42 Author.
43
44 Frank Mori Hess <fmhess@users.sourceforge.net>
45 Author.
46
47 Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
48 Author.
49
50 Bernd Porr <tech@linux-usb-daq.co.uk>
51 Author.
52
53 Ian Abbott <abbotti@mev.co.uk>
54 Author.
55
56 Éric Piel <piel@delmic.com>
57 Author.
58
60 Copyright © 1998-2003 David Schleef
61 Copyright © 2001-2003, 2005, 2008 Frank Mori Hess
62 Copyright © 2002-2003 Herman Bruyninckx
63 Copyright © 2012 Bernd Porr
64 Copyright © 2012 Ian Abbott
65 Copyright © 2012, 2015 Éric Piel
66
67 This document is part of Comedilib. In the context of this document,
68 the term "source code" as defined by the license is interpreted as the
69 XML source.
70
71 This library is free software; you can redistribute it and/or modify it
72 under the terms of the GNU Lesser General Public License as published
73 by the Free Software Foundation, version 2.1 of the License.
74
75 This library is distributed in the hope that it will be useful, but
76 WITHOUT ANY WARRANTY; without even the implied warranty of
77 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
78 General Public License for more details.
79
80 You should have received a copy of the GNU Lesser General Public
81 License along with this library; if not, write to the Free Software
82 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
83 USA.
84
85
86
87
88Comedi 05/11/2017 COMEDI_SET_CLOCK_SOU(3)