/* $Id: libsurf.h,v 1.10 2004/04/01 05:34:20 jmuelmen Exp $ */ #ifndef _libsurf_inc #define _libsurf_inc #define SURF_VEND 0x4242 #define SURF_PROD 0xbeef /* surf error handling stuff; like stdlib errno */ extern int surf_errno; void surf_perror (const char *); void surf_print_boards (); int surf_init (); /* * module-wise operations; supply module name */ /* status setters */ int surf_mod_sel_rd (const char *mod); int surf_mod_sel_wr (const char *mod); int surf_mod_set_anl_v (const char *mod, double v); int surf_mod_set_dig_v (const char *mod, double v); int surf_mod_ena (const char *mod, int); int surf_mod_end (const char *mod, int); /* status getters */ int surf_mod_get_sel_rd (const char *mod); int surf_mod_get_sel_wr (const char *mod); int surf_mod_get_ena (const char *mod); int surf_mod_get_end (const char *mod); double surf_mod_get_anl_v (const char *mod); double surf_mod_get_dig_v (const char *mod); double surf_mod_get_anl_i (const char *mod); double surf_mod_get_dig_i (const char *mod); double surf_mod_get_temp (const char *mod); /* * board-wise operations; supply board name and channel number */ /* status setters */ int surf_brd_sel_rd (const char *brd, int chn); int surf_brd_sel_wr (const char *brd, int chn); int surf_brd_sel_wr_glob (const char *brd); int surf_brd_set_anl_v (const char *brd, int chn, double v); int surf_brd_set_dig_v (const char *brd, int chn, double v); int surf_brd_set_anl_tol (const char *brd, int chn, double v); int surf_brd_set_dig_tol (const char *brd, int chn, double v); int surf_brd_set_anl_comp (const char *brd, int chn, int); int surf_brd_set_dig_comp (const char *brd, int chn, int); int surf_brd_set_anl_dac (const char *brd, int chn, char dac); int surf_brd_set_dig_dac (const char *brd, int chn, char dac); int surf_brd_ena (const char *brd, int chn, int); int surf_brd_end (const char *brd, int chn, int); int surf_brd_temp_reset (const char *brd); /* status getters */ int surf_brd_get_sel_rd (const char *brd, int chn); int surf_brd_get_sel_wr (const char *brd, int chn); int surf_brd_get_ena (const char *brd, int chn); int surf_brd_get_end (const char *brd, int chn); double surf_brd_get_anl_v (const char *brd, int chn); double surf_brd_get_dig_v (const char *brd, int chn); double surf_brd_get_anl_i (const char *brd, int chn); double surf_brd_get_dig_i (const char *brd, int chn); int surf_brd_get_anl_i_adc (const char *brd, int chn); int surf_brd_get_dig_i_adc (const char *brd, int chn); int surf_brd_get_anl_v_adc (const char *brd, int chn); int surf_brd_get_dig_v_adc (const char *brd, int chn); double surf_brd_get_temp (const char *brd, int chn); int surf_brd_get_temp_adc (const char *brd, int chn); int surf_brd_get_gnd_v_adc (const char *brd, int chn); /* * board-specific things like dmesg */ #if 0 const char *surf_brd_dmesg (const char *brd); int surf_brd_raw_write (const char *, int ep, char *buf, int count); int surf_brd_raw_read (const char *, int ep, char *buf, int count); #endif int surf_load_mod_tbl (const char *file); void surf_print_mods (); int surf_mod_tbl_get_mod (char *name, int i); #endif /* _libsurf_inc */