Xenomai API  2.5.6.1
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_mark_bufrw(a4l_desc_t * dsc,
00110                    unsigned int idx_subd,
00111                    unsigned long cur, unsigned long *newp);
00112 
00113 int a4l_poll(a4l_desc_t * dsc,
00114              unsigned int idx_subd, unsigned long ms_timeout);
00115 
00116 int a4l_mmap(a4l_desc_t * dsc,
00117              unsigned int idx_subd, unsigned long size, void **ptr);
00118 
00119 int a4l_async_read(a4l_desc_t * dsc,
00120                    void *buf, size_t nbyte, unsigned long ms_timeout);
00121 
00122 int a4l_async_write(a4l_desc_t * dsc,
00123                     void *buf, size_t nbyte, unsigned long ms_timeout);
00124 
00125 int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg);
00126 
00127 int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t *arg);
00128 
00129 /* --- Level 2 API (supposed to be used) --- */
00130 
00131 int a4l_sync_write(a4l_desc_t * dsc,
00132                    unsigned int idx_subd,
00133                    unsigned int chan_desc,
00134                    unsigned int delay, void *buf, size_t nbyte);
00135 
00136 int a4l_sync_read(a4l_desc_t * dsc,
00137                   unsigned int idx_subd,
00138                   unsigned int chan_desc,
00139                   unsigned int delay, void *buf, size_t nbyte);
00140 
00141 int a4l_config_subd(a4l_desc_t * dsc,
00142                     unsigned int idx_subd, unsigned int type, ...);
00143 
00144 int a4l_sync_dio(a4l_desc_t *dsc,
00145                  unsigned int idx_subd, void *mask, void *buf);
00146 
00147 int a4l_sizeof_chan(a4l_chinfo_t * chan);
00148 
00149 int a4l_sizeof_subd(a4l_sbinfo_t *subd);
00150 
00151 int a4l_find_range(a4l_desc_t * dsc,
00152                    unsigned int idx_subd,
00153                    unsigned int idx_chan,
00154                    unsigned long unit,
00155                    double min, double max, a4l_rnginfo_t ** rng);
00156 
00157 int a4l_rawtoul(a4l_chinfo_t * chan, unsigned long *dst, void *src, int cnt);
00158 
00159 int a4l_rawtof(a4l_chinfo_t * chan,
00160                a4l_rnginfo_t * rng, float *dst, void *src, int cnt);
00161 
00162 int a4l_rawtod(a4l_chinfo_t * chan,
00163                a4l_rnginfo_t * rng, double *dst, void *src, int cnt);
00164 
00165 int a4l_ultoraw(a4l_chinfo_t * chan, void *dst, unsigned long *src, int cnt);
00166 
00167 int a4l_ftoraw(a4l_chinfo_t * chan,
00168                a4l_rnginfo_t * rng, void *dst, float *src, int cnt);
00169 
00170 int a4l_dtoraw(a4l_chinfo_t * chan,
00171                a4l_rnginfo_t * rng, void *dst, double *src, int cnt);
00172 
00173 #endif /* !DOXYGEN_CPP */
00174 
00175 #ifdef __cplusplus
00176 }
00177 #endif
00178 #endif /* __ANALOGY_ANALOGY__ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines