COMEDI_GET_SOFTCAL_C(3)
π COMEDI_GET_SOFTCAL_CONVERTER π
okay so bestie, welcome to the Comedi reference, section 3 β this is COMEDI_GET_SOFTCAL_C(3) and it's literally all about comedi_get_softcal_converter, aka "get converter for software-calibrated subdevice" π
get converter for software-calibrated subdevice β that's the whole vibe. one function, one job, slay.
β¨ SYNOPSIS β¨
#include <comedilib.h>
int comedi_get_softcal_converter(unsigned subdevice, unsigned channel,
unsigned range,
enum comedi_conversion_direction direction,
const comedi_calibration_t * parsed_calibration,
comedi_polynomial_t * converter);
like, that's the whole signature. copy it exactly, don't be doing freestyle edits bestie π
πΈ STATUS πΈ
alpha
yep. it said what it said. alpha energy. it's giving "still cooking" π
π DESCRIPTION π
okay so what comedi_get_softcal_converter does is it initializes the comedi_polynomial_t that converter points at, so that pointer can get passed along to either comedi_to_physical or comedi_from_physical. π«Ά
once it's set up, that comedi_polynomial_t (the one converter points to, in case you lost track) can be used to convert data for the subdevice, channel, and range you specified. β¨
the direction parameter is literally telling the function whether converter is gonna be handed to comedi_to_physical or to comedi_from_physical. that's its whole personality. π
the parsed_calibration parameter points at the software calibration values for your device β and you can get those by calling comedi_parse_calibration_file on a calibration file that the comedi_soft_calibrate program generated. no cap, that's the pipeline. π
heads up: this function is only useful for boards that do their calibrations in software, on the host computer. like, if your board handles its own calibration, this ain't for you babes.
a subdevice will advertise that it depends on a software calibration using the SDF_SOFT_CALIBRATED subdevice flag. that's your green flag π’
now, whether the result of this function actually depends on the channel parameter at all? hardware dependent, bestie. for example, the calibration of a multiplexed analog input will typically not depend on the channel β only on the range. but analog outputs will typically use different calibrations for each output channel. so like, it varies. iykyk. π
software calibrations are implemented as polynomials (up to third order). and here's the tricky part: since the inverse of a polynomial of order higher than one can't be represented exactly as another polynomial, you may not be able to get converters for the "reverse" direction. π so for example, you may be able to get a converter for an analog input in the COMEDI_TO_PHYSICAL direction, but not in the COMEDI_FROM_PHYSICAL direction. math said no. π
β RETURN VALUE β
0on success π-1on failure π
π AUTHORS π
these are the icons who made it happen:
- 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.
periodt. π
π 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 in the context of this document, the term "source code" as defined by the license is interpreted as the XML source. π (yes, that's a real sentence, we keep it, no notes)
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; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU Lesser General Public License for more details. like fr fr, read the fine print.
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.
and that's the whole page bestie!! π¦πβ¨ this was the Comedi reference, dropped on 03/20/2026, filed under COMEDI_GET_SOFTCAL_C(3). go get those softcal converters, main character π
π
π¦ 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