Xenomai API
2.6.5
|
Functions | |
int | a4l_sizeof_chan (a4l_chinfo_t *chan) |
Get the size in memory of an acquired element. More... | |
int | a4l_sizeof_subd (a4l_sbinfo_t *subd) |
Get the size in memory of a digital acquired element. More... | |
int | a4l_find_range (a4l_desc_t *dsc, unsigned int idx_subd, unsigned int idx_chan, unsigned long unit, double min, double max, a4l_rnginfo_t **rng) |
Find the must suitable range. More... | |
int | a4l_rawtoul (a4l_chinfo_t *chan, unsigned long *dst, void *src, int cnt) |
Unpack raw data (from the driver) into unsigned long values. More... | |
int | a4l_rawtof (a4l_chinfo_t *chan, a4l_rnginfo_t *rng, float *dst, void *src, int cnt) |
Convert raw data (from the driver) to float-typed samples. More... | |
int | a4l_rawtod (a4l_chinfo_t *chan, a4l_rnginfo_t *rng, double *dst, void *src, int cnt) |
Convert raw data (from the driver) to double-typed samples. More... | |
int | a4l_ultoraw (a4l_chinfo_t *chan, void *dst, unsigned long *src, int cnt) |
Pack unsigned long values into raw data (for the driver) More... | |
int | a4l_ftoraw (a4l_chinfo_t *chan, a4l_rnginfo_t *rng, void *dst, float *src, int cnt) |
Convert float-typed samples to raw data (for the driver) More... | |
int | a4l_dtoraw (a4l_chinfo_t *chan, a4l_rnginfo_t *rng, void *dst, double *src, int cnt) |
Convert double-typed samples to raw data (for the driver) More... | |
int a4l_dtoraw | ( | a4l_chinfo_t * | chan, |
a4l_rnginfo_t * | rng, | ||
void * | dst, | ||
double * | src, | ||
int | cnt | ||
) |
Convert double-typed samples to raw data (for the driver)
[in] | chan | Channel descriptor |
[in] | rng | Range descriptor |
[out] | dst | Ouput buffer |
[in] | src | Input buffer |
[in] | cnt | Count of conversion to perform |
References A4L_RNG_FACTOR, and a4l_sizeof_chan().
int a4l_find_range | ( | a4l_desc_t * | dsc, |
unsigned int | idx_subd, | ||
unsigned int | idx_chan, | ||
unsigned long | unit, | ||
double | min, | ||
double | max, | ||
a4l_rnginfo_t ** | rng | ||
) |
Find the must suitable range.
[in] | dsc | Device descriptor filled by a4l_open() and a4l_fill_desc() |
[in] | idx_subd | Index of the concerned subdevice |
[in] | idx_chan | Index of the concerned channel |
[in] | unit | Unit type used in the range |
[in] | min | Minimal limit value |
[in] | max | Maximal limit value |
[out] | rng | Found range |
References a4l_get_chinfo(), a4l_get_rnginfo(), A4L_RNG_FACTOR, A4L_RNG_UNIT, and a4l_descriptor::magic.
int a4l_ftoraw | ( | a4l_chinfo_t * | chan, |
a4l_rnginfo_t * | rng, | ||
void * | dst, | ||
float * | src, | ||
int | cnt | ||
) |
Convert float-typed samples to raw data (for the driver)
[in] | chan | Channel descriptor |
[in] | rng | Range descriptor |
[out] | dst | Ouput buffer |
[in] | src | Input buffer |
[in] | cnt | Count of conversion to perform |
References A4L_RNG_FACTOR, and a4l_sizeof_chan().
int a4l_rawtod | ( | a4l_chinfo_t * | chan, |
a4l_rnginfo_t * | rng, | ||
double * | dst, | ||
void * | src, | ||
int | cnt | ||
) |
Convert raw data (from the driver) to double-typed samples.
[in] | chan | Channel descriptor |
[in] | rng | Range descriptor |
[out] | dst | Ouput buffer |
[in] | src | Input buffer |
[in] | cnt | Count of conversion to perform |
References A4L_RNG_FACTOR, and a4l_sizeof_chan().
int a4l_rawtof | ( | a4l_chinfo_t * | chan, |
a4l_rnginfo_t * | rng, | ||
float * | dst, | ||
void * | src, | ||
int | cnt | ||
) |
Convert raw data (from the driver) to float-typed samples.
[in] | chan | Channel descriptor |
[in] | rng | Range descriptor |
[out] | dst | Ouput buffer |
[in] | src | Input buffer |
[in] | cnt | Count of conversion to perform |
References A4L_RNG_FACTOR, and a4l_sizeof_chan().
int a4l_rawtoul | ( | a4l_chinfo_t * | chan, |
unsigned long * | dst, | ||
void * | src, | ||
int | cnt | ||
) |
Unpack raw data (from the driver) into unsigned long values.
This function takes as input driver-specific data and scatters each element into an entry of an unsigned long table. It is a convenience routine which performs no conversion, just copy.
[in] | chan | Channel descriptor |
[in] | rng | Range descriptor |
[out] | dst | Ouput buffer |
[in] | src | Input buffer |
[in] | cnt | Count of transfer to copy |
References a4l_sizeof_chan().
int a4l_sizeof_chan | ( | a4l_chinfo_t * | chan | ) |
Get the size in memory of an acquired element.
According to the board, the channels have various acquisition widths. With values like 8, 16 or 32, there is no problem finding out the size in memory (1, 2, 4); however with widths like 12 or 24, this function might be helpful to guess the size needed in RAM for a single acquired element.
[in] | chan | Channel descriptor |
Referenced by a4l_dtoraw(), a4l_ftoraw(), a4l_rawtod(), a4l_rawtof(), a4l_rawtoul(), and a4l_ultoraw().
int a4l_sizeof_subd | ( | a4l_sbinfo_t * | subd | ) |
Get the size in memory of a digital acquired element.
This function is only useful for DIO subdevices. Digital subdevices are a specific kind of subdevice on which channels are regarded as bits composing the subdevice's bitfield. During a DIO acquisition, all bits are sampled. Therefore, a4l_sizeof_chan() is useless in this case and we have to use a4l_sizeof_subd(). With bitfields which sizes are 8, 16 or 32, there is no problem finding out the size in memory (1, 2, 4); however with widths like 12 or 24, this function might be helpful to guess the size needed in RAM for a single acquired element.
[in] | subd | Subdevice descriptor |
References A4L_SUBD_DI, A4L_SUBD_DIO, A4L_SUBD_DO, and A4L_SUBD_TYPES.
Referenced by a4l_sync_dio().
int a4l_ultoraw | ( | a4l_chinfo_t * | chan, |
void * | dst, | ||
unsigned long * | src, | ||
int | cnt | ||
) |
Pack unsigned long values into raw data (for the driver)
This function takes as input a table of unsigned long values and gather them according to the channel width. It is a convenience routine which performs no conversion, just formatting.
[in] | chan | Channel descriptor |
[in] | rng | Range descriptor |
[out] | dst | Ouput buffer |
[in] | src | Input buffer |
[in] | cnt | Count of transfer to copy |
References a4l_sizeof_chan().