'\" t .\" Title: comedi_apply_calibration .\" Author: David Schleef .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/30/2018 .\" Manual: Comedi reference .\" Source: Comedi .\" Language: English .\" .TH "COMEDI_APPLY_CALIBRA" "3" "12/30/2018" "Comedi" "Comedi reference" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" comedi_apply_calibration \- set hardware calibration from file .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ comedi_apply_calibration('u .BI "int comedi_apply_calibration(comedi_t\ *\ " "device" ", unsigned\ int\ " "subdevice" ", unsigned\ int\ " "channel" ", unsigned\ int\ " "range" ", unsigned\ int\ " "aref" ", const\ char\ *\ " "file_path" ");" .SH "STATUS" .PP alpha .SH "DESCRIPTION" .PP The function \fBcomedi_apply_calibration\fR sets the hardware calibration for the subdevice specified by \fIdevice\fR and \fIsubdevice\fR so that it is in proper calibration when using the channel specified by \fIchannel\fR, range index specified by \fIrange\fR and analog reference specified by \fIaref\fR\&. It does so by performing writes to the appropriate channels of the board\*(Aqs calibration subdevice(s)\&. Depending on the hardware, the calibration settings used may or may not depend on the channel, range, or analog reference\&. Furthermore, the calibrations appropriate for different channel, range, and analog reference parameters may not be able to be applied simultaneously\&. For example, some boards cannot have their analog inputs calibrated for more than one input range simultaneously\&. Applying a calibration for range 1 may blow away a previously applied calibration for range 0\&. Or, applying a calibration for analog input channel 0 may cause the same calibration to be applied to all the other analog input channels as well\&. Your only guarantee is that calls to \fBcomedi_apply_calibration\fR on different subdevices will not interfere with each other\&. .PP In practice, their are some rules of thumb on how calibrations behave\&. No calibrations depend on the analog reference\&. A multiplexed analog input will have calibration settings that do not depend on the channel, and applying a setting for one channel will affect all channels equally\&. Analog outputs, and analog inputs with independent a/d converters for each input channel, will have calibration settings which do depend on the channel, and the settings for each channel will be independent of the other channels\&. .PP If you wish to investigate exactly what \fBcomedi_apply_calibration\fR is doing, you can perform reads on your board\*(Aqs calibration subdevice to see which calibration channels it is changing\&. You can also try to decipher the calibration file directly (it\*(Aqs a text file)\&. .PP The \fIfile_path\fR parameter can be used to specify the file which contains the calibration information\&. If \fIfile_path\fR is \fBNULL\fR, then Comedilib will use a default file location\&. The calibration information used by this function is generated by the \fBcomedi_calibrate\fR program (see its man page)\&. .PP The functions \fBcomedi_parse_calibration_file\fR, \fBcomedi_apply_parsed_calibration\fR, and \fBcomedi_cleanup_calibration\fR provide the same functionality at a slightly lower level\&. .SH "RETURN VALUE" .PP Returns 0 on success, \-1 on failure\&. .PP .SH "AUTHORS" .PP \fBDavid Schleef\fR <\&ds@schleef.org\&> .RS 4 Author. .RE .PP \fBFrank Mori Hess\fR <\&fmhess@users.sourceforge.net\&> .RS 4 Author. .RE .PP \fBHerman Bruyninckx\fR <\&Herman.Bruyninckx@mech.kuleuven.ac.be\&> .RS 4 Author. .RE .PP \fBBernd Porr\fR <\&tech@linux-usb-daq.co.uk\&> .RS 4 Author. .RE .PP \fBIan Abbott\fR <\&abbotti@mev.co.uk\&> .RS 4 Author. .RE .PP \fB\('Eric Piel\fR <\&piel@delmic.com\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 1998-2003 David Schleef .br Copyright \(co 2001-2003, 2005, 2008 Frank Mori Hess .br Copyright \(co 2002-2003 Herman Bruyninckx .br Copyright \(co 2012 Bernd Porr .br Copyright \(co 2012 Ian Abbott .br Copyright \(co 2012, 2015 \('Eric Piel .br .PP This document is part of Comedilib. In the context of this document, the term "source code" as defined by the license is interpreted as the XML source. .PP 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. .PP 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. .PP 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. .sp