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

Constituent: lci     Tag: mcp750


Interface   Data Structures   File List   Data Fields   Globals  

configure.c File Reference

Routines that manipulate the configuration structure and the associated data file. More...

#include "LCI/LCI_msgs.h"
#include "configure_p.h"
#include "enums_p.h"
#include "macros_p.h"
#include "LATC/latc.h"
#include "LATC/lrd.h"
#include "LSEC/LSEC_ctx.h"
#include "LSEC/enums.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 <string.h>
#include <fcntl.h>
#include <unistd.h>

Include dependency graph for configure.c:


Functions

static unsigned refresh (void *inp, size_t size, int fd)
static unsigned refreshAcd (LCI_acdValues *val, LCI_acdInput *inp, unsigned *rld, int fd)
static unsigned refreshCal (LCI_calValues *val, LCI_calInput *inp, unsigned *rld, int fd)
static unsigned refreshTkr (LCI_tkrValues *val, LCI_tkrInput *inp, unsigned *rld, int fd)
static unsigned readAcd (LCI_configuration *cnf)
static unsigned readCal (LCI_configuration *cnf)
static unsigned readTkr (LCI_configuration *cnf)
static unsigned increment (unsigned short *val, LCI_cnfItem *itm)
static unsigned configureGem (LCI_gemInput *inp, LEM_micr *cr, unsigned siu_id)
static unsigned configureAcd (LCI_acdValues *val, LEM_micr *cr)
static unsigned configureCal (LCI_calValues *val, LEM_micr *cr)
static unsigned configureTkr (LCI_tkrValues *val, LEM_micr *cr)
static void reportAcd (LCI_configuration *cnf, FILE *fp)
static void reportCal (LCI_configuration *cnf, FILE *fp)
static void reportTkr (LCI_configuration *cnf, FILE *fp)
static void reportGem (LCI_gemInput *gem, FILE *fp)
static void reportItem (LCI_cnfItem *itm, const char *title, FILE *fp, unsigned *cib)
static void reportParm (int value, const char *title, FILE *fp)
static void reportOnOff (int value, const char *title, FILE *fp)
static void reportHiLo (int value, const char *title, FILE *fp)
LCI_configurationLCI_newConfiguration (void)
 Allocate memory for a configuration structure and initialise (clear) it.
void LCI_deleteConfiguration (LCI_configuration *cnf)
 Free memory previously allocated with a call to LCI_newConfiguration.
void LCI_copyConfiguration (LCI_configuration *cnfIn, LCI_configuration *cnfOut)
 Copy a configuration.
unsigned LCI_openFid (LCI_configuration *cnf, unsigned fid)
 Open the file and associate it with this configuration structure.
unsigned LCI_open (LCI_configuration *cnf, const char *fn)
 Open the file and associate it with this configuration structure.
unsigned LCI_read (LCI_configuration *cnf)
 Get the values for the next step of the configuration.
unsigned LCI_close (LCI_configuration *cnf)
 Close the file that acts as the source of the configuration.
unsigned LCI_cache (LCI_configuration *cnf, unsigned latc_fid)
 Read in the LATC files.
void LCI_nodeId (LCI_configuration *cnf, unsigned siu_id)
 Set the destination address to be used in the TAM configuration.
unsigned LCI_configure (LCI_configuration *cnf, LEM_micr *cr, unsigned runId)
 Load the configuration onto the LAT.
unsigned int LCI_sizeofCtx32 (LCI_configuration *cnf)
 Calculate the number of 32-bit words required to hold the current configuration values.
unsigned int * LCI_consignCtx (LCI_configuration *cnf, unsigned int *buf)
 Copy the current configuration values into the buffer.
unsigned LCI_mode (LCI_configuration *cnf)
 Return the configuration type.
unsigned LCI_range (LCI_configuration *cnf)
 Return the readout range.
unsigned LCI_triggers (LCI_configuration *cnf)
 Return the number of triggers required.
unsigned LCI_period (LCI_configuration *cnf)
 Return the period between triggers.
unsigned LCI_setBufferModel (unsigned select, LEM_micr *cr)
 Set the buffer model select bit of the TEM CONFIGURATION register.
void LCI_report (LCI_configuration *cnf, FILE *fp)
 Produce a formatted report of the contents of a binary configuration.

Detailed Description

Routines that manipulate the configuration structure and the associated data file.

Author:
James Swain & Owen Saxton
Id
configure.c,v 1.23 2007/08/26 21:43:23 saxton Exp

Function Documentation

unsigned LCI_cache LCI_configuration cnf,
unsigned  latc_fid
 

Read in the LATC files.

Parameters:
cnf Pointer to an initialised configuration structure
latc_fid ID of the LATC configuration to cache
Return values:
LCI_SUCCESS if all goes well
LATC_BADFOPEN if the fid, or any of the names the LAT configuration master file contains, does not match a valid file.
LATC_BADTYPE if the LATC file contains a bad type identifier
LATC_BADREAD if an error occurs whilst the file is being read

unsigned LCI_close LCI_configuration cnf  ) 
 

Close the file that acts as the source of the configuration.

Parameters:
cnf Pointer to an opened configuration
Return values:
LCI_SUCCESS If the file closes successfully
LCI_FCLOSE If there is an error closing the file

unsigned LCI_configure LCI_configuration cnf,
LEM_micr *  cr,
unsigned  runId
 

Load the configuration onto the LAT.

Parameters:
cnf Pointer to a populated configuration structure
cr Pointer to the common configuration multi-item command response list
runId The current run ID.
Returns:
LCI_SUCCESS if all goes well, or one of the LEM errors if there is a problem loading the configuration onto the LAT

unsigned int* LCI_consignCtx LCI_configuration cnf,
unsigned int *  buf
 

Copy the current configuration values into the buffer.

Parameters:
cnf pointer to a configuration structure
buf Location to place the current configuration values
Returns:
Pointer to the next output location

void LCI_copyConfiguration LCI_configuration cnfIn,
LCI_configuration cnfOut
 

Copy a configuration.

Parameters:
cnfIn The configuration structure to be copied from
cnfOut The configuration structure to be copied to

void LCI_deleteConfiguration LCI_configuration cnf  ) 
 

Free memory previously allocated with a call to LCI_newConfiguration.

Parameters:
cnf A configuration structure created by a call to LCI_newConfiguration

unsigned LCI_mode LCI_configuration cnf  ) 
 

Return the configuration type.

Parameters:
cnf Pointer to the configuration structure
Returns:
One of LSEC_MODE_XXX

LCI_configuration* LCI_newConfiguration void   ) 
 

Allocate memory for a configuration structure and initialise (clear) it.

Returns:
Pointer to an allocated, initialised configuration structure

void LCI_nodeId LCI_configuration cnf,
unsigned  siu_id
 

Set the destination address to be used in the TAM configuration.

Parameters:
cnf Pointer to the configuration structure
siu_id LATp address of the node that the events will be collected on

unsigned LCI_open LCI_configuration cnf,
const char *  fn
 

Open the file and associate it with this configuration structure.

Parameters:
cnf Pointer to an initialised configuration structure
fn Name of file to open
Return values:
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
LCI_VERSION if the file version information is bad (unknown type, major version mismatch, minor version decrease).
LCI_ENDOFILE if the file has no actual configurations (returned, but not reported).

unsigned LCI_openFid LCI_configuration cnf,
unsigned  fid
 

Open the file and associate it with this configuration structure.

Parameters:
cnf Pointer to an initialised configuration structure
fid The ID of the file to open
Return values:
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
LCI_VERSION if the file version information is bad (unknown type, major version mismatch, minor version decrease).
LCI_ENDOFILE if the file has no actual configurations (returned, but not reported).

unsigned LCI_period LCI_configuration cnf  ) 
 

Return the period between triggers.

Parameters:
cnf Pointer to an initialised, populated configuration structure
Returns:
The period between triggers (in 50ns clock ticks)

unsigned LCI_range LCI_configuration cnf  ) 
 

Return the readout range.

Parameters:
cnf Pointer to the configuration structure
Returns:
The range for this configuration (LSEC_XXX_RANGE)

unsigned LCI_read LCI_configuration cnf  ) 
 

Get the values for the next step of the configuration.

Parameters:
cnf Pointer to an opened configuration
Return values:
LCI_SUCCESS if a configuration was read successfully
LCI_ENDOFILE if there are no more configurations in the file (returned, but not reported).
LCI_READ if there is an error during the read or the configuration is incomplete

void LCI_report LCI_configuration cnf,
FILE *  fp
 

Produce a formatted report of the contents of a binary configuration.

Parameters:
cnf Pointer to the configuration structure to output
fp Pointer to file to print report

unsigned LCI_setBufferModel unsigned  select,
LEM_micr *  cr
 

Set the buffer model select bit of the TEM CONFIGURATION register.

Parameters:
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.
Return values:
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 int LCI_sizeofCtx32 LCI_configuration cnf  ) 
 

Calculate the number of 32-bit words required to hold the current configuration values.

Parameters:
cnf Pointer to a configuration structure
Returns:
Number of 32-bit words required to hold the current configuration values

unsigned LCI_triggers LCI_configuration cnf  ) 
 

Return the number of triggers required.

Parameters:
cnf Pointer to an initialised, populated configuration structure
Returns:
Number of triggers to request for this configuration


Generated on Mon Aug 27 02:38:58 2007 by  doxygen 1.4.4