GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSE / V1-6-4
Constituent: qse     Tag: linux-gcc
#include "QSE/QSE_tkrUnpack.h"
#include "QSE/QSE_tkr.h"
#include "QSE/QSE_map.h"
#include "EDS/EBF_tkr.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_ctb.h"
#include "PBI/Endianness.h"
#include <string.h>
Include dependency graph for QSE_tkrUnpack.c:
Data Structures | |
struct | _TKR_2strips_bf |
Maps out the first word containing strip addresses. More... | |
struct | _TKR_8strips0_bf |
Maps out the first word of the 3 strip address pattern words as bit fields. More... | |
struct | _TKR_8strips1_bf |
Maps out the second word of the 3 strip address pattern words as bit fields. More... | |
struct | _TKR_8strips2_bf |
Maps out the third word of the 3 strip address pattern words as bit fields. More... | |
struct | _TKR_2strips |
Maps out the first word containing strip addresses. More... | |
union | _TKR_8strips0 |
Maps out the first word of the 3 strip address pattern words as bit fields and uninterpretted 32-bit integer. More... | |
union | _TKR_8strips1 |
Maps out the second word of the 3 strip address pattern words as bit fields and uninterpretted 32-bit integer. More... | |
union | _TKR_8strips2 |
Maps out the third word of the 3 strip address pattern words as bit fields and uninterpretted 32-bit integer. More... | |
Defines | |
#define | BYTE_ACCESS(_ba, _idx) _ba[_idx]; |
Addresses the TOT oriented byte array in a way that is compatiable with big or little endian machines. | |
#define | INIT_LAYERS(_lyrs, _accepts, _mlayers, _map, _layers, _hiLo, _cnt) |
Process the layer bit masks associated with the either X or Y layers. | |
#define | S2(_d0, _d1) ((_d0.bf.s2a << 4) | _d1.bf.s2b) |
Assembles the 2nd strip address from its two pieces. | |
#define | S5(_d1, _d2) ((_d1.bf.s5a << 8) | _d2.bf.s5b) |
Assembles the 5th strip address from its two pieces. | |
#define | RPROCESS(_strip, _cur, _lyrCnt, _lyr, _lyrs, _n, _c) |
Macro to process a strip address when starting a new cluster. | |
Typedefs | |
typedef _TKR_2strips_bf | TKR_2strips_bf |
Typedef for struct _TKR_2strips_bf. | |
typedef _TKR_8strips0_bf | TKR_8strips0_bf |
Typedef for struct _TKR_8strips0_bf. | |
typedef _TKR_8strips1_bf | TKR_8strips1_bf |
Typedef for struct _TKR_8strips1_bf. | |
typedef _TKR_8strips2_bf | TKR_8strips2_bf |
Typedef for struct _TKR_8strips2_bf. | |
typedef _TKR_2strips | TKR_2strips |
Typedef for struct _TKR_2strips_bf. | |
typedef _TKR_8strips0 | TKR_8strips0 |
Typedef for union _TKR_8strips0. | |
typedef _TKR_8strips1 | TKR_8strips1 |
Typedef for union _TKR_8strips1. | |
typedef _TKR_8strips2 | TKR_8strips2 |
Typedef for union _TKR_8strips2. | |
Functions | |
static int | init (QSE_tkrTwr *twr, QSE_tkrLyr *lyrsBuf[72], unsigned int a0, unsigned int a1, unsigned int a2) |
Initializes/extracts the layer information from the accept masks. | |
static void | unpackTots (QSE_tkrTwr *twr, const unsigned char *tots) |
Unpacks the TOTs. | |
static int | unpackTwr (QSE_tkrTwr *twr, const EBF_tkr *tkr, int maxwrds) |
Unpacks the data from one tower. The number of strips on this tower. | |
int | QSE_tkrUnpack (QSE_tkr *tkr, const EBF_dir *dir) |
Driver routine to unpack the specified TKR towers. | |
int | QSE_tkrUnpackInit (QSE_tkr *tkr) |
Performs one time initialization of a Track LAT record. | |
int | QSE_tkrUnpackSizeof (void) |
Returns the size, in bytes, of a QSE_tkr. | |
Variables | |
static const unsigned char | Map [18] |
The mapping of the entries in the layer accept list to the physical layer numbers. |
CVS $Id: QSE_tkrUnpack.c,v 1.6 2006/09/13 22:05:00 russell Exp $
|
Addresses the TOT oriented byte array in a way that is compatiable with big or little endian machines.
|
|
Value: { \ _mlayers = 0; \ while (_accepts) \ { \ int n; \ int layerNum; \ QSE_tkrLyr *layer; \ \ n = QSE_mapScanR (_accepts); \ _accepts = QSE_mapRemove (_accepts, n^31); \ layerNum = _map[n]; \ layer = &_layers[layerNum]; \ *_lyrs++ = layer; \ \ /* KLUDGE */ \ layer->tots[_hiLo] = _cnt; \ layer->nstrips = 0; \ _mlayers |= 1 << layerNum; \ _cnt += 1; \ } \ }
|
|
Value: { \ int adr = _strip; \ \ /* Store the strip, without the terminator */ \ *_cur++ = adr & ~(1 << 11); \ \ /* Check if their was a terminator */ \ if ((adr & (1 << 11))) \ { \ int cnt; \ QSE_tkrStrip *beg; \ \ /* Do the usual end of layer processing */ \ _lyrCnt -= 1; \ beg = _lyr->beg; \ cnt = _cur - beg; \ _lyr->nsplit = _lyr->nstrips; \ _lyr->nstrips = cnt; \ \ /* Is this the last layer ? */ \ if (_lyrCnt <= 0) { _c = _n; break; } \ \ _lyr = *_lyrs++; \ _cur = _lyr->beg + _lyr->nstrips; \ } \ }
|
|
Assembles the 2nd strip address from its two pieces.
|
|
Assembles the 5th strip address from its two pieces.
|
|
Typedef for struct _TKR_2strips_bf. The first 32-bit word containing strip addresses also contains the last 8 bits of the accept list. This structure maps these fields out as both an uninterpreted 32 bit value and as bit fields for easy access. |
|
Typedef for struct _TKR_2strips_bf. The first 32-bit word containing strip addresses also contains the last 8 bits of the accept list. This structure maps these fields out for easy access. |
|
Initializes/extracts the layer information from the accept masks.
|
|
Driver routine to unpack the specified TKR towers.
|
|
Performs one time initialization of a Track LAT record.
|
|
Returns the size, in bytes, of a QSE_tkr.
After allocating an QSE_tkr structure, the structure should be initialized using QSE_tkrUnpackInit(). |
|
Unpacks the TOTs.
|
|
Unpacks the data from one tower. The number of strips on this tower.
|
|
Initial value: { 1, 3, 5, 7, 9, 11, 13, 15, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16 } The accept list is processed as 4 pairs of cables. The first cable of the pair carries the even layers, the second carries the odd layers. The 4 pairs represent the X lo, X hi and Y lo, Y hi cable pairs. In general one would need to map all 72 layer ends, but because all cable pairs are identical, so the same map can be used for each. This mapping could have been easily handled in the INIT_LAYERS macro, but the cost would have been some additional arthimetic. The current set bit would have to be translated into a layer number by doubling it and adding 1 iff the current bit was greater than 8. The lookup method seems simpler and faster. |