GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / dev > latc_cmn / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

addr.c File Reference

Converts flat index to hierarchical address. More...

#include <LATC/LATC_msgs.h>
#include <addr.h>
#include <AG_addr_s.h>
#include <AG_number_s.h>
#include <MSG/MSG_pubdefs.h>

Functions

unsigned LATC_getIndex (const LATC_addr *addr, unsigned *index, LATC_type type)
 Convert hierarchical bit addressing to flat addressing.
unsigned LATC_getAddress (LATC_addr *addr, unsigned index, LATC_type type)
 Convert hierarchical bit addressing to flat addressing.
void LATC_layerLow (const Layer_addr *layer, TEM_addr *tem)
 Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.
void LATC_layerHigh (const Layer_addr *layer, TEM_addr *tem)
 Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.

Variables

static const char tcc_lkup [4][2]
 Gives the TCC ID for a given "end" of the requested layer.


Detailed Description

Converts flat index to hierarchical address.

Author:
James Swain -- jswain@slac.stanford.edu

Function Documentation

unsigned LATC_getAddress ( LATC_addr addr,
unsigned  index,
LATC_type  type 
)

Convert hierarchical bit addressing to flat addressing.

Parameters:
addr Address to convert
type Type of address to conver
index Index corresponding to address
Returns:
One of LATC_ERR, LATC_OK on succes Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->LATC converter, but is documented here since it is a storage convention.

References LATC_addr::cpt.

Referenced by LATC_contrast().

unsigned LATC_getIndex ( const LATC_addr addr,
unsigned *  index,
LATC_type  type 
)

Convert hierarchical bit addressing to flat addressing.

Parameters:
addr Address to convert
type Type of address to conver
index Index corresponding to address
Return values:
LATC_SUCCESS if the address is successfully converted to an index
LATC_BADBCAST if the address contains a mixture of broadcast and unicast components
LATC_BADADDR if any component of the address is outside the allowable range for this type Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->LATC converter, but is documented here since it is a storage convention.

References LATC_addr::cpt.

Referenced by LATC_deleteData(), LATC_get(), LATC_set(), mapIndex(), and mapRange().

void LATC_layerHigh ( const Layer_addr layer,
TEM_addr tem 
)

Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.

Parameters:
layer Address of the TFE / SPT in terms of layers
tem Address of the TFE / TRC in terms of CC/RC Note that TFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->LATC converter, but is documented here since it is a storage convention.

References TEM_addr::cc, Layer_addr::fe, TEM_addr::fe, Layer_addr::la, TEM_addr::rc, tcc_lkup, Layer_addr::to, and TEM_addr::to.

void LATC_layerLow ( const Layer_addr layer,
TEM_addr tem 
)

Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.

Parameters:
layer Address of the TFE / SPT in terms of layers
tem Address of the TFE / TRC in terms of CC/RC Note that TFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->LATC converter, but is documented here since it is a storage convention.

References TEM_addr::cc, Layer_addr::fe, TEM_addr::fe, Layer_addr::la, TEM_addr::rc, tcc_lkup, Layer_addr::to, and TEM_addr::to.


Variable Documentation

tcc_lkup [static]

Initial value:

 { {0, 1},
                                     {3, 2},
                                     {6, 7},
                                     {5, 4} }
Gives the TCC ID for a given "end" of the requested layer.

Since the pattern is repeating, take the layer index modulo 4 as the first index to the table and 0 for low or 1 for high as the second index to the table.

Referenced by LATC_layerHigh(), and LATC_layerLow().


Generated on Thu Apr 7 17:31:28 2011 by  doxygen 1.5.8