GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LRA / dev

Constituent: lra     Tag: mcp750


Interface   Data Structures   File List   Data Fields   Globals  

LRA.h File Reference

Public definitions for the register access routines. More...

#include "PBS/WCT.h"

Include dependency graph for LRA.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  _LRA_regSpec
 Structure to specify a register, or set of registers. More...
struct  _LRA_blkDesc
 Structure for register block descriptor. More...
struct  _LRA_cmptDesc
 Structure for component descriptor. More...
struct  _LRA_regData
 Structure to hold returned register data. More...
struct  _LRA_esrData
 Structure to hold returned error and status register data. More...
struct  _LRA_cmdStats
 Structure to hold command statistics. More...
struct  _LRA_rcvStats
 Structure to hold receive statistics. More...
struct  _LRA_xmtStats
 Structure to hold transmit/response statistics. More...
struct  _LRA_aemTrgStats
 Structure to hold AEM trigger statistics. More...
struct  _LRA_arcErrStats
 Structure to hold ARC event error statistics. More...
struct  _LRA_fifoStats
 Structure to hold CC FIFO statistics. More...
struct  _LRA_cntrStats
 Structure to hold simple counter statistics. More...
struct  _LRA_gemStats
 Structure to hold GEM statistics. More...
struct  _LRA_gemStats_V2
 Structure to hold GEM statistics, version 2. More...
struct  _LRA_gemStats_V1
 Structure to hold GEM statistics, version 1. More...
struct  _LRA_cruStats
 Structure to hold CRU statistics. More...
struct  _LRA_pduStats
 Structure to hold PDU statistics. More...
struct  _LRA_ebmStats
 Structure to hold EBM statistics. More...
struct  _LRA_aemStats
 Structure to hold AEM statistics. More...
struct  _LRA_temStats
 Structure to hold TEM statistics. More...
struct  _LRA_ticStats
 Structure to hold TIC statistics. More...
struct  _LRA_cccStats
 Structure to hold CCC statistics. More...
struct  _LRA_tccStats
 Structure to hold TCC statistics. More...
struct  _LRA_stats
 Structure to hold complete statistics. More...
struct  _LRA_stats_V2
 Structure to hold complete statistics, version 2. More...
struct  _LRA_stats_V1
 Structure to hold complete statistics, version 1. More...
struct  _LRA_ebmEventStats
 Structure to hold extracted EBM event statistics. More...
struct  _LRA_gemCntrStats
 Structure to hold extracted GEM counter statistics. More...

Typedefs

typedef enum _LRA_misc LRA_misc
 Miscellaneous definitions.
typedef enum _LRA_component LRA_component
 Component identifiers.
typedef enum _LRA_counts LRA_counts
 Conponent counts.
typedef enum _LRA_statsVersion LRA_statsVersion
 Statistics block version.
typedef _LRA_regSpec LRA_regSpec
 Structure to specify a register, or set of registers.
typedef _LRA_blkDesc LRA_blkDesc
 Structure for register block descriptor.
typedef _LRA_cmptDesc LRA_cmptDesc
 Structure for component descriptor.
typedef _LRA_regData LRA_regData
 Structure to hold returned register data.
typedef _LRA_esrData LRA_esrData
 Structure to hold returned error and status register data.
typedef _LRA_cmdStats LRA_cmdStats
 Structure to hold command statistics.
typedef _LRA_rcvStats LRA_rcvStats
 Structure to hold receive statistics.
typedef _LRA_xmtStats LRA_xmtStats
 Structure to hold transmit/response statistics.
typedef _LRA_aemTrgStats LRA_aemTrgStats
 Structure to hold AEM trigger statistics.
typedef _LRA_arcErrStats LRA_arcErrStats
 Structure to hold ARC event error statistics.
typedef _LRA_fifoStats LRA_fifoStats
 Structure to hold CC FIFO statistics.
typedef _LRA_cntrStats LRA_cntrStats
 Structure to hold simple counter statistics.
typedef _LRA_gemStats LRA_gemStats
 Structure to hold GEM statistics.
typedef _LRA_gemStats_V2 LRA_gemStats_V2
 Structure to hold GEM statistics, version 2.
typedef _LRA_gemStats_V1 LRA_gemStats_V1
 Structure to hold GEM statistics, version 1.
typedef _LRA_cruStats LRA_cruStats
 Structure to hold CRU statistics.
typedef _LRA_pduStats LRA_pduStats
 Structure to hold PDU statistics.
typedef _LRA_ebmStats LRA_ebmStats
 Structure to hold EBM statistics.
typedef _LRA_aemStats LRA_aemStats
 Structure to hold AEM statistics.
typedef _LRA_temStats LRA_temStats
 Structure to hold TEM statistics.
typedef _LRA_ticStats LRA_ticStats
 Structure to hold TIC statistics.
typedef _LRA_cccStats LRA_cccStats
 Structure to hold CCC statistics.
typedef _LRA_tccStats LRA_tccStats
 Structure to hold TCC statistics.
typedef _LRA_stats LRA_stats
 Structure to hold complete statistics.
typedef _LRA_stats_V2 LRA_stats_V2
 Structure to hold complete statistics, version 2.
typedef _LRA_stats_V1 LRA_stats_V1
 Structure to hold complete statistics, version 1.
typedef _LRA_ebmEventStats LRA_ebmEventStats
 Structure to hold extracted EBM event statistics.
typedef _LRA_gemCntrStats LRA_gemCntrStats
 Structure to hold extracted GEM counter statistics.

Enumerations

enum  _LRA_misc {
  LRA_WILD = 255,
  LRA_ACTIVE = 254
}
 Miscellaneous definitions. More...
enum  _LRA_component {
  LRA_CPT_GEM = 1,
  LRA_CPT_EBM = 2,
  LRA_CPT_PDU0 = 3,
  LRA_CPT_PDU1 = 4,
  LRA_CPT_CRU = 5,
  LRA_CPT_TEM = 6,
  LRA_CPT_TIC = 7,
  LRA_CPT_CCC = 8,
  LRA_CPT_CRC = 9,
  LRA_CPT_CFE = 10,
  LRA_CPT_TCC = 11,
  LRA_CPT_TRC = 12,
  LRA_CPT_TFE = 13,
  LRA_CPT_AEM = 14,
  LRA_CPT_ARC = 15,
  LRA_CPT_AFE = 16,
  LRA_CPT_SIUE = 33,
  LRA_CPT_SIU0 = 34,
  LRA_CPT_SIU1 = 35,
  LRA_CPT_EPU0 = 36,
  LRA_CPT_EPU1 = 37,
  LRA_CPT_EPU2 = 38,
  LRA_CPT_BCST = LRA_WILD
}
 Component identifiers.
enum  _LRA_counts {
  LRA_N_TEM = 16,
  LRA_N_CCC = 4,
  LRA_N_TCC = 8,
  LRA_N_CRC = 4,
  LRA_N_TRC = 9,
  LRA_N_ARC = 12,
  LRA_N_CFE = 12,
  LRA_N_TFE = 24,
  LRA_N_AFE = 18
}
 Conponent counts. More...
enum  _LRA_statsVersion {
  LRA_STATS_MAJOR = 3,
  LRA_STATS_MINOR = 0
}
 Statistics block version. More...

Functions

unsigned LRA_bufSize (LRA_regSpec *rSpec, unsigned *size)
 Get the size needed for the returned data buffer.
unsigned LRA_clearStats (void)
 Clear the register statistics.
unsigned LRA_ctrl (LRA_regSpec *rSpec)
 Perform a control operation.
unsigned LRA_findCmpt (int cmpnt, int block, LRA_cmptDesc **desc)
 Find component in list.
unsigned LRA_getEbmEventStats (LRA_ebmEventStats *stats)
 Get a copy of the EBM event statistics.
unsigned LRA_getGemCntrStats (LRA_gemCntrStats *stats)
 Get a copy of the GEM counters.
unsigned LRA_getStats (LRA_stats *stats)
 Get a copy of the register statistics.
unsigned LRA_initialize (unsigned period)
 Initialize the register access system.
unsigned LRA_lam (unsigned cmpt, unsigned tem)
 Perform a look-at-me operation.
unsigned LRA_lamLcb (unsigned cmpt, unsigned value, unsigned mask)
 Perform a look-at-me directed to an LCB.
unsigned LRA_latReset (void)
 Perform a LAT reset.
unsigned LRA_load (LRA_regSpec *rSpec, long long *value)
 Perform a register load operation.
unsigned LRA_lookupBlk (LRA_cmptDesc *cDesc, char *bName, int *block)
 Lookup register block in list.
unsigned LRA_lookupCmpt (char *cName, LRA_cmptDesc **desc)
 Lookup component in list.
unsigned LRA_maxBufSize (unsigned *size)
 Get the maximum size needed for the register data buffer.
unsigned LRA_read (LRA_regSpec *rSpec, LRA_regData *data)
 Perform a register read operation.
unsigned LRA_readEsr (LRA_esrData *esr)
 Read the error and status registers.
unsigned LRA_send (LRA_regSpec *rSpec)
 Send register values to the spacecraft.
unsigned LRA_sendEsr (void)
 Send the error and status register values to the spacecraft.
unsigned LRA_sendStats (void)
 Send statistics data to the spacecraft.
unsigned LRA_setStatsPeriod (unsigned period)
 Set the statistics update period.
unsigned LRA_sizeofEbmEventStats (void)
 Get the size of the EBM event statistics block.
unsigned LRA_sizeofGemCntrStats (void)
 Get the size of the GEM counters block.
unsigned LRA_sizeofStats (void)
 Get the size of the LRA statistics block.
unsigned LRA_start (void)
 Start the register access task.
unsigned LRA_startStats (void)
 Start register statistics acquisition.
unsigned LRA_stop (void)
 Stop the register access task.
unsigned LRA_stopStats (void)
 Stop register statistics acquisition.
unsigned LRA_terminate (void)
 Terminate register access.

Detailed Description

Public definitions for the register access routines.

Author:
Owen H Saxton
Id
LRA.h,v 1.12 2007/11/22 00:39:52 saxton Exp

Enumeration Type Documentation

enum _LRA_counts
 

Conponent counts.

Enumerator:
LRA_N_TEM  Number of TEMs.
LRA_N_CCC  Number of CAL cable controllers.
LRA_N_TCC  Number of TKR cable controllers.
LRA_N_CRC  Number of CAL readout controllers.
LRA_N_TRC  Number of TKR readout controllers.
LRA_N_ARC  Number of ACD readout controllers.
LRA_N_CFE  Number of CAL front-ends.
LRA_N_TFE  Number of TKR front-ends.
LRA_N_AFE  Number of ACD front-ends.

enum _LRA_misc
 

Miscellaneous definitions.

Enumerator:
LRA_WILD  General purpose wild-card value.
LRA_ACTIVE  TEM or ARC specifier, active only.

enum _LRA_statsVersion
 

Statistics block version.

Enumerator:
LRA_STATS_MAJOR  Major version number.
LRA_STATS_MINOR  Minor version number.


Function Documentation

unsigned LRA_bufSize LRA_regSpec rSpec,
unsigned *  size
 

Get the size needed for the returned data buffer.

This routine returns the size needed for the buffer used to hold the read register data.

Parameters:
rSpec The specifier for the register(s) to be read
size The address of the returned size, in bytes
Return values:
LRA_SUCCESS Register specifier is valid
LRA_INVCMPT Invalid component number
LRA_INVREG Invalid register number
LRA_INVBLOCK Invalid register block number
LRA_INVTEM Invalid TEM number
LRA_INVCC Invalid cable controller number
LRA_INVRC Invalid readout controller number
LRA_INVFE Invalid front-end number

unsigned LRA_clearStats void   ) 
 

Clear the register statistics.

The register statistics are cleared, with controlled access.

Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_ctrl LRA_regSpec rSpec  ) 
 

Perform a control operation.

The internal routine is called to carry out the specified control operation on the specified component.

Parameters:
rSpec The register specifier, specifying which instances of which component are to be operated on. It contains the component, the register block (EBM only), the TEM number, cable controller number, readout controller number, front-end number, and control function. The TEM, CC, RC and FE may be set individually to the value LRA_WILD to cause the operation to be performed on all instances.
Return values:
LRA_SUCCESS The operation was successful
LRA_INVCMPT Invalid component number
LRA_INVCNTRL Invalid control operation
LRA_INVTEM Invalid TEM number
LRA_INVCC Invalid cable controller number
LRA_INVRC Invalid readout controller number
LRA_INVFE Invalid front-end number
ITC_SENDTID Destination task (LRA) not started
LCBD_RTOERR Operation timed out

unsigned LRA_findCmpt int  cmpnt,
int  block,
LRA_cmptDesc **  desc
 

Find component in list.

The component number is used to locate and return the matching component descriptor, and the block number is checked for validity.

Parameters:
cmpnt The component number
block The block number
desc The address of a pointer to receive the address of the component descriptor.
Return values:
LRA_SUCCESS Parameters are valid
LRA_INVCMPT Invalid component number
LRA_INVBLOCK Invalid register block number

unsigned LRA_getEbmEventStats LRA_ebmEventStats stats  ) 
 

Get a copy of the EBM event statistics.

The EBM event statistics are copied, with controlled access. Only the operation counts are copied.

Parameters:
stats The address of the area to which the statistics are to be copied
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_getGemCntrStats LRA_gemCntrStats stats  ) 
 

Get a copy of the GEM counters.

The GEM extended counters are copied, with controlled access. Only the counter values are copied.

Parameters:
stats The address of the area to which the counters are to be copied
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_getStats LRA_stats stats  ) 
 

Get a copy of the register statistics.

The register statistics are copied, with controlled access.

Parameters:
stats The address of the area to which the statistics are to be copied
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_initialize unsigned  period  ) 
 

Initialize the register access system.

This routine sets up the apparatus needed by the register access system.

Parameters:
period The time, in 1/100 seconds, to be used between successive updates of the register statistics. If zero, the default value is used.
Return values:
LRA_SUCCESS Initialization was successful
LRA_ALRDINIT Already initialized
LRA_INSFMEM Insufficient memory for initialization
LRA_FPAFAIL FPA initialization failed
LRA_NOSEMS Unable to create semaphores
LRA_NOMUTEX Unable to create a mutex
LRA_NOTIMER Unable to create a timer
RBM_ALOCFAIL Memory allocation failure
RBM_FPAINIT FPA initialization failure
RBM_NOTINIT RBM system not initialized
ITC_ALOCFAIL Cannot allocate memory
ITC_NOTINIT ITC control block does not exist
ITC_TASKQUEU Cannot create task queues
ITC_CTLSTAT ITC control block not in state initialized
ITC_QUEUINIT Queue initialization failed
ITC_VARRNG Out of range variable detected
ITC_APIDDBL Table entry for this APID already in use

unsigned LRA_lam unsigned  cmpnt,
unsigned  tem
 

Perform a look-at-me operation.

The internal routine is called to send a look-at-me to the specified component.

Parameters:
cmpnt The ID of the component to be sent a look-at-me
tem The TEM number to use if the component is TEM
Return values:
LRA_SUCCESS The operation was successful
LRA_INVCMPT Invalid component number
LRA_INVTEM Invalid TEM number
ITC_SENDTID Destination task (LRA) not started
LCBD_RTOERR Operation timed out

unsigned LRA_lamLcb unsigned  cmpnt,
unsigned  value,
unsigned  mask
 

Perform a look-at-me directed to an LCB.

The internal routine is called to send a look-at-me to the specified LCB component.

Parameters:
cmpnt The ID of the LCB component to be sent a look-at-me
value The value to be sent
mask The mask specifying which bits of value to use
Return values:
LRA_SUCCESS The operation was successful
LRA_INVCMPT Invalid component number
ITC_SENDTID Destination task (LRA) not started
LCBD_RTOERR Operation timed out

unsigned LRA_latReset void   ) 
 

Perform a LAT reset.

The whole LAT is reset.

Return values:
LRA_SUCCESS Reset was successful
LCBD_RTOERR Operation timed out

unsigned LRA_load LRA_regSpec rSpec,
long long *  value
 

Perform a register load operation.

The internal routine is called to load the specified value into one or more instances of the specified register.

Parameters:
rSpec The register specifier, specifying which register (or set of registers) is (are) to be loaded. This contains the device, the register block, the TEM number, cable controller number, readout controller number, front-end number, and register number. The four parameters tem, cc, rc and fe may be set individually to the value LRA_WILD to cause the value to be loaded in all places.
value The address of the value to be loaded into the specified instances of the register.
Return values:
LRA_SUCCESS Load was successful
LRA_INVCMPT Invalid component number
LRA_INVREG Invalid register number
LRA_INVBLOCK Invalid register block number
LRA_INVTEM Invalid TEM number
LRA_INVCC Invalid cable controller number
LRA_INVRC Invalid readout controller number
LRA_INVFE Invalid front-end number
ITC_SENDTID Destination task (LRA) not started
LCBD_RTOERR Operation timed out

unsigned LRA_lookupBlk LRA_cmptDesc cDesc,
char *  bName,
int *  block
 

Lookup register block in list.

The register block name is used to locate and return the matching block number in the list of valid blocks for the given component.

Parameters:
cDesc The component descriptor.
bName The register block name.
block The address of an integer to receive the register block number.
Return values:
LRA_SUCCESS Success
LRA_INVBLOCK Invalid register block name

unsigned LRA_lookupCmpt char *  cName,
LRA_cmptDesc **  desc
 

Lookup component in list.

The component name is used to locate and return the matching component descriptor from the list of valid components.

Parameters:
cName The component name.
desc The address of a pointer to receive the address of the component descriptor.
Return values:
LRA_SUCCESS Success
LRA_INVCMPT Invalid component name

unsigned LRA_maxBufSize unsigned *  size  ) 
 

Get the maximum size needed for the register data buffer.

This routine returns the maximum size needed for the buffer used to hold the read register data. It assumes the maximum possible wild carding of the register description.

Parameters:
size The address of the returned maximum size, in bytes
Return values:
LRA_SUCCESS Always success

unsigned LRA_read LRA_regSpec rSpec,
LRA_regData data
 

Perform a register read operation.

The internal routine is called to read the specified registers into the supplied data area. This area is presumed to be big enough to hold the data, and the correct size may be determined in advance by calling the LRA_bufSize routine.

Parameters:
rSpec The register specifier, specifying which register (or set of registers) is (are) to be read. This contains the component, the register block, the TEM number, cable controller number, readout controller number, front-end number, and register number. The latter five parameters may be set individually to the value LRA_WILD to cause all values to be used.
data The address of an area to receive the read register values. This is a formatted block designed to be almost stand-alone. It contains the register specifier, counts of the number of values used for each of the last five parameters, the size of each register value, and the array of register values arranged with outer loop to inner loop ordered TEM, CC, RC, FE and register.
Return values:
LRA_SUCCESS Read was successful
LRA_INVCMPT Invalid component number
LRA_INVREG Invalid register number
LRA_INVBLOCK Invalid register block number
LRA_INVTEM Invalid TEM number
LRA_INVCC Invalid cable controller number
LRA_INVRC Invalid readout controller number
LRA_INVFE Invalid front-end number
ITC_SENDTID Destination task (LRA) not started
LCBD_RTOERR Operation timed out

unsigned LRA_readEsr LRA_esrData esr  ) 
 

Read the error and status registers.

The internal routine is called to read and store the contents of a pre-determined set of LAT error and status registers. No error is reported if a read operation times out.

Parameters:
esr The address of an area to receive the register values
Return values:
LRA_SUCCESS The registers were read successfully
ITC_SENDTID Destination task (LRA) not started

unsigned LRA_send LRA_regSpec rSpec  ) 
 

Send register values to the spacecraft.

A request is queued to the LRA task to read the specified registers and send them to the spacecraft via the SSR.

Parameters:
rSpec The register specifier, specifying which register (or set of registers) is (are) to be read. This contains the component, the register block, the TEM number, cable controller number, readout controller number, front-end number, and register number. The latter five parameters may be set individually to the value LRA_WILD to cause all values to be used.
Return values:
LRA_SUCCESS The read and send were successful
LRA_INVCMPT Invalid component number
LRA_INVREG Invalid register number
LRA_INVBLOCK Invalid register block number
LRA_INVTEM Invalid TEM number
LRA_INVCC Invalid cable controller number
LRA_INVRC Invalid readout controller number
LRA_INVFE Invalid front-end number
LCBD_RTOERR Operation timed out
ITC_SENDNID Destination node not reachable
ITC_SENDPRX Proxy task for destination node not started
ITC_SENDQID Destination queue not available
ITC_SENDTID Destination task (LRA) not started

unsigned LRA_sendEsr void   ) 
 

Send the error and status register values to the spacecraft.

A request is queued to the LRA task to read the contents of a pre- determined set of LAT error and status registers and send them to the spacecraft via the SSR.

Return values:
LRA_SUCCESS The read and send were successful
ITC_SENDNID Destination node not reachable
ITC_SENDPRX Proxy task for destination node not started
ITC_SENDQID Destination queue not available
ITC_SENDTID Destination task (LRA) not started

unsigned LRA_sendStats void   ) 
 

Send statistics data to the spacecraft.

A request is queued to the LRA task to send the statistics data block to the spacecraft via the SSR.

Return values:
LRA_SUCCESS The statistics were sent successfully
LRA_NOTINIT LRA not initialized
ITC_SENDNID Destination node not reachable
ITC_SENDPRX Proxy task for destination node not started
ITC_SENDQID Destination queue not available
ITC_SENDTID Destination task not started

unsigned LRA_setStatsPeriod unsigned  period  ) 
 

Set the statistics update period.

This routine sets the statistics update period to a new value.

Parameters:
period The time, in 1/100 seconds, to be used between successive updates of the register statistics. If zero, the default value is used.
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_sizeofEbmEventStats void   ) 
 

Get the size of the EBM event statistics block.

The size of the EBM event statistics block is returned.

Returns:
The size of the EBM event statistics block.

unsigned LRA_sizeofGemCntrStats void   ) 
 

Get the size of the GEM counters block.

The size of the GEM extended counters block is returned.

Returns:
The size of the GEM counters block.

unsigned LRA_sizeofStats void   ) 
 

Get the size of the LRA statistics block.

The size of the whole LRA statistics block is returned.

Returns:
The size of the LRA statistics block.

unsigned LRA_start void   ) 
 

Start the register access task.

This routine starts the register access task after checking that initialization has been successful.

Return values:
LRA_SUCCESS The task was started successfully
LRA_NOTINIT LRA not initialized
ITC_ALOCFAIL Cannot allocate for fork control block
ITC_CTLSTAT ITC control block not in state initialized
ITC_FORKINIT Fork initialization failed
ITC_FORKQHND Cannot recover all fork queue handles (obscure)
ITC_NOTINIT ITC control block does not exist

unsigned LRA_startStats void   ) 
 

Start register statistics acquisition.

The periodic updating of the register statistics block is started after the registers and statistics are cleared.

Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_stop void   ) 
 

Stop the register access task.

This routine stops the register access task.

Return values:
LRA_SUCCESS The task was stopped successfully
LRA_NOTINIT LRA not initialized
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC control block does not exist
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Invalid task state for this operation

unsigned LRA_stopStats void   ) 
 

Stop register statistics acquisition.

The periodic updating of the register statistics block is stopped.

Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_terminate void   ) 
 

Terminate register access.

This routine frees all resources used by the register access system.

Return values:
LRA_SUCCESS Termination was successful
LRA_NOTINIT LRA not initialized


Generated on Wed Aug 27 01:15:45 2008 by  doxygen 1.4.4