GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PIG / V9-0-0

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:


Defines

#define inline   __inline

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 cr_ext (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 If indicated by the cfg structure, extract PDU(s), GEM, EBM from 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 epus_off (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power off 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 tems_off (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power off the TEMs as required, and update the state.
static unsigned twr_pwr (LEM_micr *cr, unsigned short mask, PWR_TWR_SELECT select, PWR_TWR_STATE state, const PIG_DB_Schema *pdb)
 Power on or off the towers as required.
static unsigned acd_on (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state, const PIG_DB_Schema *pdb)
 Power on ACD as required and update state.
static unsigned acd_off (LEM_micr *cr, PIG_cfg *cfg, PIG_state *state)
 Power off ACD as required.
static unsigned free_on (LEM_micr *cr, PIG_cfg *cfg)
 Power on FREE boards as required.
static unsigned free_off (LEM_micr *cr, PIG_cfg *cfg)
 Power off FREE boards 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 & Owen Saxton
Id
cmdrsp.c,v 1.40 2006/09/27 23:40:06 saxton Exp

Function Documentation

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

Power off ACD as required.

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure holding the register state
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 as required and update state.

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure holding the register state
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 from the C/R fabric.

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/CRU registers
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:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/CRU registers
Returns:
One of the PIG_msgs

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

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

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
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:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
Returns:
One of the PIG_msgs

unsigned free_off LEM_micr *  cr,
PIG_cfg cfg
[inline, static]
 

Power off FREE boards as required.

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

unsigned free_on LEM_micr *  cr,
PIG_cfg cfg
[inline, static]
 

Power on FREE boards as required.

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
Returns:
One of 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 multi-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 multi-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:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
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.

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

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:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
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 multi-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 multi-item command and response lists

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

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

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
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:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
cfg Pointer to a PIG configuration structure
state Pointer to a structure for caching the state of the PDU/EBM/CRU registers
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,
const PIG_DB_Schema *  pdb
[inline, static]
 

Power on or off the towers as required.

Parameters:
cr Pointer to a structure holding correctly aligned multi-item command and response lists
mask Mask of the towers to power on or off
select Selects Tracker or Calorimeter
state Turn ON or OFF
pdb Pointer to the structure holding the values of the write-once registers
Returns:
One of PIG_msgs


Generated on Thu Oct 26 13:56:24 2006 by  doxygen 1.4.4