Xenomai  3.0.8
Collaboration diagram for Descriptor API:

Functions

int a4l_open (a4l_desc_t *dsc, const char *fname)
 Open an Analogy device and basically fill the descriptor. More...
 
int a4l_close (a4l_desc_t *dsc)
 Close the Analogy device related with the descriptor. More...
 
int a4l_fill_desc (a4l_desc_t *dsc)
 Fill the descriptor with subdevices, channels and ranges data. More...
 
int a4l_get_subdinfo (a4l_desc_t *dsc, unsigned int subd, a4l_sbinfo_t **info)
 Get an information structure on a specified subdevice. More...
 
int a4l_get_chinfo (a4l_desc_t *dsc, unsigned int subd, unsigned int chan, a4l_chinfo_t **info)
 Get an information structure on a specified channel. More...
 
int a4l_get_rnginfo (a4l_desc_t *dsc, unsigned int subd, unsigned int chan, unsigned int rng, a4l_rnginfo_t **info)
 Get an information structure on a specified range. More...
 

Detailed Description

This is the API interface used to fill and use Analogy device descriptor structure

Function Documentation

◆ a4l_close()

int a4l_close ( a4l_desc_t dsc)

Close the Analogy device related with the descriptor.

The file descriptor is associated with a context. The context is one of the enabler of asynchronous transfers. So, by closing the file descriptor, the programer must keep in mind that the currently occuring asynchronous transfer will cancelled.

Parameters
[in]dscDevice descriptor
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong; the the dsc pointer should be checked; check also the kernel log ("dmesg")

References a4l_sys_close(), and a4l_descriptor::fd.

◆ a4l_fill_desc()

int a4l_fill_desc ( a4l_desc_t dsc)

Fill the descriptor with subdevices, channels and ranges data.

Parameters
[in]dscDevice descriptor partly filled by a4l_open().
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong; the the dsc pointer should be checked; check also the kernel log ("dmesg")
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -ENODEV is returned if the descriptor is incoherent (the device may be unattached)

References a4l_descriptor::fd, and a4l_descriptor::magic.

◆ a4l_get_chinfo()

int a4l_get_chinfo ( a4l_desc_t dsc,
unsigned int  subd,
unsigned int  chan,
a4l_chinfo_t **  info 
)

Get an information structure on a specified channel.

Parameters
[in]dscDevice descriptor filled by a4l_open() and a4l_fill_desc()
[in]subdSubdevice index
[in]chanChannel index
[out]infoChannel information structure
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong; subd, chan and the dsc pointer should be checked; check also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called before using a4l_get_chinfo()

References a4l_descriptor::magic.

◆ a4l_get_rnginfo()

int a4l_get_rnginfo ( a4l_desc_t dsc,
unsigned int  subd,
unsigned int  chan,
unsigned int  rng,
a4l_rnginfo_t **  info 
)

Get an information structure on a specified range.

Parameters
[in]dscDevice descriptor filled by a4l_open() and a4l_fill_desc()
[in]subdSubdevice index
[in]chanChannel index
[in]rngRange index
[out]infoRange information structure
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong; subd, chan, rng and the dsc pointer should be checked; check also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called before using a4l_get_rnginfo()

References a4l_descriptor::magic.

◆ a4l_get_subdinfo()

int a4l_get_subdinfo ( a4l_desc_t dsc,
unsigned int  subd,
a4l_sbinfo_t **  info 
)

Get an information structure on a specified subdevice.

Parameters
[in]dscDevice descriptor filled by a4l_open() and a4l_fill_desc()
[in]subdSubdevice index
[out]infoSubdevice information structure
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong; subd and the dsc pointer should be checked; check also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called before using a4l_get_subdinfo().

References a4l_descriptor::magic.

Referenced by a4l_sync_dio().

◆ a4l_open()

int a4l_open ( a4l_desc_t dsc,
const char *  fname 
)

Open an Analogy device and basically fill the descriptor.

Parameters
[out]dscDevice descriptor
[in]fnameDevice name
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong; the fname and the dsc pointer should be checked; check also the kernel log ("dmesg")
  • -EFAULT is returned if a user <-> kernel transfer went wrong

References A4L_BSC_DESC, a4l_sys_close(), a4l_sys_desc(), a4l_sys_open(), and a4l_descriptor::fd.