/* $Id: iseg.h,v 1.4 2003/09/28 09:05:15 jmuelmen Exp $ */ #ifndef _iseg__inc_ #define _iseg__inc_ /* initialize the ISEG */ char iseg_init (); /* set the voltage of an ISEG channel */ double iseg_set_v (int chan, double v); /* in V */ /* get the nominal voltage of a channel */ double iseg_get_v (int chan); /* get actual voltage and current */ double iseg_get_v_meas (int); double iseg_get_i_meas (int); /* in mA */ /* turn a channel on or off */ void iseg_turn_on (int); void iseg_turn_off (int); /* set current trip --- use iseg_turn_on to turn a tripped channel back on */ double iseg_set_i_trip (int, double); /* in mA */ double iseg_get_i_trip (int); /* in mA */ /* get channel status */ unsigned int iseg_get_chan_stat (int); /* status bits */ #define ISEG_SW_TRIP 1 /* software current trip */ #define ISEG_SENSE_ERROR 2 /* sense line error */ #define ISEG_V_UNSTABLE 4 /* output voltage unstable */ #define ISEG_CHAN_DONT_WORK 128 /* "channel don't work" :-) */ #define ISEG_INPUT_ERROR 512 /* v_set / ramp input out of range */ #define ISEG_CHAN_ON 1024 /* channel is on */ #define ISEG_V_RAMPING 2048 /* voltage is ramping */ #define ISEG_EMERGENCY_CUTOFF 4096 /* emergency cut-off has occurred */ #define ISEG_KILL_ENABLE 8192 /* kill-enabled */ #define ISEG_HW_TRIP 16384 /* hardware current trip */ #define ISEG_V_LIMIT 32768 /* voltage limit exceeded */ /* ramp speed */ double iseg_set_ramp (double); /* in V/s */ double iseg_get_ramp (); /* reset the current trip flags --- return value & 2^n indicates channel n had * tripped before the reset */ unsigned int iseg_reset (); #endif