/* ====================================================================== Abs: Header File for Power Supply Subroutine Records Name: psSub.h Rem: Power Supply subroutine parameter definitions file. Side: see source file psSub.c Auth: 17-Mar-2011, K. Luchini (LUCHINI): Rev: dd-mmm-yyyy, Reviewer's Name (USERNAME) ---------------------------------------------------------------------- Mod: dd-mmm-yyyy, First Lastname (USERNAME) comment ====================================================================== */ #ifndef PSSUB_H #define PSSUB_H /* Status Returns */ #ifndef SUCCESS #define SUCCESS 0 #endif #ifndef ERROR #define ERROR -1 #endif /* Local definitions */ #define POLY_MIN_SLOPE 1E-30 /* Min slope in reverse polynomial */ #define POLY_MAX_COEF 12 /* Max # of polynomial coefficients */ #define POLY_CHICKEN_FACTOR 0.5 /* Factor used in reverse polynomial */ #define POLY_LINEAR_COEF_NUM 2 /* Reverse Polynomial Status */ #define POLY_CONVERGED 0 #define POLY_ALMOST_CONVERGED 1 #define POLY_NO_CONVERGENCE 2 #define POLY_ZERO_SLOPE 3 #define POLY_ERROR 4 /* * Status bit definitions * For pv: :STAT */ #define STAT_MASK 0xffff #define STAT_GOOD 0x0000 /* Successful */ #define STAT_DEAD 0x0001 /* Out-of-Service (offlien */ #define STAT_CALBWARN 0x0002 /* not calibrated */ #define STAT_BAD_DAC 0x0003 /* failed dac hardware */ #define STAT_BAD_ADC 0x0004 /* failed adc hardware */ #define STAT_OUTOFTOL 0x0005 /* out-of-tolerance */ #define STAT_CVTWARN 0x0006 /* almost converged */ #define STAT_DBERR 0x0007 /* database error */ #define STAT_ERR 0x0008 /* in trouble */ #define STAT_OK 0x0009 /* substandard but OK */ /* Minimum and maximum (removed from dbDefs.h) */ #define MIN(x,y) ((x>y) ? y : x) #define MAX(x,y) ((x>y) ? x : y) #ifdef INCwaveformH #include "epicsMutex.h" typedef struct psWfCoef { double *pcoef; /* ptr to poly coef from :POLYCOEF.A */ double *pdata; /* ptr to waveform data from :COEF2IVB */ unsigned long *pnord; /* waveform pv, number of elements read */ unsigned long nelem; /* max number of waveform elements */ epicsMutexId lock; /* mutex ID used to lock waveform during update */ } psWfCoef; #endif /* INCwaveformH */ #endif /* PSSUB_H */