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


Interface   Data Structures   File List   Data Fields   Globals  

QDF_acd_ped.c File Reference

Decodes the ACD data when in the encoded in pedestal (no-zero suppressed) fashion. More...

#include "QSE/QDF_acd.h"
#include "QSE/QDF_exc.h"
#include "QDF_acd_def.h"
#include "QDF_exc_def.h"
#include "EDS/EDA_acd.h"
#include "LDT/BFU.h"
#include "LDT/HUFF.h"
#include "LDT/HDD.h"
#include "LDT/BIT.h"
#include <string.h>

Typedefs

typedef enum
_CDF_ACD_PED_STYLE_K 
CDF_ACD_PED_STYLE_K
 Typedef for enum _CDF_ACD_PED_STYLE_K.
typedef BFU(* Decoder )(QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)

Enumerations

enum  _CDF_ACD_PED_STYLE_K {
  CDF_ACD_PED_STYLE_K_COPY = 0,
  CDF_ACD_PED_STYLE_K_HUFFMAN = 1,
  CDF_ACD_PED_STYLE_K_RSVD_2 = 2,
  CDF_ACD_PED_STYLE_K_RSVD_3 = 3
}
 Enumerates the major format styles for ACD pedestal data. More...

Functions

static BFU acd_ped_style_0 (QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD when encoded as in style 0 format. This is format is almost a straight copy of the ACD data.
static BFU acd_ped_style_1 (QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD when encoded using in style 1. This format style uses a limited range huffman table. The limited means that only the central part of the pedestal subtracted data is encoded using a huffman table. Those value outside the central core are encoded in a look-aside exception list.
static BFU acd_ped_style_2 (QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD when encoded using a style 2. Currently there is no style 2, so any ACD data encoded in style 2 represents a serious error.
static BFU acd_ped_style_3 (QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD when encoded using a style 3. Currently there is no style 2, so any ACD data encoded in style 3 represents a serious error.
static BFU aem_ped_unpack_cables (const unsigned int *src, unsigned int max, BFU bfu, unsigned short int *cables)
 Retrieves the list of missing or timed out cables.
static BFU aem_ped_unpack_chnx (const unsigned int *src, unsigned int max, BFU bfu, QDF_acdPedEvt *aem)
 The channel exception address lists.
static BFU aem_ped_unpack_phax (const unsigned int *src, unsigned int max, BFU bfu, QDF_acdPedEvt *aem)
 The channel exception address lists.
static __inline BFU aem_ped_unpack_dadcs (const unsigned int *src, unsigned int max, BFU bfu, QDF_acdPedEvt *aem, QDF_acdCtx *ctx)
 Unpacks the pedestal subtracted ADC values.
BFU QDF_acdPedDecode (QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD.


Detailed Description

Decodes the ACD data when in the encoded in pedestal (no-zero suppressed) fashion.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QDF_acd_ped.c,v 1.4 2007/04/08 22:42:50 russell Exp $

Enumeration Type Documentation

enum _CDF_ACD_PED_STYLE_K

Enumerates the major format styles for ACD pedestal data.

Enumerator:
CDF_ACD_PED_STYLE_K_COPY  Straight copy style
CDF_ACD_PED_STYLE_K_HUFFMAN  Huffman encode
CDF_ACD_PED_STYLE_K_RSVD_2  Reserved
CDF_ACD_PED_STYLE_K_RSVD_3  Reserved


Function Documentation

static BFU acd_ped_style_0 ( QDF_acdCtx ctx,
QDF_acdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD when encoded as in style 0 format. This is format is almost a straight copy of the ACD data.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static BFU acd_ped_style_1 ( QDF_acdCtx ctx,
QDF_acdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD when encoded using in style 1. This format style uses a limited range huffman table. The limited means that only the central part of the pedestal subtracted data is encoded using a huffman table. Those value outside the central core are encoded in a look-aside exception list.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static BFU acd_ped_style_2 ( QDF_acdCtx ctx,
QDF_acdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD when encoded using a style 2. Currently there is no style 2, so any ACD data encoded in style 2 represents a serious error.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static BFU acd_ped_style_3 ( QDF_acdCtx ctx,
QDF_acdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD when encoded using a style 3. Currently there is no style 2, so any ACD data encoded in style 3 represents a serious error.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static BFU aem_ped_unpack_cables ( const unsigned int *  src,
unsigned int  max,
BFU  bfu,
unsigned short int *  cables 
) [static]

Retrieves the list of missing or timed out cables.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
cables The bit mask of cables to pack away

static BFU aem_ped_unpack_chnx ( const unsigned int *  src,
unsigned int  max,
BFU  bfu,
QDF_acdPedEvt aem 
) [static]

The channel exception address lists.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
aem The data structure to receive the unpacked lists
Channel exceptions occur because the

The collection of these condition form a 3-bit number. This number identiifies one of 8 lists which are encoded into the data stream. The list of addresses associated with each list is extracted from the stream and stored in the channel exception lists. The lists are stored this way to avoid duplicating address. That is, an channel with one or more exceptions is only emitted once. On this side, it would make sense to condense the lists at this time.

!!! THE ABOVE STEP NEEDS TO BE DONE

static __inline BFU aem_ped_unpack_dadcs ( const unsigned int *  src,
unsigned int  max,
BFU  bfu,
QDF_acdPedEvt aem,
QDF_acdCtx ctx 
) [static]

Unpacks the pedestal subtracted ADC values.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
aem The data structure to receive the unpacked lists
ctx The compressed data decoding context
This is just a cover routine for HDD_decodeS

static BFU aem_ped_unpack_phax ( const unsigned int *  src,
unsigned int  max,
BFU  bfu,
QDF_acdPedEvt aem 
) [static]

The channel exception address lists.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
aem The data structure to receive the unpacked lists
!!! ROUTINE NEVER TESTED...

BFU QDF_acdPedDecode ( QDF_acdCtx ctx,
QDF_acdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
)

Decodes the ACD.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
This routine is a simple dispatcher, extracting the formatting style, then dispatching to the appropriate decoding routine.


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