Xenomai  3.0.5
Synchronous acquisition API
Collaboration diagram for Synchronous acquisition API:

Data Structures

struct  a4l_instruction
 Structure describing the synchronous instruction. More...
 
struct  a4l_instruction_list
 Structure describing the list of synchronous instructions. More...
 

Macros

#define A4L_INSN_WAIT_MAX   100000
 Maximal wait duration.
 

Functions

int a4l_snd_insnlist (a4l_desc_t *dsc, a4l_insnlst_t *arg)
 Perform a list of synchronous acquisition misc operations. More...
 
int a4l_snd_insn (a4l_desc_t *dsc, a4l_insn_t *arg)
 Perform a synchronous acquisition misc operation. More...
 

Instruction type

Flags to define the type of instruction

#define A4L_INSN_READ   (0 | A4L_INSN_MASK_READ)
 Read instruction.
 
#define A4L_INSN_WRITE   (1 | A4L_INSN_MASK_WRITE)
 Write instruction.
 
#define A4L_INSN_BITS
 "Bits" instruction
 
#define A4L_INSN_CONFIG
 Configuration instruction.
 
#define A4L_INSN_GTOD
 Get time instruction.
 
#define A4L_INSN_WAIT
 Wait instruction.
 
#define A4L_INSN_INTTRIG
 Trigger instruction (to start asynchronous acquisition)
 

Configuration instruction type

Values to define the type of configuration instruction

#define A4L_INSN_CONFIG_DIO_INPUT   0
 
#define A4L_INSN_CONFIG_DIO_OUTPUT   1
 
#define A4L_INSN_CONFIG_DIO_OPENDRAIN   2
 
#define A4L_INSN_CONFIG_ANALOG_TRIG   16
 
#define A4L_INSN_CONFIG_ALT_SOURCE   20
 
#define A4L_INSN_CONFIG_DIGITAL_TRIG   21
 
#define A4L_INSN_CONFIG_BLOCK_SIZE   22
 
#define A4L_INSN_CONFIG_TIMER_1   23
 
#define A4L_INSN_CONFIG_FILTER   24
 
#define A4L_INSN_CONFIG_CHANGE_NOTIFY   25
 
#define A4L_INSN_CONFIG_SERIAL_CLOCK   26
 
#define A4L_INSN_CONFIG_BIDIRECTIONAL_DATA   27
 
#define A4L_INSN_CONFIG_DIO_QUERY   28
 
#define A4L_INSN_CONFIG_PWM_OUTPUT   29
 
#define A4L_INSN_CONFIG_GET_PWM_OUTPUT   30
 
#define A4L_INSN_CONFIG_ARM   31
 
#define A4L_INSN_CONFIG_DISARM   32
 
#define A4L_INSN_CONFIG_GET_COUNTER_STATUS   33
 
#define A4L_INSN_CONFIG_RESET   34
 
#define A4L_INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR   1001 /* Use CTR as single pulsegenerator */
 
#define A4L_INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR   1002 /* Use CTR as pulsetraingenerator */
 
#define A4L_INSN_CONFIG_GPCT_QUADRATURE_ENCODER   1003 /* Use the counter as encoder */
 
#define A4L_INSN_CONFIG_SET_GATE_SRC   2001 /* Set gate source */
 
#define A4L_INSN_CONFIG_GET_GATE_SRC   2002 /* Get gate source */
 
#define A4L_INSN_CONFIG_SET_CLOCK_SRC   2003 /* Set master clock source */
 
#define A4L_INSN_CONFIG_GET_CLOCK_SRC   2004 /* Get master clock source */
 
#define A4L_INSN_CONFIG_SET_OTHER_SRC   2005 /* Set other source */
 
#define A4L_INSN_CONFIG_SET_COUNTER_MODE   4097
 
#define A4L_INSN_CONFIG_SET_ROUTING   4099
 
#define A4L_INSN_CONFIG_GET_ROUTING   4109
 

Counter status bits

Status bits for INSN_CONFIG_GET_COUNTER_STATUS

#define A4L_COUNTER_ARMED   0x1
 
#define A4L_COUNTER_COUNTING   0x2
 
#define A4L_COUNTER_TERMINAL_COUNT   0x4
 

IO direction

Values to define the IO polarity

#define A4L_INPUT   0
 
#define A4L_OUTPUT   1
 
#define A4L_OPENDRAIN   2
 

Events types

Values to define the Analogy events. They might used to send some specific events through the instruction interface.

#define A4L_EV_START   0x00040000
 
#define A4L_EV_SCAN_BEGIN   0x00080000
 
#define A4L_EV_CONVERT   0x00100000
 
#define A4L_EV_SCAN_END   0x00200000
 
#define A4L_EV_STOP   0x00400000
 

Detailed Description

Function Documentation

◆ a4l_snd_insn()

int a4l_snd_insn ( a4l_desc_t dsc,
a4l_insn_t arg 
)

Perform a synchronous acquisition misc operation.

The function a4l_snd_insn() triggers a synchronous acquisition.

Parameters
[in]dscDevice descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in]argInstruction structure
Returns
0 on success. Otherwise:
  • -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_descriptor::fd.

Referenced by a4l_sync_dio().

◆ a4l_snd_insnlist()

int a4l_snd_insnlist ( a4l_desc_t dsc,
a4l_insnlst_t arg 
)

Perform a list of synchronous acquisition misc operations.

The function a4l_snd_insnlist() is able to send many synchronous instructions on a various set of subdevices, channels, etc.

Parameters
[in]dscDevice descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in]argInstructions list structure
Returns
0 on success. Otherwise:
  • -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_descriptor::fd.