GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-12-1 > eds / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

ACD_unpack.c File Reference

Routines to unpack the ACD data. More...

#include <EDS/ACD_unpack.h>
#include <EDS/ACD_rec.h>
#include <PBI/FFS.ih>
#include <PBI/Endianness.h>
#include <PBI/PTR.h>

Defines

#define HW_ACCESS(_hwa, _idx)   _hwa[_idx];
 Addresses the ACD half-word array in a way that is compatiable with big or little endian machines.
#define channel_print(_chn)
#define DPRINTF(format,...)

Functions

int ACD_unpack (ACD_rec *acd, const void *dat, unsigned int len)
 Unpacks an ACD record from the AEM into a standard structure.
int ACD_unpackInit (ACD_rec *acd)
 One-time initialization an ACD_rec structure.
void ACD_unpackReset (ACD_rec *acd)
 Resets the ACD_rec structure, preparing it for a new event.
unsigned int ACD_unpackSizeof (void)
 Returns the size, in bytes, of an ACD_rec structure.


Detailed Description

Routines to unpack the ACD data.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: ACD_unpack.c,v 1.6 2011/04/05 23:56:49 russell Exp $

Define Documentation

#define HW_ACCESS ( _hwa,
_idx   )     _hwa[_idx];

Addresses the ACD half-word array in a way that is compatiable with big or little endian machines.

Returns:
Value at the halfword index
Parameters:
_hwa The halfword array to be accessed
_idx The value to be transformed

Referenced by ACD_unpack(), and EDR_acdUnpack().


Function Documentation

int ACD_unpack ( ACD_rec acd,
const void *  dat,
unsigned int  len 
)

Unpacks an ACD record from the AEM into a standard structure.

Returns:
Status. The only failure is if more than 18 PHAs are found to be present on an given FREE board or the serial decode extends beyond the maxwrds
Parameters:
acd Pointer to the data structure to receive the unpacked data
dat The ACD data for this event
len The length of the data in bytes

References ACD_K_NCABLES, ACD_K_NCHNS_PER_CABLE, ACD_STATUS_M_ABORTED, ACD_STATUS_M_CBL_DUP, ACD_STATUS_M_CBL_ILL, ACD_STATUS_M_CBL_ORDER, ACD_STATUS_M_CBL_OVRRUN, ACD_STATUS_M_CBL_PARITY, ACD_STATUS_M_CBL_TIMEOUT, ACD_STATUS_M_DAT_OVRRUN, ACD_STATUS_M_DAT_UNDRUN, ACD_STATUS_M_FATAL, ACD_STATUS_M_PHA_OVRRUN, ACD_STATUS_M_PHA_PARITY, ACD_STATUS_M_PHA_UNDRUN, _ACD_rec::cable, _ACD_rec::chns, _ACD_cableStatus::hdr_parity, HW_ACCESS, _ACD_rec::nchns, _ACD_rec::nphas, _ACD_cableStatus::pha_overrun, _ACD_cableStatus::pha_parity, _ACD_cableStatus::pha_underrun, _ACD_cableStatus::present, _ACD_rec::remaining, _ACD_rec::status, _ACD_cableStatus::timeout, and _ACD_rec::unpacked.

int ACD_unpackInit ( ACD_rec acd  ) 

One-time initialization an ACD_rec structure.

Returns:
0, always
Parameters:
acd The ACD_rec structure to initialize

References _ACD_rec::unpacked.

void ACD_unpackReset ( ACD_rec acd  ) 

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

Parameters:
acd The ACD_rec structure to reset

References _ACD_rec::unpacked.

unsigned int ACD_unpackSizeof ( void   ) 

Returns the size, in bytes, of an ACD_rec structure.

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

After allocating an ACD_rec structure, the structure should be initialized using ACD_unpackInit().


Generated on Thu Sep 27 13:51:01 2012 by  doxygen 1.5.8