GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LRA / dev > lra_cli / rad750
#include <LRA/LRA_cli.h>
#include <LRA/LRA.h>
#include <LRA/LRA_msgs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/WCT.h>
#include <PBS/MBA.h>
#include <PBI/PTR.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <LRA/LRA_cmpnt.h>
#include <LRA/LRA_disp.h>
Functions | |
static unsigned | genRegSpec (const char *cmpnt, const char *block, int tem, int cc, int rc, int fe, int reg, LRA_regSpec *rSpec) |
Generate a register specification. | |
static unsigned | getRegBuff (void) |
Get a buffer to hold the register data. | |
static unsigned | lookupCmpt (const char *cName, const LRA_cmptDesc **desc) |
Lookup component in list. | |
unsigned int | LRA_ctl (const char *cmpnt, const char *block, int tem, int cc, int rc, int fe, int func) |
Perform a control function. | |
unsigned int | LRA_dump (const char *cmpnt, const char *block, int tem, int cc, int rc, int fe, int reg) |
Dump the contents of LAT registers to the SSR. | |
unsigned int | LRA_set (long long value, const char *cmpnt, const char *block, int tem, int cc, int rc, int fe, int reg) |
Set the contents of LAT registers. | |
unsigned int | LRA_show (const char *cmpnt, const char *block, int tem, int cc, int rc, int fe, int reg, int optns) |
Display the contents of LAT registers. | |
unsigned int | LRA_time (const char *cmpnt, const char *block, int tem, int cc, int rc, int fe, int reg, int count) |
Time the reading of LAT registers. | |
Variables | |
static LRA_regData * | rData = NULL |
$Id: LRA_cli.c,v 1.10 2011/03/28 16:38:39 saxton Exp $
unsigned genRegSpec | ( | const char * | cmpnt, | |
const char * | block, | |||
int | tem, | |||
int | cc, | |||
int | rc, | |||
int | fe, | |||
int | reg, | |||
LRA_regSpec * | rSpec | |||
) | [static] |
Generate a register specification.
Local routine to generate an LRA register specification from the supplied register address parameters.
cmpnt | The LAT component name or number | |
block | The register block name or number | |
tem | The TEM number | |
cc | The cable controller number | |
rc | The readout controller number | |
fe | The front end number | |
reg | The register number | |
rSpec | The address of a register specification to receive the generated value |
LRA_SUCCESS | Success | |
LRA_INVCMPT | Invalid component number | |
LRA_INVCMPNM | Invalid component name | |
LRA_INVBLKNM | Invalid register block name |
References lookupCmpt().
Referenced by LRA_ctl(), LRA_dump(), LRA_set(), LRA_show(), and LRA_time().
unsigned getRegBuff | ( | void | ) | [static] |
Get a buffer to hold the register data.
Local routine to allocate the maximum sized buffer needed to hold the data from any register read request.
LRA_SUCCESS | Success | |
LRA_INSFMEM | Insufficient memory |
Referenced by LRA_show(), and LRA_time().
unsigned lookupCmpt | ( | const char * | cName, | |
const LRA_cmptDesc ** | desc | |||
) | [static] |
Lookup component in list.
The component name is used to locate and return the matching component descriptor from the list of valid components.
cName | The component name. | |
desc | The address of a pointer to receive the address of the component descriptor. |
LRA_SUCCESS | Success | |
LRA_INVCMPT | Invalid component name |
Referenced by genRegSpec().
unsigned int LRA_ctl | ( | const char * | cmpnt, | |
const char * | block, | |||
int | tem, | |||
int | cc, | |||
int | rc, | |||
int | fe, | |||
int | func | |||
) |
Perform a control function.
This routine performs the specified control function on the specified LAT component.
cmpnt | The LAT component name or number | |
block | The register block name or number (EBM only) | |
tem | The TEM number for TEM-based components, or LRA_WILD for all TEMs | |
cc | The cable controller number, or LRA_WILD for all cable controllers | |
rc | The readout controller number, or LRA_WILD for all RCs | |
fe | The front end number, or LRA_WILD for all FEs | |
func | The function to perform |
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 |
References genRegSpec().
unsigned int LRA_dump | ( | const char * | cmpnt, | |
const char * | block, | |||
int | tem, | |||
int | cc, | |||
int | rc, | |||
int | fe, | |||
int | reg | |||
) |
Dump the contents of LAT registers to the SSR.
This routine reads the contents of the specified LAT registers and sends the results to the SSR.
cmpnt | The LAT component name or number | |
block | The register block name or number | |
tem | The TEM number for TEM-based components, LRA_WILD to read all TEMs, or LRA_ACTIVE to read all available TEMs | |
cc | The cable controller number, or LRA_WILD for all cable controllers | |
rc | The readout controller number, or LRA_WILD for all RCs | |
fe | The front end number, or LRA_WILD for all FEs | |
reg | The register number, or LRA_WILD for all registers |
LRA_SUCCESS | The dump was successful | |
LRA_INVCMPNM | Invalid component name | |
LRA_INVCMPT | Invalid component number | |
LRA_INVBLKNM | Invalid register block name | |
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 | |
LRA_INVREG | Invalid register 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 |
References genRegSpec().
unsigned int LRA_set | ( | long long | value, | |
const char * | cmpnt, | |||
const char * | block, | |||
int | tem, | |||
int | cc, | |||
int | rc, | |||
int | fe, | |||
int | reg | |||
) |
Set the contents of LAT registers.
This routine sets a value into the specified LAT registers.
value | The value to be set | |
cmpnt | The LAT component name or number | |
block | The register block name or number | |
tem | The TEM number for TEM-based components, or LRA_WILD for all TEMs | |
cc | The cable controller number, or LRA_WILD for all cable controllers | |
rc | The readout controller number, or LRA_WILD for all RCs | |
fe | The front end number, or LRA_WILD for all FEs | |
reg | The register number |
LRA_SUCCESS | Register setting was successful | |
LRA_INVCMPNM | Invalid component name | |
LRA_INVCMPT | Invalid component number | |
LRA_INVBLKNM | Invalid register block name | |
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 | |
LRA_INVREG | Invalid register number | |
ITC_SENDTID | Destination task (LRA) not started | |
LCBD_RTOERR | Operation timed out |
References genRegSpec().
unsigned int LRA_show | ( | const char * | cmpnt, | |
const char * | block, | |||
int | tem, | |||
int | cc, | |||
int | rc, | |||
int | fe, | |||
int | reg, | |||
int | optns | |||
) |
Display the contents of LAT registers.
This routine displays the contents of the specified LAT registers.
cmpnt | The LAT component name or number | |
block | The register block name or number | |
tem | The TEM number for TEM-based components, LRA_WILD to read all TEMs, or LRA_ACTIVE to read all available TEMs | |
cc | The cable controller number, or LRA_WILD for all cable controllers | |
rc | The readout controller number, or LRA_WILD for all RCs | |
fe | The front end number, or LRA_WILD for all FEs | |
reg | The register number, or LRA_WILD for all registers | |
optns | Display options |
LRA_SUCCESS | Display was successful | |
LRA_INVCMPNM | Invalid component name | |
LRA_INVCMPT | Invalid component number | |
LRA_INVBLKNM | Invalid register block name | |
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 | |
LRA_INVREG | Invalid register number | |
ITC_SENDTID | Destination task (LRA) not started | |
LCBD_RTOERR | Operation timed out |
References genRegSpec(), getRegBuff(), and LRA_DOPT_NOHDR.
unsigned int LRA_time | ( | const char * | cmpnt, | |
const char * | block, | |||
int | tem, | |||
int | cc, | |||
int | rc, | |||
int | fe, | |||
int | reg, | |||
int | count | |||
) |
Time the reading of LAT registers.
This routine reads the contents of the specified LAT registers, and displays the time taken to do so.
cmpnt | The LAT component name or number | |
block | The register block name or number | |
tem | The TEM number for TEM-based components, LRA_WILD to read all TEMs, or LRA_ACTIVE to read all available TEMs | |
cc | The cable controller number, or LRA_WILD to read all cable controllers. | |
rc | The readout controller number, or LRA_WILD to read all RCs. | |
fe | The front end number, or LRA_WILD to read all FEs. | |
reg | The register number, or LRA_WILD to read all registers. | |
count | The number of times to perform the read operation. |
LRA_SUCCESS | Timing was successful | |
LRA_INVCMPNM | Invalid component name | |
LRA_INVCMPT | Invalid component number | |
LRA_INVBLKNM | Invalid register block name | |
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 | |
LRA_INVREG | Invalid register number | |
ITC_SENDTID | Destination task (LRA) not started | |
LCBD_RTOERR | Operation timed out |
References genRegSpec(), and getRegBuff().