GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PIG / V8-8-2

Constituent: pig_flying     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

cmdrsp.c File Reference

Implementation of the PIG power and C/R routines. More...

#include "PIG/power.h"
#include "PIG/PIG_msgs.h"
#include "state_p.h"
#include "pig_macro_p.h"
#include "CDM/CDM_pubdefs.h"
#include "LEM/list.h"
#include "LEM/encode.h"
#include "LEM/msg_macros.h"
#include <string.h>

Include dependency graph for cmdrsp.c:


Enumerations

enum  {
  CSR_STALL = 200,
  TEM_USE_RED_DAB = 3<<24
}

Functions

static unsigned cr_ins (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 If indicated by the cfg structure, insert PDU(s), GEM, EBM to the C/R fabric.
static unsigned epus_on (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power on the EPUs as required, and update the state.
static unsigned tems_on (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state, const PIG_DB_Schema *pdb)
 Power on the TEMs as required, and update the state.
static unsigned acd_on (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state, const PIG_DB_Schema *pdb)
 Power on ACD and FREE boards as required.
static unsigned cr_ext (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 If indicated by the cfg structure, extract PDU(s), GEM, EBM to the C/R fabric.
static unsigned epus_off (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power on the EPUs as required, and update the state.
static unsigned tems_off (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power on the TEMs as required, and update the state.
static unsigned acd_off (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power on ACD and FREE boards as required.
static unsigned twr_pwr (LEM_micr *cr, unsigned short mask, PWR_TWR_SELECT select, PWR_TWR_STATE state)
 Power on the calorimeter towers as required.
unsigned PIG_insert (LEM_micr *cr, PIG_cfg *cfg)
 Insert one or more nodes into the C/R fabric, possibly powering on said node on at the same time.
unsigned PIG_extract (LEM_micr *cr, PIG_cfg *cfg)
 Extract one or more nodes from the C/R fabric, possibly powering off said node at the same time.
void PIG_enter_SAA (LEM_micr *cr)
 Write registers to place the LAT into SAA mode.
void PIG_exit_SAA (LEM_micr *cr)
 Write registers to pull the LAT out of SAA mode.
void PIG_safe (LEM_micr *cr)
 Powers off all the LAT components.
void PIG_shed (LEM_micr *cr)
 Calls PIG_safe, then opens the LAT side of the main feed switch to reduce the load on the SC.
unsigned PIG_get_pdus (LEM_micr *cr)
 Returns a two bit mask indicating the PDU(s) present in the C/R fabric.

Detailed Description

Implementation of the PIG power and C/R routines.

Author:
James Swain - jswain@slac.stanford.edu

Function Documentation

unsigned acd_off LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state
[inline, static]
 

Power on ACD and FREE boards as required.

Parameters:
cfg Pointer to a PIG configuration structure
state Poitner to a structure holding the register state
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
One of PIG_msgs

unsigned acd_on LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state,
const PIG_DB_Schema *  pdb
[inline, static]
 

Power on ACD and FREE boards as required.

Parameters:
cfg Pointer to a PIG configuration structure
state Poitner to a structure holding the register state
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
pdb Pointer to the structure holding the values of the write-once registers
Returns:
One of PIG_msgs

unsigned cr_ext LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state
[inline, static]
 

If indicated by the cfg structure, extract PDU(s), GEM, EBM to the C/R fabric.

Parameters:
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/CRU registers
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
One of the PIG_msgs

unsigned cr_ins LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state
[inline, static]
 

If indicated by the cfg structure, insert PDU(s), GEM, EBM to the C/R fabric.

Parameters:
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/CRU registers
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
One of the PIG_msgs

unsigned epus_off LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state
[inline, static]
 

Power on the EPUs as required, and update the state.

Parameters:
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
One of the PIG_msgs

unsigned epus_on LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state
[inline, static]
 

Power on the EPUs as required, and update the state.

Parameters:
cfg Pointer to a PIG configuration structure
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
Returns:
One of the PIG_msgs

void PIG_enter_SAA LEM_micr *  cr  ) 
 

Write registers to place the LAT into SAA mode.

Parameters:
cr Pointer to a structure holding correctly aligned mutli-item command and response lists

void PIG_exit_SAA LEM_micr *  cr  ) 
 

Write registers to pull the LAT out of SAA mode.

Parameters:
cr Pointer to a structure holding correctly aligned mutli-item command and response lists

unsigned PIG_extract LEM_micr *  cr,
PIG_cfg cfg
 

Extract one or more nodes from the C/R fabric, possibly powering off said node at the same time.

Parameters:
cfg Pointer to a PIG configuration structure
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
one of the PIG_msgs

unsigned PIG_get_pdus LEM_micr *  cr  ) 
 

Returns a two bit mask indicating the PDU(s) present in the C/R fabric.

Return values:
PDU mask
Parameters:
cr Pointer to a structure holding correctly aligned mutli-item command and response lists

unsigned PIG_insert LEM_micr *  cr,
PIG_cfg cfg
 

Insert one or more nodes into the C/R fabric, possibly powering on said node on at the same time.

Parameters:
cfg Pointer to a PIG configuration structure
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
one of the PIG_msgs

void PIG_safe LEM_micr *  cr  ) 
 

Powers off all the LAT components.

Parameters:
cr Pointer to a structure holding correctly aligned mutli-item command and response lists

void PIG_shed LEM_micr *  cr  ) 
 

Calls PIG_safe, then opens the LAT side of the main feed switch to reduce the load on the SC.

Parameters:
cr Pointer to a structure holding correctly aligned mutli-item command and response lists

unsigned tems_off LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state
[inline, static]
 

Power on the TEMs as required, and update the state.

Parameters:
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
Returns:
One of the PIG_msgs

unsigned tems_on LEM_micr *  cr,
PIG_cfg cfg,
PIG_state state,
const PIG_DB_Schema *  pdb
[inline, static]
 

Power on the TEMs as required, and update the state.

Parameters:
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
pdb Pointer to the structure holding the values of the write-once registers
Returns:
One of the PIG_msgs

unsigned twr_pwr LEM_micr *  cr,
unsigned short  mask,
PWR_TWR_SELECT  select,
PWR_TWR_STATE  state
[inline, static]
 

Power on the calorimeter towers as required.

Parameters:
cr Pointer to a structure holding correctly aligned mutli-item command and response lists
mask Mask of the towers to power on
select Selects Tracker or Calorimetre
state Turn ON or OFF
Returns:
One of PIG_msgs


Generated on Wed Mar 15 23:39:46 2006 by  doxygen 1.4.4