GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / dev > lci / rad750
#include <configure_p.h>
#include <lci_p.h>
#include <LCI/LCI_msgs.h>
#include <LCFG/LCFG.h>
#include <LSEC/LSEC_ctx.h>
#include <LSEC/LSEC.h>
#include <FBS/FBS_pubrtos.h>
#include <LEM/msg_macros.h>
#include <LEM/defs.h>
#include <LEM/encode.h>
#include <LEM/decode.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/BSWP.h>
#include <PBS/MBA.h>
#include <PBS/TASK.h>
#include <PBS/TOV.h>
#include <PBS/WCT.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
Functions | |
unsigned | LCI_confBufferModel (unsigned select, LEM_micr *cr, unsigned *mods) |
Set the TEM buffer model. | |
unsigned | LCI_confCache (LCI_configuration *cnf, unsigned latc_fid) |
Read in the LATC files. | |
unsigned | LCI_confClose (LCI_configuration *cnf) |
Close the file that acts as the source of the configuration. | |
void | LCI_confCopy (LCI_configuration *cnfIn, LCI_configuration *cnfOut) |
Copy a configuration. | |
LCI_configuration * | LCI_confCreate (LSEC_control *lsec) |
Create a new configuration structure. | |
void | LCI_confDelete (LCI_configuration *cnf) |
Free memory previously allocated with a call to LCI_confCreate. | |
unsigned | LCI_configure (LCI_configuration *cnf, LEM_micr *cr, unsigned runId) |
Load the configuration onto the LAT. | |
unsigned | LCI_confMode (LCI_configuration *cnf) |
Return the configuration type. | |
void | LCI_confNodeId (LCI_configuration *cnf, unsigned siu_id) |
Set the destination address to be used in the TAM configuration. | |
unsigned | LCI_confOpen (LCI_configuration *cnf, const char *fn) |
Open the file and associate it with this configuration structure. | |
unsigned | LCI_confOpenFid (LCI_configuration *cnf, unsigned fid) |
Open the file and associate it with this configuration structure. | |
unsigned | LCI_confPeriod (LCI_configuration *cnf) |
Return the period between triggers. | |
unsigned | LCI_confRead (LCI_configuration *cnf) |
Get the values for the next step of the configuration. | |
void | LCI_confReport (LCI_configuration *cnf, FILE *fp) |
Produce a formatted report of the contents of a binary configuration. | |
void | LCI_confTimes (LCI_configuration *cnf, int clear, long long *lci_time, long long *lat_time) |
Return accumulated configuration times. | |
unsigned | LCI_confTriggers (LCI_configuration *cnf) |
Return the number of triggers required. |
$Id: configure.c,v 1.29 2011/03/29 19:30:42 saxton Exp $
unsigned LCI_confBufferModel | ( | unsigned | select, | |
LEM_micr * | cr, | |||
unsigned * | mods | |||
) |
Set the TEM buffer model.
This routine sets the value of the buffer model select bit in the TEM CONFIGURATION register, necessary because the calibration requires non-standard single buffering. It optionally also returns the operational state of the various data acquisition modules (TEMs, GEM and AEM), needed for event data checking.
select | Zero to select the multi buffer model, non-zero to select the single buffer model | |
cr | Pointer to the multi-item command/response list. | |
mods | Pointer to an integer to receive the bit mask of operational acquisition modules, or NULL if this information is not required. |
LCI_SUCCESS | Success | |
LCI_TEMCR | The command and response masks don't have the same TEMs present | |
LEM_* | If there was an error reading or loading one of the registers |
Referenced by LCI_calibrate(), and LCI_terminate().
unsigned LCI_confCache | ( | LCI_configuration * | cnf, | |
unsigned | latc_fid | |||
) |
Read in the LATC files.
cnf | Pointer to an initialised configuration structure | |
latc_fid | ID of the LATC configuration to cache |
LCI_SUCCESS | if all goes well | |
LCFG_BADFOPEN | if the fid, or any of the names the LAT configuration master file contains, does not match a valid file. | |
LCFG_BADTYPE | if the LATC file contains a bad type identifier | |
LCFG_BADREAD | if an error occurs whilst the file is being read |
References _LCI_configuration::latc, and _LCI_configuration::rld.
Referenced by LCI_calibrate().
unsigned LCI_confClose | ( | LCI_configuration * | cnf | ) |
Close the file that acts as the source of the configuration.
cnf | Pointer to an opened configuration |
LCI_SUCCESS | If the file closes successfully | |
LCI_FCLOSE | If there is an error closing the file |
References _LCI_configuration::fd.
Referenced by LCI_terminate().
void LCI_confCopy | ( | LCI_configuration * | cnfIn, | |
LCI_configuration * | cnfOut | |||
) |
Copy a configuration.
cnfIn | The configuration structure to be copied from | |
cnfOut | The configuration structure to be copied to |
LCI_configuration* LCI_confCreate | ( | LSEC_control * | lsec | ) |
Create a new configuration structure.
lsec | The LSEC handle. |
References _LCI_configuration::lsec.
Referenced by LCI_newController().
void LCI_confDelete | ( | LCI_configuration * | cnf | ) |
Free memory previously allocated with a call to LCI_confCreate.
cnf | A configuration structure created by a call to LCI_confCreate |
Referenced by LCI_deleteController().
unsigned LCI_configure | ( | LCI_configuration * | cnf, | |
LEM_micr * | cr, | |||
unsigned | runId | |||
) |
Load the configuration onto the LAT.
cnf | Pointer to a populated configuration structure | |
cr | Pointer to the common configuration multi-item command response list | |
runId | The current run ID. |
References LCI_cnfValues::acd, LCI_cnfValues::cal, LCI_gemInput::delay, LCI_cnfInput::gem, _LCI_configuration::inp, _LCI_configuration::lat_time, LCI_gemInput::latcDelay, _LCI_configuration::lci_time, LCI_version::mode, _LCI_configuration::rld, _LCI_configuration::siu_id, LCI_cnfValues::tkr, _LCI_configuration::val, and _LCI_configuration::ver.
unsigned LCI_confMode | ( | LCI_configuration * | cnf | ) |
Return the configuration type.
cnf | Pointer to the configuration structure |
References LCI_version::mode, and _LCI_configuration::ver.
Referenced by LCI_calibrate().
void LCI_confNodeId | ( | LCI_configuration * | cnf, | |
unsigned | siu_id | |||
) |
Set the destination address to be used in the TAM configuration.
cnf | Pointer to the configuration structure | |
siu_id | LATp address of the node that the events will be collected on |
References _LCI_configuration::siu_id.
Referenced by LCI_calibrate().
unsigned LCI_confOpen | ( | LCI_configuration * | cnf, | |
const char * | fn | |||
) |
Open the file and associate it with this configuration structure.
cnf | Pointer to an initialised configuration structure | |
fn | Name of file to open |
LCI_SUCCESS | if the file opens successfully | |
LCI_FOPEN | if the file failed to open successfully | |
LCI_FREAD | if there is an error recovering the version information (including file too short). | |
LCI_VERSION | if the file version information is bad (unknown type, major version mismatch, minor version decrease). |
References LCI_cnfInput::acd, LCI_cnfValues::acd, LCI_cnfInput::cal, LCI_cnfValues::cal, _LCI_configuration::fd, LCI_cnfInput::gem, _LCI_configuration::inp, _LCI_configuration::lci, LCI_version::maj, LCI_version::min, LCI_version::mode, _LCI_configuration::rld, LCI_cnfInput::tkr, LCI_cnfValues::tkr, _LCI_configuration::val, and _LCI_configuration::ver.
Referenced by LCI_confOpenFid().
unsigned LCI_confOpenFid | ( | LCI_configuration * | cnf, | |
unsigned | fid | |||
) |
Open the file and associate it with this configuration structure.
cnf | Pointer to an initialised configuration structure | |
fid | The ID of the file to open |
LCI_SUCCESS | if the file opens successfully | |
LCI_FOPEN | if the file failed to open successfully | |
LCI_FREAD | if there is an error recovering the version information (including file too short). | |
LCI_VERSION | if the file version information is bad (unknown type, major version mismatch, minor version decrease). |
References _LCI_configuration::lci, and LCI_confOpen().
Referenced by LCI_calibrate().
unsigned LCI_confPeriod | ( | LCI_configuration * | cnf | ) |
Return the period between triggers.
cnf | Pointer to an initialised, populated configuration structure |
References LCI_cnfInput::gem, _LCI_configuration::inp, and LCI_gemInput::period.
unsigned LCI_confRead | ( | LCI_configuration * | cnf | ) |
Get the values for the next step of the configuration.
cnf | Pointer to an opened configuration |
LCI_SUCCESS | if a configuration was read successfully | |
LCI_ENDOFILE | if there are no more configurations in the file (returned, but not reported). | |
LCI_FREAD | if there is an error during the read or the configuration is incomplete |
References LCI_version::mode, and _LCI_configuration::ver.
void LCI_confReport | ( | LCI_configuration * | cnf, | |
FILE * | fp | |||
) |
Produce a formatted report of the contents of a binary configuration.
cnf | Pointer to the configuration structure to output | |
fp | Pointer to file to print report |
References LCI_version::maj, LCI_version::min, LCI_version::mode, and _LCI_configuration::ver.
void LCI_confTimes | ( | LCI_configuration * | cnf, | |
int | clear, | |||
long long * | lci_time, | |||
long long * | lat_time | |||
) |
Return accumulated configuration times.
cnf | Pointer to an initialised, populated configuration structure. | |
clear | If TRUE, clear the times after copying them. | |
lci_time | Address of a variable to receive the accumulated time taken to do LCI configurations or NULL if the time is not wanted. | |
lat_time | Address of a variable to receive the accumulated time taken to do any LAT configurations or NULL if the time is not wanted. |
References _LCI_configuration::lat_time, and _LCI_configuration::lci_time.
Referenced by LCI_calibrate().
unsigned LCI_confTriggers | ( | LCI_configuration * | cnf | ) |
Return the number of triggers required.
cnf | Pointer to an initialised, populated configuration structure |
References LCI_cnfInput::gem, _LCI_configuration::inp, and LCI_gemInput::nev.