GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PIG / V10-1-4 > pig_flying / rad750


Interface   Data Structures   File List   Data Fields   Globals  

state.c File Reference

Routines to capture the state of PIG controlled registers. More...

#include "pig_p.h"
#include "pig_const_p.h"
#include "PIG/pig.h"
#include "PIG/power.h"
#include "PIG/PIG_msgs.h"
#include "LEM/defs.h"
#include "LEM/list.h"
#include "LEM/encode.h"
#include "LEM/decode.h"
#include <string.h>

Functions

unsigned int PIG_get_ebmState (unsigned int *inputs, unsigned int *contbs, unsigned int *destns)
 Return the EBM configuration masks.
unsigned PIG_verify (void)
 Verify the PIG state.
unsigned readState (LEM_micr *cr, int all, PIG_state *state)
 Take a snapshot of the state of all PIG registers.
unsigned readEbmState (LEM_micr *cr, PIG_ebmState *state)
 Take a snapshot of the state of the EBM.
unsigned readCruState (LEM_micr *cr, PIG_cruState *state)
 Take a snapshot of the state of the CRU.
unsigned readPduState (LEM_micr *cr, PIG_pduState *state, const PIG_cruState *cru)
 Take a snapshot of the state of the PDU(s).
unsigned readDbState (LEM_micr *cr, PIG_dbState *state)
 Take a snapshot of the current contents of the registers controlled by PIG_DB.
unsigned readPwrState (LEM_micr *cr, int all, PIG_pwrState *state)
 Take a snapshot of the current contents of the power registers.
void getState (PIG_state *state)
 Get a copy of the state of all PIG registers.
void getCruState (PIG_cruState *state)
 Get the saved copy of the contents of the CRU registers.
void getPduState (PIG_pduState *state)
 Get the saved copy of the contents of the PDU registers.
void getEbmState (PIG_ebmState *state)
 Get the saved copy of the contents of the EBM registers.
void getDbState (PIG_dbState *state)
 Get the saved copy of the contents of the database registers.
void getPwrState (PIG_pwrState *state)
 Get the saved copy of the contents of the power registers.
void saveState (const PIG_state *state)
 Save a copy of the state of all PIG registers.
void saveCruState (const PIG_cruState *state)
 Save a copy of the contents of the CRU registers.
void savePduState (const PIG_pduState *state)
 Save a copy of the contents of the PDU registers.
void saveEbmState (const PIG_ebmState *state)
 Save a copy of the contents of the EBM registers.
void saveDbState (const PIG_dbState *state)
 Save a copy of the contents of the database registers.
void savePwrState (const PIG_pwrState *state)
 Save a copy of the contents of the power registers.

Variables

static PIG_state cState


Detailed Description

Routines to capture the state of PIG controlled registers.

Author:
James Swain & Owen Saxton
$Id: state.c,v 1.7 2009/08/14 16:50:51 saxton Exp $

Function Documentation

void getCruState ( PIG_cruState state  ) 

Get the saved copy of the contents of the CRU registers.

Parameters:
state Pointer to a structure to receive the state of the CRU registers

void getDbState ( PIG_dbState state  ) 

Get the saved copy of the contents of the database registers.

Parameters:
state Pointer to a structure to receive the state of the database registers

void getEbmState ( PIG_ebmState state  ) 

Get the saved copy of the contents of the EBM registers.

Parameters:
state Pointer to a structure to receive the state of the EBM registers

void getPduState ( PIG_pduState state  ) 

Get the saved copy of the contents of the PDU registers.

Parameters:
state Pointer to a structure to receive the state of the PDU registers

void getPwrState ( PIG_pwrState state  ) 

Get the saved copy of the contents of the power registers.

Parameters:
state Pointer to a structure to receive the state of the power registers

void getState ( PIG_state state  ) 

Get a copy of the state of all PIG registers.

Parameters:
state Pointer to a structure to receive the state of the PIG registers

unsigned int PIG_get_ebmState ( unsigned int *  inputs,
unsigned int *  contbs,
unsigned int *  destns 
)

Return the EBM configuration masks.

Parameters:
inputs Address of an integer to receive the source processor input enables, or NULL if this value is not wanted.
contbs Address of an integer to receive the EBM scheduler contributor enables, or NULL if this value is not wanted.
destns Address of an integer to receive the round-robin and broadcast masks, or NULL if this value is not wanted.
Return values:
PIG_INMUD Success

unsigned PIG_verify ( void   ) 

Verify the PIG state.

This routine reads all the PIG-controlled registers and compares their values with the cached ones.

Return values:
PIG_INMUD Register values all matched.
PIG_VERFAIL0 A single-occurrence register value didn't match.
PIG_VERFAIL1 A PDU, TEM or ARC register value didn't match.
PIG_VERFAIL2 A CCC or TCC register value didn't match.

unsigned readCruState ( LEM_micr *  cr,
PIG_cruState state 
)

Take a snapshot of the state of the CRU.

Parameters:
cr Pointer to a multi-item command and response list
state Pointer to a structure to receive the state of the CRU registers

unsigned readDbState ( LEM_micr *  cr,
PIG_dbState state 
)

Take a snapshot of the current contents of the registers controlled by PIG_DB.

Parameters:
cr Pointer to a multi-item command and response list
state Pointer to a structure to receive the state of the PIG_DB controlled registers

unsigned readEbmState ( LEM_micr *  cr,
PIG_ebmState state 
)

Take a snapshot of the state of the EBM.

Parameters:
cr Pointer to a multi-item command and response list
state Pointer to a structure to receive the state of the EBM registers

unsigned readPduState ( LEM_micr *  cr,
PIG_pduState state,
const PIG_cruState cru 
)

Take a snapshot of the state of the PDU(s).

Parameters:
cr Pointer to a multi-item command and response list
state Pointer to a structure to receive the state of the PDU registers
cru Pointer to a structure holding the state of the CRU registers

unsigned readPwrState ( LEM_micr *  cr,
int  all,
PIG_pwrState state 
)

Take a snapshot of the current contents of the power registers.

Parameters:
cr Pointer to a multi-item command and response list
all If TRUE, read all the registers. Otherwise omit the reading of some sensitive registers.
state Pointer to a structure to receive the state of the power registers

unsigned readState ( LEM_micr *  cr,
int  all,
PIG_state state 
)

Take a snapshot of the state of all PIG registers.

Parameters:
cr Pointer to a multi-item command and response list
all If TRUE, read all the registers. Otherwise omit the reading of some sensitive registers.
state Pointer to a structure to receive the state of the PIG registers

void saveCruState ( const PIG_cruState state  ) 

Save a copy of the contents of the CRU registers.

Parameters:
state Pointer to a structure containing the state of the CRU registers

void saveDbState ( const PIG_dbState state  ) 

Save a copy of the contents of the database registers.

Parameters:
state Pointer to a structure containing the state of the database registers

void saveEbmState ( const PIG_ebmState state  ) 

Save a copy of the contents of the EBM registers.

Parameters:
state Pointer to a structure containing the state of the EBM registers

void savePduState ( const PIG_pduState state  ) 

Save a copy of the contents of the PDU registers.

Parameters:
state Pointer to a structure containing the state of the PDU registers

void savePwrState ( const PIG_pwrState state  ) 

Save a copy of the contents of the power registers.

Parameters:
state Pointer to a structure containing the state of the power registers

void saveState ( const PIG_state state  ) 

Save a copy of the state of all PIG registers.

Parameters:
state Pointer to a structure to receive the state of the PIG registers


Generated on Fri Aug 14 10:34:10 2009 by  doxygen 1.5.3