GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-3-2 > qse / linux-gcc
#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 <PBI/PTR.h>
#include <PBI/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 |
CVS $Id: QSE_acdUnpack.c,v 1.7 2011/03/27 01:45:44 russell Exp $
#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.
_hwa | The halfword array to be accessed | |
_idx | The value to be transformed |
int QSE_acdUnpack | ( | QSE_acd * | acd, | |
const EBF_dir * | dir | |||
) |
Unpacks an ACD record from the AEM into a standard structure.
0 | Success |
acd | Pointer to the data structure to receive the unpacked data | |
dir | The EBF directory for this event |
References _QSE_acdRemap::brds, _QSE_acd::cables, _QSE_acd::hits, HW_ACCESS, _QSE_acdRemapBrd::msks, _QSE_acd::naccepts, _QSE_acd::nphas, _QSE_acd::nuphas, _QSE_acd::paccepts, _QSE_acd::phas, QSE_ACD_K_NCHNS_PER_BRD, QSE_ACD_LIST_K_RU, QSE_ACD_LIST_K_XY, QSE_ACD_LIST_K_XZ, QSE_ACD_LIST_K_YZ, QSE_ACD_SIDE_K_A, QSE_ACD_SIDE_K_B, QSE_ACD_STATUS_M_ABSENT, QSE_ACD_STATUS_M_DUP_CABLE, QSE_ACD_STATUS_M_FATAL, QSE_ACD_STATUS_M_ILL_CABLE, QSE_ACD_STATUS_M_PHA_OVRRUN, QSE_ACD_STATUS_M_PHA_UNDRUN, QSE_mapRemove(), QSE_mapScanr(), remap(), _QSE_acdRemapBrd::rma, _QSE_acdRemapBrd::rmc, _QSE_acd::start_parity, _QSE_acd::status, _QSE_acd::ucables, _QSE_acd::unmatched_parity, _QSE_acd::unpacked, and _QSE_acd::uphas.
int QSE_acdUnpackInit | ( | QSE_acd * | acd | ) |
One-time initialization an QSE_acd structure.
acd | The QSE_acd structure to initialize |
References _QSE_acd::unpacked.
void QSE_acdUnpackReset | ( | QSE_acd * | acd | ) |
Resets the QSE_acd structure, preparing it for a new event.
acd | The QSE_acd structure to reset |
References _QSE_acd::unpacked.
unsigned int QSE_acdUnpackSizeof | ( | void | ) |
Returns the size, in bytes, of an QSE_acd structure.
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.
list | The list to remap | |
rma | The remap array. This array is index by a bit number and returns the remapped bit number |
References QSE_mapRemove(), and QSE_mapScanf().
Referenced by QSE_acdUnpack().
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) } }