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


Interface   Data Structures   File List   Data Fields   Globals  

QDF_dgnRepack.c File Reference

Repacks the decoded tower diagnostic data back into EBF format. More...

#include "QSE/QDF_dgnRepack.h"
#include "QDF_dgn_def.h"
#include "QDF_reverse4.h"
#include "EDS/EBF_tem.h"
#include "EDS/FFS.h"
#include "dprintf.h"

Functions

static void repackDgnCalMismatch (const unsigned int(*dgn)[3][2], unsigned int primitives, unsigned int *dst)
static __inline
unsigned int 
le_map (unsigned int primitives)
 Rearrange the CAL HI/LO trigger primitive map such that the 4 bytes look like 0 L- 0 L+.
static __inline
unsigned int 
he_map (unsigned int primitives)
 Rearrange the CAL HI/LO trigger primitive map such that the 4 bytes look like (0 H- 0 H+) << 1.
static void repackDgnCalMatch (QDF_dgnCalAcceptMatch const *match, unsigned int primitives, unsigned int *dst)
static void repackDgnCalTrg (unsigned int primitives, unsigned int *dst)
static __inline
unsigned int * 
repackDgnCal (const QDF_dgnCalDat *cal, unsigned int tem, unsigned int *dst, const EBF_ctb *end)
 Repacks the CAL portion of the TEM diagnostic data into EBF format.
static __inline
unsigned int 
reverse9_lo (const char *rmap, unsigned int w)
 Reverses bit ordering of the lower 9 bits of w.
static __inline
unsigned int 
reverse9_hi (const char *rmap, unsigned int w)
 Reverses bit ordering of the lower 9 bits of w.
static unsigned int repackDgnTkr1 (const unsigned char *rmap, unsigned int gttc_hi, unsigned int gttc_lo)
 Reverses the 9 bits in each gttc word and combines them into one 32-bit word, with gttc_hi occupying the low 9 bits of the most significant 16 bits and gttc_lo occupying low 9 bits of the low 16 bits.
static __inline
unsigned int * 
repackDgnTkr (const QDF_dgnTkrDat *tkr, unsigned int tem, unsigned int *dst, const EBF_ctb *end)
 Repacks the CAL portion of the TEM diagnostic data into EBF format.
unsigned int * QDF_dgnRepack (const QDF_dgnEvt *dgn, int tem, unsigned int *dst, const EBF_ctb *end)
 Repacks the DGN data for the specified TEM into its EBF format.


Detailed Description

Repacks the decoded tower diagnostic data back into EBF format.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QDF_dgnRepack.c,v 1.1 2009/05/01 00:18:12 russell Exp $

Function Documentation

static __inline unsigned int he_map ( unsigned int  primitives  )  [static]

Rearrange the CAL HI/LO trigger primitive map such that the 4 bytes look like (0 H- 0 H+) << 1.

Parameters:
primitives the CAL HI/LO trigger map, arranged as H-H+L-L+
Forming this values allows one to project up the high energy CAL trigger bits for both the L- and L+ by

      dgn_he = (he >> dgn_word_number) & 0x00020002) << 12

static __inline unsigned int le_map ( unsigned int  primitives  )  [static]

Rearrange the CAL HI/LO trigger primitive map such that the 4 bytes look like 0 L- 0 L+.

Parameters:
primitives the CAL HI/LO trigger map, arranged a H-H+L-L+
Forming this values allows one to project up the low energy CAL trigger bits for both the L- and L+ by

      dgn_le = (le >> dgn_word_number) & 0x00010001) << 12

unsigned int * QDF_dgnRepack ( const QDF_dgnEvt dgn,
int  tem,
unsigned int *  dst,
const EBF_ctb *  end 
)

Repacks the DGN data for the specified TEM into its EBF format.

Returns:
The next location to fill in
Parameters:
dgn The DGN data to repack
tem Which TEM
dst The EBF destination address
end The address just past the last legitimate address

static __inline unsigned int * repackDgnCal ( const QDF_dgnCalDat cal,
unsigned int  tem,
unsigned int *  dst,
const EBF_ctb *  end 
) [static]

Repacks the CAL portion of the TEM diagnostic data into EBF format.

Returns:
The next location to fill in
Parameters:
cal The CAL diagnostic data to repack. This consists of the accepts and the trigger bits (CAL HI/LO).
tem Which TEM
dst The EBF destination address
end The address just past the last legitimate address

static __inline unsigned int * repackDgnTkr ( const QDF_dgnTkrDat tkr,
unsigned int  tem,
unsigned int *  dst,
const EBF_ctb *  end 
) [static]

Repacks the CAL portion of the TEM diagnostic data into EBF format.

Returns:
The next location to fill in
Parameters:
tkr The TKR data to repack. This consists of the 72 accept bits
tem Which TEM
dst The EBF destination address
end The address just past the last legitimate address

static unsigned int repackDgnTkr1 ( const unsigned char *  rmap,
unsigned int  gttc_hi,
unsigned int  gttc_lo 
) [static]

Reverses the 9 bits in each gttc word and combines them into one 32-bit word, with gttc_hi occupying the low 9 bits of the most significant 16 bits and gttc_lo occupying low 9 bits of the low 16 bits.

Returns:
The packed tracker diagnostic word.
Parameters:
rmap The reversal map. This is purely a bow to efficiency so that the address does not have to keep getting reloaded each call.
gttc_hi The GTTC bits for the upper 16 bits
gttc_lo The GTTC bits for the lower 16 bits

static __inline unsigned int reverse9_hi ( const char *  rmap,
unsigned int  w 
) [static]

Reverses bit ordering of the lower 9 bits of w.

Returns:
The bit reversed value stored in bits 16:24
Parameters:
rmap The reversal map. This is purely a bow to efficiency so that the address does not have to keep getting reloaded each call.
w The 9-bit value to bit-reverse.

static __inline unsigned int reverse9_lo ( const char *  rmap,
unsigned int  w 
) [static]

Reverses bit ordering of the lower 9 bits of w.

Returns:
The bit reversed value stored in bits 0:8
Parameters:
rmap The reversal map. This is purely a bow to efficiency so that the address does not have to keep getting reloaded each call.
w The 9-bit value to bit-reverse.


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