GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > RIM / V0-0-2

Constituent: rim     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

latp.c File Reference

LATp operations. More...

#include "latp_p.h"
#include "error_p.h"
#include "map_p.h"
#include "data_p.h"
#include "AG_initRIM_p.h"
#include "AG_descriptions_s.h"
#include "AG_addr_s.h"
#include "AG_fldEnums_s.h"
#include "AG_regEnums_s.h"
#include "number.ic"
#include "LEM/defs.h"

Include dependency graph for latp.c:


Functions

unsigned traverseRead (RIM *rim, LEM_read *lem_r, RIM_type type, unsigned *index, RIM_addr *addr, unsigned depth, const RIM_map *ign)
 Traverses the LAT reading the configuration for all nodes.
unsigned traverseLoad (RIM *rim, LEM_load *lem_l, RIM_type type, unsigned *index, RIM_addr *addr, unsigned depth)
 Traverses the LAT loading the configuration for any instances of the current component whose configuration differs from the default.
static unsigned loadLowSPT (LEM_load *lem_l, RIM_loadFn **loadFn, const RIM_addr *addr, short low)
 Set the mode registers on the low talking TFEs.
static unsigned loadHighSPT (LEM_load *lem_l, RIM_loadFn **loadFn, const RIM_addr *addr, short high)
 Set the mode registers on the high talking GTFEs.
static unsigned loadSimple (RIM *rim, LEM_load *lem_l, RIM_type type)
 Load a generic LAT component.
static unsigned loadSplit (RIM *rim, LEM_load *lem_l, RIM_loadFn **loadFn)
 Load the layer splits.
static unsigned loadTracker (RIM *rim, LEM_load *lem_l, RIM_type type)
 Load the tracker front ends from the configuration tree.
static unsigned loadCpt (RIM *rim, LEM_load *lem_l, RIM_type type, unsigned index, const RIM_addr *addr)
 Sets all the registers of the target component.
static unsigned readSimple (RIM *rim, LEM_read *lem_r, RIM_type type, const RIM_map *ign)
 Read the registers of one of the "simple" types.
static unsigned readSplit (RIM *rim, LEM_read *lem_r, const RIM_map *ign)
 Reads the current layer splits from the TRC TFE_CNT settings.
static unsigned readTracker (RIM *rim, LEM_read *lem_r, RIM_type type, const RIM_map *ign)
 Reads the current TFE settings.
static unsigned readCpt (RIM *rim, LEM_read *lem_r, RIM_type type, unsigned index, const RIM_addr *addr)
 Reads all the registers of the current component.
unsigned RIM_read (RIM *rim, void *param, RIM_readFn **readFn, RIM_decodeFn **decodeFn, const RIM_map *ign)
 Populate the RIM structure with the current state of the LAT.
unsigned RIM_load (RIM *rim, void *param, RIM_loadFn **loadFn)
 Loads the LAT with the configuration held in imm.
unsigned RIM_loadCFE (RIM *rim, unsigned val, unsigned mask, unsigned shift, unsigned regId, void *param, RIM_loadFn **loadFn)
 Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the val suitably masked and shifted.
unsigned RIM_loadCFEmask (RIM *rim, unsigned mask, void *param, RIM_loadFn **loadFn)
 Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the val suitably masked and shifted.
unsigned RIM_loadTDC (RIM *rim, unsigned val, unsigned mask, unsigned shift, unsigned regId, void *param, RIM_loadFn **loadFn)
 Load one of the TFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the val suitably masked and shifted.
unsigned RIM_enableAllAFE (RIM *rim, void *param, RIM_loadFn **loadFn)
 Enable all channels of the ACD for charge injection calibration.
unsigned RIM_disableAllAFE (RIM *rim, void *param, RIM_loadFn **loadFn)
 Disable all channels of the ACD for charge injection calibration.
unsigned RIM_enableAFE (RIM *rim, unsigned rc, unsigned fe, void *param, RIM_loadFn **loadFn)
 Enable one channel of the ACD for charge injection calibration.
void RIM_setSPT (void *ptr, unsigned short value, unsigned isHigh)
 Decode the result item use to populate a split.
void RIM_correct (RIM *orig, RIM *capt)
 Copy select portions of an original RIM into a copy, to ensure that the subsequent comparison will succeed.

Detailed Description

LATp operations.

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

Function Documentation

unsigned loadCpt RIM rim,
LEM_load lem_l,
RIM_type  type,
unsigned  index,
const RIM_addr addr
[inline, static]
 

Sets all the registers of the target component.

Parameters:
rim RIM structure containing the values to load onto the LAT
lem_l Pointer to the command/response lists to use for loading the LAT
type Component type
index Componenet instance being loaded
addr Hierarchical representation of the index (address of the instance)

unsigned loadHighSPT LEM_load lem_l,
RIM_loadFn **  loadFn,
const RIM_addr addr,
short  high
[inline, static]
 

Set the mode registers on the high talking GTFEs.

Parameters:
lem_l Pointer to the command and response lists used for loading the LAT
loadFn Type ordered array of pointers to functions that load the LAT registers
addr Pointer to an address structure used for loading the TFEs and TRC
high ID of the lowest high talking TFE

unsigned loadLowSPT LEM_load lem_l,
RIM_loadFn **  loadFn,
const RIM_addr addr,
short  low
[inline, static]
 

Set the mode registers on the low talking TFEs.

Parameters:
lem_l Pointer to the command and response lists used for loading the LAT
loadFn Type ordered array of pointers to functions that load the LAT registers
addr Pointer to an address strcture used for loading the TFEs and TRC
low ID of the highest low talking TFE

unsigned loadSimple RIM rim,
LEM_load lem_l,
RIM_type  type
[inline, static]
 

Load a generic LAT component.

Parameters:
rim RIM structure containing the values to load onto the LAT
lem_l Pointer to command and response lists used for loading the LAT
type Type of LAT component to load

unsigned loadSplit RIM rim,
LEM_load lem_l,
RIM_loadFn **  loadFn
[inline, static]
 

Load the layer splits.

Parameters:
rim RIM structure containing the values to load onto the LAT
lem_l Pointer to the command response lists used for loading the LAT
loadFn Type ordered array of pointers to functions that load the LAT registers

unsigned loadTracker RIM rim,
LEM_load lem_l,
RIM_type  type
[inline, static]
 

Load the tracker front ends from the configuration tree.

Parameters:
rim RIM structure containing the values to load onto the LAT
lem_l Pointer to the command/response lists used for loading the LAT
type Type of component being loaded, either TFE or TDC

unsigned readCpt RIM rim,
LEM_read lem_r,
RIM_type  type,
unsigned  index,
const RIM_addr addr
[inline, static]
 

Reads all the registers of the current component.

Parameters:
rim Pointer to the structure to populate from the LAT register values
lem_r Command/response lists to use for the read
type Cpt type being read
index Instance of the component being read
addr Hierarchical representation of the index (address of the instance to read).

unsigned readSimple RIM rim,
LEM_read lem_r,
RIM_type  type,
const RIM_map ign
[inline, static]
 

Read the registers of one of the "simple" types.

Parameters:
rim RIM structure being populated by the read operation
lem_r Pointer to the command/response lists and other structures used to read the LAT
type Component type to read
ign Map of the sections of the LAT known to be bad or not present so can be ignored.

unsigned readSplit RIM rim,
LEM_read lem_r,
const RIM_map ign
[inline, static]
 

Reads the current layer splits from the TRC TFE_CNT settings.

Parameters:
rim Pointer to the structure to populate from the LAT register values
lem_r Pointer to the command response lists
ign Map of the sections of the LAT known to be bad or not present so can be ignored.

unsigned readTracker RIM rim,
LEM_read lem_r,
RIM_type  type,
const RIM_map ign
[inline, static]
 

Reads the current TFE settings.

Parameters:
rim Pointer to the structure to populate from the LAT register values
lem_r Pointer to the command/response lists used for reading the LAT
type Component type being read (either TFE or TDC)
ign Map of the sections of the LAT known to be bad ornot present so can be ignored.

void RIM_correct RIM orig,
RIM capt
 

Copy select portions of an original RIM into a copy, to ensure that the subsequent comparison will succeed.

Parameters:
orig Orignal RIM
capt New copy of the RIM (probably captured from the LAT)

unsigned RIM_disableAllAFE RIM rim,
void *  param,
RIM_loadFn **  loadFn
 

Disable all channels of the ACD for charge injection calibration.

Parameters:
rim Pointer to the cached in-memory model of the LAT registers
param Parameter passed through to the load function
loadFn Type ordered array of functions that load a given type of LAT register
param Parameter passed through to the load function

unsigned RIM_enableAFE RIM rim,
unsigned  rc,
unsigned  fe,
void *  param,
RIM_loadFn **  loadFn
 

Enable one channel of the ACD for charge injection calibration.

Parameters:
rim Pointer to the cached in-memory model of the LAT registers
rc ID of the FREE board holding the channel to enable
fe ID of the channel to enable
param Parameter passed through to the load function
loadFn Type ordered array of functions that load a given type of LAT register

unsigned RIM_enableAllAFE RIM rim,
void *  param,
RIM_loadFn **  loadFn
 

Enable all channels of the ACD for charge injection calibration.

Parameters:
rim Pointer to the cached in-memory model of the LAT registers
loadFn Type ordered array of pointers to functions that load the LAT registers
param Parameter passed through to the load function

unsigned RIM_load RIM rim,
void *  param,
RIM_loadFn **  loadFn
 

Loads the LAT with the configuration held in imm.

Parameters:
rim Pointer to the RIM structure to populate from the LAT
param Pointer passed through to the loadRegFn
loadFn Type ordered array of pointers to functions that load the LAT registers

unsigned RIM_loadCFE RIM rim,
unsigned  val,
unsigned  mask,
unsigned  shift,
unsigned  regId,
void *  param,
RIM_loadFn **  loadFn
 

Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the val suitably masked and shifted.

Parameters:
rim Pointer to the cached in-memory model of the LAT registers
val Value to use in place of some part of one of the CFE registers
mask Bit mask of the fields of the register being replaced
shift Offset into the register of the LSB of the value
regId The register ID (from LEM/defs.h) of the register being manipulated
param Parameter passed through to the load function
loadFn Type ordered array of pointers to functions that load the LAT registers

unsigned RIM_loadCFEmask RIM rim,
unsigned  mask,
void *  param,
RIM_loadFn **  loadFn
 

Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the val suitably masked and shifted.

Parameters:
rim Pointer to the cached in-memory model of the LAT registers
mask CFEs to enable for calibration
param Parameter passed through to the load function
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well

unsigned RIM_loadTDC RIM rim,
unsigned  val,
unsigned  mask,
unsigned  shift,
unsigned  regId,
void *  param,
RIM_loadFn **  loadFn
 

Load one of the TFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the val suitably masked and shifted.

Parameters:
rim Pointer to the in-memory model holding the LAT registers
val Value to use in place of some part of one of the TFE registers
mask Bit mask of the fields of the register being replaced
shift Offset into the register of the LSB of the value
regId The register ID (from LEM/defs.h) of the register being manipulated
loadFn Type ordered array of pointers to functions that load the LAT registers
param Parameter passed through to the load function

unsigned RIM_read RIM rim,
void *  param,
RIM_readFn **  readFn,
RIM_decodeFn **  decodeFn,
const RIM_map ign
 

Populate the RIM structure with the current state of the LAT.

Parameters:
rim Pointer to the RIM structure to populate from the LAT
param Pointer passed through to the readRegFn
readFn Type ordered array of pointers to functions that read the LAT registers
decodeFn Type ordered array of pointers to functions that decode the register responses
ign Map of the sections of the LAT known to be bad or not present so can be ignored.

void RIM_setSPT void *  ptr,
unsigned short  value,
unsigned  isHigh
 

Decode the result item use to populate a split.

Parameters:
ptr Pointer to memory location to put decoded value
value One of the split fields
isHigh Indicates which of the split fields this is

unsigned traverseLoad RIM rim,
LEM_load lem_l,
RIM_type  type,
unsigned *  index,
RIM_addr addr,
unsigned  depth
 

Traverses the LAT loading the configuration for any instances of the current component whose configuration differs from the default.

Parameters:
rim RIM structure containing the values to load onto the LAT
lem_l Pointer to the command response lists used for loading the LAT
type Type of component to load
index Pointer to the index of the next instance to load
addr Hierarchical representation of the index
depth Number of recursive calls to traverse_Load

unsigned traverseRead RIM rim,
LEM_read lem_r,
RIM_type  type,
unsigned *  index,
RIM_addr addr,
unsigned  depth,
const RIM_map ign
 

Traverses the LAT reading the configuration for all nodes.

Parameters:
rim Pointer to the structure to populate from the LAT register values
lem_r Pointer to the command/response lists used for reading the LAT
type The type of component to read
index Pointer to a variable tracking the current instance being read
addr Pointer to an address structure containing the same information as index, but in heirarchical form
depth Number of times this function has been recursively called.
ign Map of the sections of the LAT known to be bad or not present so can be ignored.


Generated on Thu Apr 13 23:39:47 2006 by  doxygen 1.4.4