Synchronous acquisition API
[Level 2 API]

Collaboration diagram for Synchronous acquisition API:


Functions

int a4l_sync_write (a4l_desc_t *dsc, unsigned int idx_subd, unsigned int chan_desc, unsigned int ns_delay, void *buf, size_t nbyte)
 Perform a synchronous acquisition write operation.
int a4l_sync_read (a4l_desc_t *dsc, unsigned int idx_subd, unsigned int chan_desc, unsigned int ns_delay, void *buf, size_t nbyte)
 Perform a synchronous acquisition read operation.
int a4l_sync_dio (a4l_desc_t *dsc, unsigned int idx_subd, void *mask, void *buf)
 Perform a synchronous acquisition digital acquisition.
int a4l_config_subd (a4l_desc_t *dsc, unsigned int idx_subd, unsigned int type,...)
 Configure a subdevice.


Function Documentation

int a4l_config_subd ( a4l_desc_t dsc,
unsigned int  idx_subd,
unsigned int  type,
  ... 
)

Configure a subdevice.

a4l_config_subd() takes a variable count of arguments. According to the configuration type, some additional argument is necessary:

  • A4L_INSN_CONFIG_DIO_INPUT: the channel index (unsigned int)
  • A4L_INSN_CONFIG_DIO_OUTPUT: the channel index (unsigned int)
  • A4L_INSN_CONFIG_DIO_QUERY: the returned DIO polarity (unsigned int *)

Parameters:
[in] dsc Device descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in] idx_subd Index of the concerned subdevice
[in] type Configuration parameter
Returns:
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -ENOSYS is returned if the configuration parameter is not supported

References A4L_INSN_CONFIG, a4l_snd_insn(), CHAN, a4l_instruction::chan_desc, and a4l_instruction::data_size.

int a4l_sync_dio ( a4l_desc_t dsc,
unsigned int  idx_subd,
void *  mask,
void *  buf 
)

Perform a synchronous acquisition digital acquisition.

Parameters:
[in] dsc Device descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in] idx_subd Index of the concerned subdevice
[in] mask Write mask which indicates which bit(s) must be modified
[in,out] buf Input / output buffer
Returns:
Number of bytes read, otherwise negative error code:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -ENOMEM is returned if the system is out of memory
  • -ENOSYS is returned if the driver does not provide any handler "instruction bits"

References a4l_get_subdinfo(), A4L_INSN_BITS, a4l_sizeof_subd(), a4l_snd_insn(), and a4l_instruction::data_size.

int a4l_sync_read ( a4l_desc_t dsc,
unsigned int  idx_subd,
unsigned int  chan_desc,
unsigned int  ns_delay,
void *  buf,
size_t  nbyte 
)

Perform a synchronous acquisition read operation.

Parameters:
[in] dsc Device descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in] idx_subd Index of the concerned subdevice
[in] chan_desc Channel descriptor (channel, range and reference)
[in] ns_delay Optional delay (in nanoseconds) to wait between the setting of the input channel and sample(s) acquisition(s).
[in] buf Input buffer
[in] nbyte Number of bytes to read
Returns:
Number of bytes read, otherwise negative error code:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -ENOMEM is returned if the system is out of memory

References A4L_INSN_READ, A4L_INSN_WAIT, a4l_snd_insn(), a4l_snd_insnlist(), a4l_instruction::data, and a4l_instruction::data_size.

int a4l_sync_write ( a4l_desc_t dsc,
unsigned int  idx_subd,
unsigned int  chan_desc,
unsigned int  ns_delay,
void *  buf,
size_t  nbyte 
)

Perform a synchronous acquisition write operation.

Parameters:
[in] dsc Device descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in] idx_subd Index of the concerned subdevice
[in] chan_desc Channel descriptor (channel, range and reference)
[in] ns_delay Optional delay (in nanoseconds) to wait between the setting of the input channel and sample(s) acquisition(s).
[in] buf Output buffer
[in] nbyte Number of bytes to write
Returns:
Number of bytes written, otherwise negative error code:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -ENOMEM is returned if the system is out of memory

References A4L_INSN_WAIT, A4L_INSN_WRITE, a4l_snd_insn(), a4l_snd_insnlist(), a4l_instruction::data, and a4l_instruction::data_size.


Generated on Tue Mar 8 13:02:08 2011 for Xenomai API by  doxygen 1.5.6