• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

include/analogy/analogy.h

Go to the documentation of this file.
00001 
00022 #ifndef __ANALOGY_ANALOGY__
00023 #define __ANALOGY_ANALOGY__
00024 
00025 #include <unistd.h>
00026 
00027 #include <analogy/types.h>
00028 #include <analogy/descriptor.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 #ifndef DOXYGEN_CPP
00035 
00036 /* --- Level 0 API (not supposed to be used) --- */
00037 
00038 int a4l_sys_open(const char *fname);
00039 
00040 int a4l_sys_close(int fd);
00041 
00042 int a4l_sys_read(int fd, void *buf, size_t nbyte);
00043 
00044 int a4l_sys_write(int fd, void *buf, size_t nbyte);
00045 
00046 int a4l_sys_attach(int fd, a4l_lnkdesc_t *arg);
00047 
00048 int a4l_sys_detach(int fd);
00049 
00050 int a4l_sys_bufcfg(int fd, unsigned int idx_subd, unsigned long size);
00051 
00052 int a4l_sys_desc(int fd, a4l_desc_t *dsc, int pass);
00053 
00054 int a4l_sys_devinfo(int fd, a4l_dvinfo_t *info);
00055 
00056 int a4l_sys_subdinfo(int fd, a4l_sbinfo_t *info);
00057 
00058 int a4l_sys_nbchaninfo(int fd, unsigned int idx_subd, unsigned int *nb);
00059 
00060 int a4l_sys_chaninfo(int fd, 
00061                      unsigned int idx_subd, a4l_chinfo_t *info);
00062 
00063 int a4l_sys_nbrnginfo(int fd,
00064                       unsigned int idx_subd,
00065                       unsigned int idx_chan, unsigned int *nb);
00066 
00067 int a4l_sys_rnginfo(int fd,
00068                     unsigned int idx_subd,
00069                     unsigned int idx_chan, a4l_rnginfo_t *info);
00070 
00071 /* --- Level 1 API (supposed to be used) --- */
00072 
00073 int a4l_get_desc(int fd, a4l_desc_t *dsc, int pass);
00074 
00075 int a4l_open(a4l_desc_t *dsc, const char *fname);
00076 
00077 int a4l_close(a4l_desc_t *dsc);
00078 
00079 int a4l_fill_desc(a4l_desc_t *dsc);
00080 
00081 int a4l_get_subdinfo(a4l_desc_t *dsc,
00082                      unsigned int subd, a4l_sbinfo_t **info);
00083 
00084 int a4l_get_chinfo(a4l_desc_t *dsc,
00085                    unsigned int subd,
00086                    unsigned int chan, a4l_chinfo_t **info);
00087 
00088 #define a4l_get_chan_max(x) (1ULL << (x)->nb_bits)
00089 
00090 #define a4l_is_chan_global(x) ((x)->chan_flags & A4L_CHAN_GLOBAL)
00091 
00092 int a4l_get_rnginfo(a4l_desc_t *dsc,
00093                     unsigned int subd,
00094                     unsigned int chan,
00095                     unsigned int rng, a4l_rnginfo_t **info);
00096 
00097 #define a4l_is_rng_global(x) ((x)->flags & A4L_RNG_GLOBAL)
00098 
00099 int a4l_snd_command(a4l_desc_t *dsc, a4l_cmd_t *cmd);
00100     
00101 int a4l_snd_cancel(a4l_desc_t *dsc, unsigned int idx_subd);
00102 
00103 int a4l_set_bufsize(a4l_desc_t *dsc,
00104                     unsigned int idx_subd, unsigned long size);
00105 
00106 int a4l_get_bufsize(a4l_desc_t *dsc,
00107                     unsigned int idx_subd, unsigned long *size);
00108 
00109 int a4l_set_wakesize(a4l_desc_t *dsc, unsigned long size);
00110 
00111 int a4l_get_wakesize(a4l_desc_t *dsc, unsigned long *size);
00112 
00113 int a4l_mark_bufrw(a4l_desc_t *dsc,
00114                    unsigned int idx_subd,
00115                    unsigned long cur, unsigned long *newp);
00116 
00117 int a4l_poll(a4l_desc_t *dsc,
00118              unsigned int idx_subd, unsigned long ms_timeout);
00119     
00120 int a4l_mmap(a4l_desc_t *dsc,
00121              unsigned int idx_subd, unsigned long size, void **ptr);
00122 
00123 int a4l_async_read(a4l_desc_t *dsc,
00124                    void *buf, size_t nbyte, unsigned long ms_timeout);
00125 
00126 int a4l_async_write(a4l_desc_t *dsc,
00127                     void *buf, size_t nbyte, unsigned long ms_timeout);
00128 
00129 int a4l_snd_insnlist(a4l_desc_t *dsc, a4l_insnlst_t *arg);
00130 
00131 int a4l_snd_insn(a4l_desc_t *dsc, a4l_insn_t *arg);
00132 
00133 /* --- Level 2 API (supposed to be used) --- */
00134 
00135 int a4l_sync_write(a4l_desc_t *dsc,
00136                    unsigned int idx_subd,
00137                    unsigned int chan_desc,
00138                    unsigned int delay, void *buf, size_t nbyte);
00139         
00140 int a4l_sync_read(a4l_desc_t *dsc,
00141                   unsigned int idx_subd,
00142                   unsigned int chan_desc,
00143                   unsigned int delay, void *buf, size_t nbyte);
00144 
00145 int a4l_config_subd(a4l_desc_t *dsc,
00146                     unsigned int idx_subd, unsigned int type, ...);
00147 
00148 int a4l_sync_dio(a4l_desc_t *dsc,
00149                  unsigned int idx_subd, void *mask, void *buf);
00150 
00151 int a4l_sizeof_chan(a4l_chinfo_t *chan);
00152 
00153 int a4l_sizeof_subd(a4l_sbinfo_t *subd);
00154 
00155 int a4l_find_range(a4l_desc_t *dsc,
00156                    unsigned int idx_subd,
00157                    unsigned int idx_chan,
00158                    unsigned long unit,
00159                    double min, double max, a4l_rnginfo_t **rng);
00160 
00161 int a4l_rawtoul(a4l_chinfo_t *chan, unsigned long *dst, void *src, int cnt);
00162 
00163 int a4l_rawtof(a4l_chinfo_t *chan,
00164                a4l_rnginfo_t *rng, float *dst, void *src, int cnt);
00165 
00166 int a4l_rawtod(a4l_chinfo_t *chan,
00167                a4l_rnginfo_t *rng, double *dst, void *src, int cnt);
00168 
00169 int a4l_ultoraw(a4l_chinfo_t *chan, void *dst, unsigned long *src, int cnt);
00170 
00171 int a4l_ftoraw(a4l_chinfo_t *chan,
00172                a4l_rnginfo_t *rng, void *dst, float *src, int cnt);
00173 
00174 int a4l_dtoraw(a4l_chinfo_t *chan,
00175                a4l_rnginfo_t *rng, void *dst, double *src, int cnt);
00176 
00177 #endif /* !DOXYGEN_CPP */
00178 
00179 #ifdef __cplusplus
00180 }
00181 #endif
00182 #endif /* __ANALOGY_ANALOGY__ */

Generated on Wed Nov 2 2011 18:01:06 for Xenomai API by  doxygen 1.7.1