GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCFG / V1-2-5 > lcfg / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

LCFG_p.h File Reference

Private definitions for the LAT configuration system (LCFG). More...

#include <RIM/RIM.h>
#include <PBS/FPA.h>
#include <LEM/list.h>

Classes

struct  LCFG_decode
 Structure used to hold information used in decoding the response to register read operations. More...

Enumerations

enum  {
  LCFG_DATAGRAM_SIZE = 1024 * 512,
  LCFG_N_DATAGRAMS = 4
}
 Constants used in sending data to the SSR. More...

Functions

unsigned LCFG_consume (RIM *rim, unsigned lcm, unsigned *key)
 Read configuration data.
unsigned LCFG_consumeMap (RIM_map *map, unsigned fid, unsigned *key)
 Read map data.
void LCFG_deleteDecode (RIM_decodeFn **decode)
 Free the memory previously allocated using LCFG_newDecode.
void LCFG_deleteLoad (RIM_loadFn **load)
 Free the memory previously allocated using LCFG_newLoad.
void LCFG_deleteRead (RIM_readFn **read)
 Free the memory previously allocated using LCFG_newRead.
unsigned LCFG_finishLoad (LEM_micr *cr)
 Finish a load operation.
unsigned LCFG_finishRead (LEM_micr *cr)
 Finish a read operation.
RIM_decodeFn ** LCFG_newDecode (void)
 Build an array of function pointers associating RIM_type to a function that decodes the payloads.
RIM_loadFn ** LCFG_newLoad (void)
 Build an array of function pointers associating RIM_type to a function that loads the registers of that type.
RIM_readFn ** LCFG_newRead (void)
 Build an array of function pointers associating RIM_tye to a function that reads the registers of that type.
unsigned LCFG_record (RIM *rim, FPA_fcb *fpa)
 Send the RIM to the SSR.
unsigned LCFG_setTrigger (RIM *rim, int enable, int marker, LEM_micr *cr)
 Enable or disable triggers.


Detailed Description

Private definitions for the LAT configuration system (LCFG).

Author:
James Swain & Owen Saxton
Id
LCFG_p.h,v 1.4 2011/03/27 17:13:33 saxton Exp

Enumeration Type Documentation

anonymous enum

Constants used in sending data to the SSR.

Enumerator:
LCFG_DATAGRAM_SIZE  Each datagram is 128K words.
LCFG_N_DATAGRAMS  Number of datagrams available.


Function Documentation

unsigned LCFG_consume ( RIM *  rim,
unsigned  lcm,
unsigned *  key 
)

Read configuration data.

This routine reads a configuration master file then reads each file in the master file into a RIM structure.

Parameters:
rim Pointer to the RIM to repopulate with the configuration information
lcm File ID of the LAT configuration master file
key Pointer to location to place the key of file lcm
Return values:
LCFG_SUCCESS if all goes well
LCFG_BADFOPEN if the fid, or any of the names the configuration master file contains, does not match a valid file.
LCFG_BADTYPE if the file contains a bad type identifier
LCFG_BADREAD if an error occurs whilst the file is being read

References fileClose(), fileOpen(), fileReadData(), fileReadRecd(), _fileParm::name, and _fileParm::versn.

Referenced by LCFG_cache().

unsigned LCFG_consumeMap ( RIM_map *  map,
unsigned  fid,
unsigned *  key 
)

Read map data.

This routine reads a map data file into a map structure.

Parameters:
map Map structure to populate from file
fid ID of the file containing the data to use
key Pointer to location to place the key of file fid
Return values:
LCFG_SUCCESS if all goes well
LCFG_BADFOPEN if the fid does not match a valid file
LCFG_BADREAD if an error occurs whilst the file is being read

References fileClose(), fileKey(), fileOpen(), fileReadData(), fileReadRecd(), _fileParm::name, and _fileParm::versn.

Referenced by LCFG_ignore().

void LCFG_deleteDecode ( RIM_decodeFn **  decode  ) 

Free the memory previously allocated using LCFG_newDecode.

Parameters:
decode Pointer to an allocated array of function pointers

Referenced by LCFG_teardown().

void LCFG_deleteLoad ( RIM_loadFn **  load  ) 

Free the memory previously allocated using LCFG_newLoad.

Parameters:
load Pointer to an allocated array of function pointers

Referenced by LCFG_teardown().

void LCFG_deleteRead ( RIM_readFn **  read  ) 

Free the memory previously allocated using LCFG_newRead.

Parameters:
read Pointer to an allocated array of function pointers

Referenced by LCFG_teardown().

unsigned LCFG_finishLoad ( LEM_micr *  cr  ) 

Finish a load operation.

The supplied command list is queued and completion is waited for if it has outstanding items on it.

Parameters:
cr Multi-item command-response list used to load the registers
Return values:
LCFG_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

Referenced by LCFG_configure(), LCFG_loadAfeConfig(), LCFG_loadCfeConfig0(), LCFG_loadCfeConfig1(), LCFG_loadTfeDac(), and LCFG_loadTkrSplits().

unsigned LCFG_finishRead ( LEM_micr *  cr  ) 

Finish a read operation.

The supplied command list is queued and completion is waited for if it has outstanding items on it.

Parameters:
cr Multi-item command-response list used to read the registers
Return values:
LCFG_SUCCESS Always

References decodeList().

Referenced by LCFG_capture(), and readSPT().

RIM_decodeFn** LCFG_newDecode ( void   ) 

Build an array of function pointers associating RIM_type to a function that decodes the payloads.

Returns:
Pointer to an allocated array of RIM_decodeFn function pointers

References decodeAEM(), decodeAFE(), decodeARC(), decodeCCC(), decodeCFE(), decodeCRC(), decodeGEM(), decodeROI(), decodeSCH(), decodeSPT(), decodeTAM(), decodeTCC(), decodeTDC(), decodeTEM(), decodeTFE(), decodeTIC(), decodeTIE(), decodeTRC(), and decodeWIN().

Referenced by LCFG_initialise().

RIM_loadFn** LCFG_newLoad ( void   ) 

Build an array of function pointers associating RIM_type to a function that loads the registers of that type.

Returns:
Pointer to an allocated array of RIM_loadFn function pointers

References loadAEM(), loadAFE(), loadARC(), loadCCC(), loadCFE(), loadCRC(), loadGEM(), loadROI(), loadSCH(), loadSPT(), loadTAM(), loadTCC(), loadTDC(), loadTEM(), loadTFE(), loadTIC(), loadTIE(), loadTRC(), and loadWIN().

Referenced by LCFG_initialise().

RIM_readFn** LCFG_newRead ( void   ) 

Build an array of function pointers associating RIM_tye to a function that reads the registers of that type.

Returns:
Pointer to an allocated array of RIM_readFn function pointers

References readAEM(), readAFE(), readARC(), readCCC(), readCFE(), readCRC(), readGEM(), readROI(), readSCH(), readSPT(), readTAM(), readTCC(), readTDC(), readTEM(), readTFE(), readTIC(), readTIE(), readTRC(), and readWIN().

Referenced by LCFG_initialise().

unsigned LCFG_record ( RIM *  rim,
FPA_fcb *  fpa 
)

Send the RIM to the SSR.

Parameters:
rim Pointer to the RIM structure to send to the SSR
fpa Pointer to the fixed packet allocator that will provide storage for the datagrams produced by this function
Returns:
One of the error codes from ITC_send, LCFG_OUTSIZE if there is a coding error and one of the contributions will not fit into an otherwise empty datagram, LCFG_SUCCESS if all goes well.

References addData(), endDgm(), SSR_pkt::fpa, SSR_pkt::qitem, startCtb(), and startDgm().

Referenced by LCFG_consign().

unsigned LCFG_setTrigger ( RIM *  rim,
int  enable,
int  marker,
LEM_micr *  cr 
)

Enable or disable triggers.

This routine enables or disables LAT triggers. If the marker parameter is non-zero, the LAT is first configured to broadcast a trigger message to all CPUs upon receipt of a solicited trigger, a solicited trigger is issued, and the configuration restored from the RIM data.

Parameters:
rim RIM structure containing LAT configuration data
enable If non-zero, triggers are anabled; otherwise disabled
marker If non-zero, causes a solicited trigger with this value in the event data.
cr Pointer to the multi-item command/response list.
Return values:
LCFG_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

Referenced by LCFG_disableTriggers(), and LCFG_enableTriggers().


Generated on Tue Nov 29 16:48:10 2011 by  doxygen 1.5.8