Xenomai  3.1
Software calibration API
Collaboration diagram for Software calibration API:

Functions

int a4l_read_calibration_file (char *name, struct a4l_calibration_data *data)
 Read the analogy generated calibration file. More...
 
int a4l_get_softcal_converter (struct a4l_polynomial *converter, int subd, int chan, int range, struct a4l_calibration_data *data)
 Get the polynomial that will be use for the software calibration. More...
 
int a4l_rawtodcal (a4l_chinfo_t *chan, double *dst, void *src, int cnt, struct a4l_polynomial *converter)
 Convert raw data (from the driver) to calibrated double units. More...
 
int a4l_dcaltoraw (a4l_chinfo_t *chan, void *dst, double *src, int cnt, struct a4l_polynomial *converter)
 Convert double values to raw calibrated data using polynomials. More...
 

Detailed Description

Function Documentation

◆ a4l_dcaltoraw()

int a4l_dcaltoraw ( a4l_chinfo_t *  chan,
void *  dst,
double *  src,
int  cnt,
struct a4l_polynomial *  converter 
)

Convert double values to raw calibrated data using polynomials.

Parameters
[in]chanChannel descriptor
[out]dstOuput buffer
[in]srcInput buffer
[in]cntCount of conversion to perform
[in]converterConversion polynomial
Returns
the count of conversion performed, otherwise a negative error code:
  • -EINVAL is returned if some argument is missing or wrong; chan, rng and the pointers should be checked; check also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called before using a4l_dcaltoraw()

◆ a4l_get_softcal_converter()

int a4l_get_softcal_converter ( struct a4l_polynomial *  converter,
int  subd,
int  chan,
int  range,
struct a4l_calibration_data *  data 
)

Get the polynomial that will be use for the software calibration.

Parameters
[out]converterPolynomial to be used on the software calibration
[in]subdSubdevice index
[in]chanChannel
[in]rangeRange
[in]dataCalibration data read from the calibration file
Returns
-1 on error

◆ a4l_rawtodcal()

int a4l_rawtodcal ( a4l_chinfo_t *  chan,
double *  dst,
void *  src,
int  cnt,
struct a4l_polynomial *  converter 
)

Convert raw data (from the driver) to calibrated double units.

Parameters
[in]chanChannel descriptor
[out]dstOuput buffer
[in]srcInput buffer
[in]cntCount of conversion to perform
[in]converterConversion polynomial
Returns
the count of conversion performed, otherwise a negative error code:
  • -EINVAL is returned if some argument is missing or wrong; chan, rng and the pointers should be checked; check also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called before using a4l_rawtodcal()

◆ a4l_read_calibration_file()

int a4l_read_calibration_file ( char *  name,
struct a4l_calibration_data *  data 
)

Read the analogy generated calibration file.

Parameters
[in]nameName of the calibration file
[out]dataPointer to the calibration file contents