GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-3-0 > qse / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QSE_acdUnpack.c File Reference

Routines to unpack the ACD data. More...

#include "QSE/QSE_map.h"
#include "QSE/QSE_acd.h"
#include "QSE/QSE_acdUnpack.h"
#include "QSE_acdRemap.h"
#include "QSD/QSD_acdMapdef.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_ctb.h"
#include "EDS/EBF_cid.h"
#include "EDS/EDS_endianness.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 LIST(_brd, _chn)   (((BRD_ ## _brd ## _ ## _chn) / 32) % QSE_ACD_LIST_K_CNT)
#define MEMBER(_brd, _num, _list)   ((LIST(_brd, _num) == _list) ? (0x80000000 >> (_num)) : 0)
#define BRD_RMA(_brd, _chn)   ((BRD_ ## _brd ## _ ## _chn) & 0x1f)
#define BRD_RMC(_brd, _chn)   (BRD_ ## _brd ## _ ## _chn)
#define ACD_REMAP_BRD(_brd)   { BRD_MSKS(_brd), BRD_RMAS(_brd), BRD_RMCS(_brd) }
#define BRD_MSK(_brd, _list)
#define BRD_MSKS(_brd)
#define BRD_RMAS(_brd)
#define BRD_RMCS(_brd)

Functions

static __inline
unsigned int 
remap (unsigned int list, const unsigned char *rma)
 Remaps the members in list according the remap array rma.
int QSE_acdUnpack (QSE_acd *acd, const EBF_dir *dir)
 Unpacks an ACD record from the AEM into a standard structure.
int QSE_acdUnpackInit (QSE_acd *acd)
 One-time initialization an QSE_acd structure.
void QSE_acdUnpackReset (QSE_acd *acd)
 Resets the QSE_acd structure, preparing it for a new event.
unsigned int QSE_acdUnpackSizeof (void)
 Returns the size, in bytes, of an QSE_acd structure.

Variables

const QSE_acdRemap AcdRemap


Detailed Description

Routines to unpack the ACD data.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: QSE_acdUnpack.c,v 1.6 2008/07/17 04:20:08 russell Exp $

Define Documentation

#define BRD_MSK ( _brd,
_list   ) 

Value:

(                           \
     MEMBER(_brd,  0, _list)   \
   | MEMBER(_brd,  1, _list)   \
   | MEMBER(_brd,  2, _list)   \
   | MEMBER(_brd,  3, _list)   \
   | MEMBER(_brd,  4, _list)   \
   | MEMBER(_brd,  5, _list)   \
   | MEMBER(_brd,  6, _list)   \
   | MEMBER(_brd,  7, _list)   \
   | MEMBER(_brd,  8, _list)   \
   | MEMBER(_brd,  9, _list)   \
   | MEMBER(_brd, 10, _list)   \
   | MEMBER(_brd, 11, _list)   \
   | MEMBER(_brd, 12, _list)   \
   | MEMBER(_brd, 13, _list)   \
   | MEMBER(_brd, 14, _list)   \
   | MEMBER(_brd, 15, _list)   \
   | MEMBER(_brd, 16, _list)   \
   | MEMBER(_brd, 17, _list)   \
    )

#define BRD_MSKS ( _brd   ) 

Value:

{ BRD_MSK(_brd, QSE_ACD_LIST_K_XZ), \
     BRD_MSK(_brd, QSE_ACD_LIST_K_YZ), \
     BRD_MSK(_brd, QSE_ACD_LIST_K_XY), \
     BRD_MSK(_brd, QSE_ACD_LIST_K_RU)  \
   }

#define BRD_RMAS ( _brd   ) 

Value:

{                      \
     BRD_RMA(_brd,  0),   \
     BRD_RMA(_brd,  1),   \
     BRD_RMA(_brd,  2),   \
     BRD_RMA(_brd,  3),   \
     BRD_RMA(_brd,  4),   \
     BRD_RMA(_brd,  5),   \
     BRD_RMA(_brd,  6),   \
     BRD_RMA(_brd,  7),   \
     BRD_RMA(_brd,  8),   \
     BRD_RMA(_brd,  9),   \
     BRD_RMA(_brd, 10),   \
     BRD_RMA(_brd, 11),   \
     BRD_RMA(_brd, 12),   \
     BRD_RMA(_brd, 13),   \
     BRD_RMA(_brd, 14),   \
     BRD_RMA(_brd, 15),   \
     BRD_RMA(_brd, 16),   \
     BRD_RMA(_brd, 17)    \
   }

#define BRD_RMCS ( _brd   ) 

Value:

{                         \
     BRD_RMC(_brd,  0),   \
     BRD_RMC(_brd,  1),   \
     BRD_RMC(_brd,  2),   \
     BRD_RMC(_brd,  3),   \
     BRD_RMC(_brd,  4),   \
     BRD_RMC(_brd,  5),   \
     BRD_RMC(_brd,  6),   \
     BRD_RMC(_brd,  7),   \
     BRD_RMC(_brd,  8),   \
     BRD_RMC(_brd,  9),   \
     BRD_RMC(_brd, 10),   \
     BRD_RMC(_brd, 11),   \
     BRD_RMC(_brd, 12),   \
     BRD_RMC(_brd, 13),   \
     BRD_RMC(_brd, 14),   \
     BRD_RMC(_brd, 15),   \
     BRD_RMC(_brd, 16),   \
     BRD_RMC(_brd, 17)    \
   }

#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


Function Documentation

int QSE_acdUnpack ( QSE_acd acd,
const EBF_dir *  dir 
)

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

Return values:
0 Success
Returns:
Bit mask of the values in the enumeration QSE_ACD_STATUS_M. In general, negative values are failures and positive values are successes, but with possible qualifications.
Parameters:
acd Pointer to the data structure to receive the unpacked data
dir The EBF directory for this event

int QSE_acdUnpackInit ( QSE_acd acd  ) 

One-time initialization an QSE_acd structure.

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

void QSE_acdUnpackReset ( QSE_acd acd  ) 

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

Parameters:
acd The QSE_acd structure to reset

unsigned int QSE_acdUnpackSizeof ( void   ) 

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

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

After allocating an QSE_acd structure, the structure should be initialized using QSE_acdUnpackInit().

static __inline unsigned int remap ( unsigned int  list,
const unsigned char *  rma 
) [static]

Remaps the members in list according the remap array rma.

Returns:
The remapped list
Parameters:
list The list to remap
rma The remap array. This array is index by a bit number and returns the remapped bit number


Variable Documentation

const QSE_acdRemap AcdRemap

Initial value:

{
  {
    ACD_REMAP_BRD(1LA),  
    ACD_REMAP_BRD(1RB),  
    ACD_REMAP_BRD(2LA),  
    ACD_REMAP_BRD(2LB),  
    ACD_REMAP_BRD(2RA),  
    ACD_REMAP_BRD(2RB),  

    ACD_REMAP_BRD(3LA),  
    ACD_REMAP_BRD(3RB),  
    ACD_REMAP_BRD(4LA),  
    ACD_REMAP_BRD(4LB),  
    ACD_REMAP_BRD(4RA),  
    ACD_REMAP_BRD(4RB)   
  }
}


Generated on Thu Sep 2 14:54:56 2010 by  doxygen 1.5.3