GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-0-1 > lci / mv2304
#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.28 2010/05/25 18:34:47 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 |
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 |
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 |
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. |
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 |
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. |
unsigned LCI_confMode | ( | LCI_configuration * | cnf | ) |
Return the configuration type.
cnf | Pointer to the configuration structure |
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 |
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). |
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). |
unsigned LCI_confPeriod | ( | LCI_configuration * | cnf | ) |
Return the period between triggers.
cnf | Pointer to an initialised, populated configuration structure |
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 |
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 |
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. |
unsigned LCI_confTriggers | ( | LCI_configuration * | cnf | ) |
Return the number of triggers required.
cnf | Pointer to an initialised, populated configuration structure |