Descriptor API
[Level 1 API]

Collaboration diagram for Descriptor API:

Detailed Description

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


Functions

int a4l_open (a4l_desc_t *dsc, const char *fname)
 Open an Analogy device and basically fill the descriptor.
int a4l_close (a4l_desc_t *dsc)
 Close the Analogy device related with the descriptor.
int a4l_fill_desc (a4l_desc_t *dsc)
 Fill the descriptor with subdevices, channels and ranges data.
int a4l_get_subdinfo (a4l_desc_t *dsc, unsigned int subd, a4l_sbinfo_t **info)
 Get an information structure on a specified subdevice.
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.
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.


Function Documentation

int a4l_close ( a4l_desc_t dsc  ) 

Close the Analogy device related with the descriptor.

Parameters:
[in] dsc Device 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.

int a4l_fill_desc ( a4l_desc_t dsc  ) 

Fill the descriptor with subdevices, channels and ranges data.

Parameters:
[in] dsc Device 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

References A4L_CPLX_DESC, a4l_sys_desc(), a4l_descriptor::fd, and a4l_descriptor::magic.

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] dsc Device descriptor filled by a4l_open() and a4l_fill_desc()
[in] subd Subdevice index
[in] chan Channel index
[out] info Channel 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_descriptor::nb_subd, and a4l_descriptor::sbdata.

Referenced by a4l_find_range().

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] dsc Device descriptor filled by a4l_open() and a4l_fill_desc()
[in] subd Subdevice index
[in] chan Channel index
[in] rng Range index
[out] info Range 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_descriptor::nb_subd, and a4l_descriptor::sbdata.

Referenced by a4l_find_range().

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] dsc Device descriptor filled by a4l_open() and a4l_fill_desc()
[in] subd Subdevice index
[out] info Subdevice 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, a4l_descriptor::nb_subd, and a4l_descriptor::sbdata.

Referenced by a4l_sync_dio().

int a4l_open ( a4l_desc_t dsc,
const char *  fname 
)

Open an Analogy device and basically fill the descriptor.

Parameters:
[out] dsc Device descriptor
[in] fname Device 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.


Generated on Sun Mar 28 19:46:53 2010 for Xenomai API by  doxygen 1.5.6