GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-10-2 > eds / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

EDR_errUnpack.c File Reference

Routines to unpack the ERR data for all towers in the LAT. More...

#include "EDS/EDR_errUnpack.h"
#include "EDS/EDR_err.h"
#include "EDS/EBF_err.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_tem.h"
#include "EDS/EBF_ctb.h"
#include "EDS/EBF_cid.h"
#include "EDS/FFS.h"

Defines

#define dprintf(format,...)
#define declare(statement)

Functions

static __inline int edr_err_gccc_status_compose (int reason, int cc, int rc, int idx)
 Convenience function to compose a EDR_errGCCCStatus word.
static __inline int edr_err_gtcc_status_compose (int reason, int cc, int rc, int idx)
 Convenience function to compose a EDR_errGTCCStatus word.
static __inline int edr_err_cal_parse (EDR_errCal *cal, unsigned int mask, const unsigned short int *err, int curStatus, int max)
 Unpacks the CAL error contribution.
static __inline int edr_err_tkr_parse (EDR_errTkr *tkr, unsigned int mask, const unsigned short int *err, int curStatus, int max)
 Unpacks the TKR error contribution.
static __inline int edr_err_tem_phase_parse (EDR_errTemPhase *phase, const unsigned short int *err, int curStatus, int max)
 Unpacks the TEM PHASE error contribution.
static __inline int edr_err_tem_timeout_parse (EDR_errTemTimeout *timeout, const unsigned short int *err, int curStatus, int max)
 Unpacks the TEM PHASE error contribution.
static __inline int edr_err_tem_parse (EDR_errTem *tem, const unsigned short int *err, int max)
 Produces a formatted dump of the error record.
int EDR_errUnpack (EDR_err *err, const EBF_dir *dir, unsigned int map)
 Unpacks the error records for the components specified by map of TEMs.
int EDR_errUnpackInit (EDR_err *err)
 One-time initialization an EDR_err structure.
void EDR_errUnpackReset (EDR_err *err)
 Resets the EDR_err structure, preparing it for a new event.
int EDR_errUnpackSizeof (void)
 Returns the size, in bytes, of a ERR LAT record.


Detailed Description

Routines to unpack the ERR data for all towers in the LAT.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: EDR_errUnpack.c,v 1.1 2009/04/29 19:47:10 russell Exp $

Function Documentation

static __inline int edr_err_cal_parse ( EDR_errCal cal,
unsigned int  calMask,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the CAL error contribution.

Parameters:
cal The data structure to receive the parsed data
calMask The bit vector of which cable controls are in error
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the CAL error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

static __inline int edr_err_gccc_status_compose ( int  reason,
int  cc,
int  rc,
int  idx 
) [static]

Convenience function to compose a EDR_errGCCCStatus word.

Returns:
The composed status word
Parameters:
reason The reason for the error, see EDR_ERR_GCCC_REASON_K,
cc The offending cable controller
rc The offending readout controller
idx The 16-bit word index of the offending word

static __inline int edr_err_gtcc_status_compose ( int  reason,
int  cc,
int  rc,
int  idx 
) [static]

Convenience function to compose a EDR_errGTCCStatus word.

Returns:
The composed status word
Parameters:
reason The reason for the error, see EDR_ERR_GTCC_REASON_K,
cc The offending cable controller
rc The offending readout controller
idx The 16-bit word index of the offending word

static __inline int edr_err_tem_parse ( EDR_errTem tem,
const unsigned short int *  err,
int  max 
) [static]

Produces a formatted dump of the error record.

Parameters:
tem The structure to receive the unpacked data for this tem
err The error source data record
max The length, in 16-bit words of the err

static __inline int edr_err_tem_phase_parse ( EDR_errTemPhase phase,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the TEM PHASE error contribution.

Parameters:
phase The data structure to receive the parsed data
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the PHASE error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

static __inline int edr_err_tem_timeout_parse ( EDR_errTemTimeout timeout,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the TEM PHASE error contribution.

Parameters:
timeout The data structure to receive the parsed data
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the PHASE error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

static __inline int edr_err_tkr_parse ( EDR_errTkr tkr,
unsigned int  mask,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the TKR error contribution.

Parameters:
tkr The data structure to receive the parsed data
mask The bit vector of which cable controls are in error
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the TKR error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

int EDR_errUnpack ( EDR_err err,
const EBF_dir dir,
unsigned int  map 
)

Unpacks the error records for the components specified by map of TEMs.

Returns:
A bit mask of the CAL and TKR contributions that are seriously flawed, that is, one should not trust the unpacking.
Parameters:
err The error context block to compose
dir The target directory structure
map The map of components to unpacke

int EDR_errUnpackInit ( EDR_err err  ) 

One-time initialization an EDR_err structure.

Returns:
0, always
Parameters:
err The EDR_err structure to initialize

void EDR_errUnpackReset ( EDR_err err  ) 

Resets the EDR_err structure, preparing it for a new event.

Parameters:
err The EDR_err structure to reset

int EDR_errUnpackSizeof ( void   ) 

Returns the size, in bytes, of a ERR LAT record.

Returns:
The size, in bytes, of a ERR LAT record.
This function should be called to determine the size of an EDR_err structure. This allows the calling program to avoid including the structure definition an EDR_err.

After allocating an EDR_err structure, the structure should be initialized using EDR_errUnpackInit().


Generated on Thu Sep 2 12:23:52 2010 by  doxygen 1.5.3