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

Constituent: pig_flying     Tag: linux-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_p.h"
#include "state_p.h"
#include "pig_macro_p.h"
#include "PIG/power.h"
#include "PIG/PIG_msgs.h"
#include "PIG_DB/schema.h"
#include "CDM/CDM_pubdefs.h"
#include "LEM/list.h"
#include "LEM/encode.h"
#include "LEM/decode.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,
  ARC_LAM_STALL = 320
}

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 (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 (PIG_cfg *cfg)
 Extract one or more nodes from the C/R fabric, possibly powering off said node at the same time.
unsigned PIG_enter_SAA (void)
 Write registers to place the LAT into SAA mode.
unsigned PIG_exit_SAA (void)
 Write registers to pull the LAT out of SAA mode.
unsigned PIG_safe (void)
 Powers off all the LAT components.
unsigned PIG_shed (void)
 Shed the LAT power load.
unsigned PIG_get_pdus (void)
 Get PDUs present.

Detailed Description

Implementation of the PIG power and C/R routines.

Author:
James Swain & Owen Saxton
Id
cmdrsp.c,v 1.44 2007/10/10 23:16:18 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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_enter_SAA void   ) 
 

Write registers to place the LAT into SAA mode.

Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_exit_SAA void   ) 
 

Write registers to pull the LAT out of SAA mode.

Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_extract 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
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_get_pdus void   ) 
 

Get PDUs present.

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

Returns:
PDU mask

unsigned PIG_insert 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
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_safe void   ) 
 

Powers off all the LAT components.

Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_shed void   ) 
 

Shed the LAT power load.

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

Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors

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
Return values:
PIG_INMUD Success
LEM_xxxxx Various LEM/LCBD errors


Generated on Thu Oct 11 05:40:40 2007 by  doxygen 1.4.4