22 #ifndef __ANALOGY_ANALOGY__
23 #define __ANALOGY_ANALOGY__
50 int a4l_sys_bufcfg(
int fd,
unsigned int idx_subd,
unsigned long size);
54 int a4l_sys_devinfo(
int fd, a4l_dvinfo_t *info);
56 int a4l_sys_subdinfo(
int fd, a4l_sbinfo_t *info);
58 int a4l_sys_nbchaninfo(
int fd,
unsigned int idx_subd,
unsigned int *nb);
60 int a4l_sys_chaninfo(
int fd,
61 unsigned int idx_subd, a4l_chinfo_t *info);
63 int a4l_sys_nbrnginfo(
int fd,
64 unsigned int idx_subd,
65 unsigned int idx_chan,
unsigned int *nb);
67 int a4l_sys_rnginfo(
int fd,
68 unsigned int idx_subd,
69 unsigned int idx_chan, a4l_rnginfo_t *info);
73 int a4l_get_desc(
int fd,
a4l_desc_t *dsc,
int pass);
82 unsigned int subd, a4l_sbinfo_t **info);
86 unsigned int chan, a4l_chinfo_t **info);
88 #define a4l_get_chan_max(x) (1ULL << (x)->nb_bits)
90 #define a4l_is_chan_global(x) ((x)->chan_flags & A4L_CHAN_GLOBAL)
95 unsigned int rng, a4l_rnginfo_t **info);
97 #define a4l_is_rng_global(x) ((x)->flags & A4L_RNG_GLOBAL)
104 unsigned int idx_subd,
unsigned long size);
107 unsigned int idx_subd,
unsigned long *size);
109 int a4l_set_wakesize(
a4l_desc_t *dsc,
unsigned long size);
111 int a4l_get_wakesize(
a4l_desc_t *dsc,
unsigned long *size);
114 unsigned int idx_subd,
115 unsigned long cur,
unsigned long *newp);
118 unsigned int idx_subd,
unsigned long ms_timeout);
121 unsigned int idx_subd,
unsigned long size,
void **ptr);
124 void *buf,
size_t nbyte,
unsigned long ms_timeout);
127 void *buf,
size_t nbyte,
unsigned long ms_timeout);
136 unsigned int idx_subd,
137 unsigned int chan_desc,
138 unsigned int delay,
void *buf,
size_t nbyte);
141 unsigned int idx_subd,
142 unsigned int chan_desc,
143 unsigned int delay,
void *buf,
size_t nbyte);
146 unsigned int idx_subd,
unsigned int type, ...);
149 unsigned int idx_subd,
void *mask,
void *buf);
156 unsigned int idx_subd,
157 unsigned int idx_chan,
159 double min,
double max, a4l_rnginfo_t **rng);
161 int a4l_rawtoul(a4l_chinfo_t *chan,
unsigned long *dst,
void *src,
int cnt);
164 a4l_rnginfo_t *rng,
float *dst,
void *src,
int cnt);
167 a4l_rnginfo_t *rng,
double *dst,
void *src,
int cnt);
169 int a4l_ultoraw(a4l_chinfo_t *chan,
void *dst,
unsigned long *src,
int cnt);
172 a4l_rnginfo_t *rng,
void *dst,
float *src,
int cnt);
175 a4l_rnginfo_t *rng,
void *dst,
double *src,
int cnt);
int a4l_open(a4l_desc_t *dsc, const char *fname)
Open an Analogy device and basically fill the descriptor.
Definition: descriptor.c:297
int a4l_get_bufsize(a4l_desc_t *dsc, unsigned int idx_subd, unsigned long *size)
Get the size of the asynchronous buffer.
Definition: async.c:187
int a4l_snd_insnlist(a4l_desc_t *dsc, a4l_insnlst_t *arg)
Perform a list of synchronous acquisition misc operations.
Definition: sync.c:61
int a4l_mark_bufrw(a4l_desc_t *dsc, unsigned int idx_subd, unsigned long cur, unsigned long *new)
Update the asynchronous buffer state.
Definition: async.c:247
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.
Definition: range.c:309
int a4l_config_subd(a4l_desc_t *dsc, unsigned int idx_subd, unsigned int type,...)
Configure a subdevice.
Definition: sync.c:372
int a4l_async_read(a4l_desc_t *dsc, void *buf, size_t nbyte, unsigned long ms_timeout)
Perform asynchronous read operation on the analog input subdevice.
Definition: async.c:387
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.
Definition: descriptor.c:474
Structure describing the asynchronous instruction.
Definition: command.h:198
int a4l_set_bufsize(a4l_desc_t *dsc, unsigned int idx_subd, unsigned long size)
Change the size of the asynchronous buffer.
Definition: async.c:124
int a4l_snd_insn(a4l_desc_t *dsc, a4l_insn_t *arg)
Perform a synchronous acquisition misc operation.
Definition: sync.c:87
int a4l_fill_desc(a4l_desc_t *dsc)
Fill the descriptor with subdevices, channels and ranges data.
Definition: descriptor.c:364
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.
Definition: sync.c:206
Structure containing device-information useful to users.
Definition: descriptor.h:66
int a4l_sys_open(const char *fname)
Open an Analogy device.
Definition: sys.c:60
int a4l_rawtoul(a4l_chinfo_t *chan, unsigned long *dst, void *src, int cnt)
Unpack raw data (from the driver) into unsigned long values.
Definition: range.c:249
Analogy for Linux, descriptor related features.
int a4l_ultoraw(a4l_chinfo_t *chan, void *dst, unsigned long *src, int cnt)
Pack unsigned long values into raw data (for the driver)
Definition: range.c:459
int a4l_snd_cancel(a4l_desc_t *dsc, unsigned int idx_subd)
Cancel an asynchronous acquisition.
Definition: async.c:84
int a4l_sizeof_subd(a4l_sbinfo_t *subd)
Get the size in memory of a digital acquired element.
Definition: range.c:121
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)
Definition: range.c:589
int a4l_sys_attach(int fd, a4l_lnkdesc_t *arg)
Attach an Analogy device to a driver.
Definition: sys.c:154
int a4l_sys_write(int fd, void *buf, size_t nbyte)
Write to an Analogy device.
Definition: sys.c:123
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.
Definition: range.c:382
int a4l_sync_dio(a4l_desc_t *dsc, unsigned int idx_subd, void *mask, void *buf)
Perform a synchronous acquisition digital acquisition.
Definition: sync.c:277
int a4l_sizeof_chan(a4l_chinfo_t *chan)
Get the size in memory of an acquired element.
Definition: range.c:85
int a4l_close(a4l_desc_t *dsc)
Close the Analogy device related with the descriptor.
Definition: descriptor.c:339
int a4l_poll(a4l_desc_t *dsc, unsigned int idx_subd, unsigned long ms_timeout)
Get the available data count.
Definition: async.c:289
int a4l_mmap(a4l_desc_t *dsc, unsigned int idx_subd, unsigned long size, void **ptr)
Map the asynchronous ring-buffer into a user-space.
Definition: async.c:331
int a4l_sys_detach(int fd)
Detach an Analogy device from a driver.
Definition: sys.c:177
Structure describing the synchronous instruction.
Definition: instruction.h:169
int a4l_get_subdinfo(a4l_desc_t *dsc, unsigned int subd, a4l_sbinfo_t **info)
Get an information structure on a specified subdevice.
Definition: descriptor.c:393
Analogy for Linux, misc declarations.
int a4l_async_write(a4l_desc_t *dsc, void *buf, size_t nbyte, unsigned long ms_timeout)
Perform asynchronous write operation on the analog input subdevice.
Definition: async.c:444
int a4l_sys_desc(int fd, a4l_desc_t *dsc, int pass)
Get a descriptor on an attached device.
Definition: descriptor.c:237
int a4l_sys_bufcfg(int fd, unsigned int idx_subd, unsigned long size)
Configure the buffer size.
Definition: sys.c:208
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.
Definition: range.c:166
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)
Definition: range.c:519
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.
Definition: descriptor.c:430
int a4l_sys_close(int fd)
Close an Analogy device.
Definition: sys.c:73
int a4l_snd_command(a4l_desc_t *dsc, a4l_cmd_t *cmd)
Send a command to an Analoy device.
Definition: async.c:57
int a4l_sys_read(int fd, void *buf, size_t nbyte)
Read from an Analogy device.
Definition: sys.c:98
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.
Definition: sync.c:133
Structure describing the list of synchronous instructions.
Definition: instruction.h:188