COMEDI_GET_CLOCK_SOU(3)
π comedi_get_clock_source β get the master clock for a subdevice π
okay bestie, welcome to the Comedi reference page for comedi_get_clock_source(3) β¨ (yes, the manual is literally named COMEDI_GET_CLOCK_SOU(3), the terminal just cuts it off, it's giving ctrl-c on the title ngl). Sit down, grab a boba π§, and let's find out what clock your subdevice is running on ππ
β¨ NAME β¨
comedi_get_clock_source β get the master clock for a subdevice
π¦ SYNOPSIS π¦
#include <comedilib.h>
int comedi_get_clock_source(comedi_t * device, unsigned int subdevice,
unsigned int channel, unsigned int * clock,
unsigned int * period_ns);
π STATUS π
alpha πΌ β yeah she's still in her alpha era, handle with care-ish, but we love her anyway.
πΈ DESCRIPTION πΈ
So basically πββοΈ this function goes and queries the master clock for a subdevice β aka the clock that comedi_set_clock_source already set up earlier. Think of it like asking your subdevice "hey girl, what time is it for you?" π΅οΈββοΈ
The master clock that's currently configured gets written to *clock βοΈ. And here's the tea: the possible values and what clock each one actually corresponds to are driver-dependant β so it depends on which driver you're running, no cap π«π§’.
The period of the clock, in nanoseconds, gets written to *period_ns. If that period is unknown, you just get a literal zero 0 in there, and honestly? relatable, sometimes we don't know our own period either ππ©Έ
Now, if your subdevice doesn't support configuring its master clocks on a per-channel basis, then the channel parameter just gets ignored. It's giving "I don't see you" energy π β not personal, it's just how the hardware is set up.
It is safe to pass NULL pointers as the clock or period_ns parameters π«Ά β so if you only care about one of them, go off, pass NULL for the other, she won't crash.
β οΈ important vibe check: this function is only useable on subdevices that provide support for the INSN_CONFIG_GET_CLOCK_SRC configuration instruction. If your subdevice doesn't do that, it's not happening bestie π
π RETURN VALUE π
0β on success π slay, you got your clock-1β on error π something went wrong
π AUTHORS π
The iconic legends who made this happen, we stan π«Ά:
- David Schleef
<ds@schleef.org>β Author. π - Frank Mori Hess
<fmhess@users.sourceforge.net>β Author. π - Herman Bruyninckx
<Herman.Bruyninckx@mech.kuleuven.ac.be>β Author. π - Bernd Porr
<tech@linux-usb-daq.co.uk>β Author. π - Ian Abbott
<abbotti@mev.co.uk>β Author. π - Γric Piel
<piel@delmic.com>β Author. π
π COPYRIGHT π
Copyright Β© 1998-2003 David Schleef Copyright Β© 2001-2003, 2005, 2008 Frank Mori Hess Copyright Β© 2002-2003 Herman Bruyninckx Copyright Β© 2012 Bernd Porr Copyright Β© 2012 Ian Abbott Copyright Β© 2012, 2015 Γric Piel
This document is part of Comedilib π. And quick side note for the legal girlies: in the context of this document, the term "source code" as defined by the license is interpreted as the XML source ποΈβ¨
This library is free software β you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License π
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY β like, literally none. Not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE π. See the GNU Lesser General Public License for more details, bestie, please read it fr fr π
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA π¬π«Ά
aaaaand that's the whole page! π
This was Comedi, dated 03/20/2026, for the manual page COMEDI_GET_CLOCK_SOU(3) β go get those clocks, main character ππβ¨ bye bestie, ily, gn ππ¦
π¦ where this page comes from
- ubuntu resolute: libcomedi-dev 0.11.0+5-1.3build6 Β· LGPL-2.1-only
- ubuntu stonking: libcomedi-dev 0.11.0+5-1.3build6 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms