GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PIG / V10-1-5 > pig_flying / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

pig.h File Reference

Interface to Power and the Initialisation of the GASU routines. More...

#include <PIG/const.h>
#include <PIG/structs.h>
#include <ITC/ITC_pubdefs.h>

Functions

unsigned PIG_bias_ACD (PIG_acd_bias *bias)
 Load the ACD bias DAC registers.
unsigned PIG_bias_ACD_off (unsigned mask)
 Turn off ACD bias voltages.
unsigned PIG_bias_ACD_on (unsigned mask)
 Turn on ACD bias voltages.
unsigned PIG_bias_CAL (PIG_cal_bias *bias)
 Load the CAL bias DAC registers.
unsigned PIG_bias_CAL_off (unsigned mask)
 Turn off CAL bias voltages.
unsigned PIG_bias_CAL_on (unsigned mask)
 Turn on CAL bias voltages.
unsigned PIG_bias_TKR (PIG_tkr_bias *bias)
 Load the TKR bias DAC registers.
unsigned PIG_bias_TKR_off (unsigned mask)
 Turn off TKR bias voltages.
unsigned PIG_bias_TKR_on (unsigned mask)
 Turn on TKR bias voltages.
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_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_extract_evt (PIG_evt_cfg *cfg)
 Extract one or more nodes from the event fabric.
unsigned PIG_get_ebmState (unsigned int *inputs, unsigned int *contributors, unsigned int *destinations)
 Return the EBM configuration masks.
unsigned PIG_get_pdus (void)
 Get PDUs present.
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_insert_evt (PIG_evt_cfg *cfg)
 Insert one or more nodes into the event fabric.
unsigned PIG_order_EPU (unsigned order[PIG_N_EPU])
 Change the power-on order of the EPUs from the default to order.
unsigned PIG_order_FREE (unsigned order[PIG_N_FREE])
 Change the power-on order of the FREE boards from the default to order.
unsigned PIG_order_TEM (unsigned order[PIG_N_TEM])
 Change the power-on order of the TEMs from the default to order.
unsigned PIG_record (void *buf, ITC_cb_Completion *rtn, void *prm0, void *prm1, void *prm2)
 Record the PIG registers to the SSR.
unsigned PIG_safe (void)
 Power off all the LAT components.
void PIG_set_epu_delay (unsigned delay)
 Set the delay after EPU power on.
void PIG_set_off_delay (unsigned delay)
 Set the delay after power-off of a component.
void PIG_set_on_delay (unsigned delay)
 Set the delay after power-on of a component.
unsigned PIG_shed (void)
 Shed the LAT power load.
unsigned PIG_siu_init (PIG_siu_cfg cfg)
 Configure the SIU in response to the MAIN_FEED_ON notification.
size_t PIG_sizeofRecord (void)
 Get the size of a PIG datagram.
unsigned PIG_verify (void)
 Verify the PIG state.


Detailed Description

Interface to Power and the Initialisation of the GASU routines.

Author:
James Swain & Owen Saxton
$Id: pig.h,v 1.34 2011/03/28 17:00:33 saxton Exp $

Function Documentation

unsigned PIG_bias_ACD ( PIG_acd_bias bias  ) 

Load the ACD bias DAC registers.

Parameters:
bias Pointer to structure containing the bias voltage values
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

References _PIG_pwrState::acd_hv, _PIG_pwrState::acd_mode, _PIG_pwrState::acd_on, _PIG_pwrState::acd_saa, _PIG_pwrState::aem, _PIG_acd_bias::arc, getPwrState(), _PIG_arc_bias::hv_bias, _PIG_arc_bias::hv_valid, _PIG_arc_bias::hvbs1, _PIG_arc_bias::hvbs2, PIG_ARC_HV1_MASK, PIG_ARC_HV2_MASK, PIG_ARC_HV_MASK, PIG_N_FREE, _PIG_arc_bias::saa_bias, _PIG_arc_bias::saa_valid, savePwrState(), _PIG_arc_bias::veto_en_a, and _PIG_arc_bias::veto_en_b.

unsigned PIG_bias_ACD_off ( unsigned  mask  ) 

Turn off ACD bias voltages.

Parameters:
mask Mask specifying the FREE boards for which the bias voltage is to be turned off.
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_ACD_on ( unsigned  mask  ) 

Turn on ACD bias voltages.

Parameters:
mask Mask specifying the FREE boards for which the bias voltage is to be turned on.
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_CAL ( PIG_cal_bias bias  ) 

Load the CAL bias DAC registers.

Parameters:
bias Pointer to structure containing the bias voltage values
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_CAL_off ( unsigned  mask  ) 

Turn off CAL bias voltages.

Parameters:
mask Mask specifying the towers for which the CAL bias voltage is to be turned off.
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_CAL_on ( unsigned  mask  ) 

Turn on CAL bias voltages.

Parameters:
mask Mask specifying the towers for which the CAL bias voltage is to be turned on.
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_TKR ( PIG_tkr_bias bias  ) 

Load the TKR bias DAC registers.

Parameters:
bias Pointer to structure containing the bias voltage values
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_TKR_off ( unsigned  mask  ) 

Turn off TKR bias voltages.

Parameters:
mask Mask specifying the towers for which the TKR bias voltage is to be turned off.
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
LEM_xxxxx Various LEM/LCBD errors

unsigned PIG_bias_TKR_on ( unsigned  mask  ) 

Turn on TKR bias voltages.

Parameters:
mask Mask specifying the towers for which the TKR bias voltage is to be turned on.
Return values:
PIG_INMUD Success
PIG_CRLSMALL Couldn't initialize C/R list
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

References _PIG_tem::cal, _PIG_state::cru, getState(), _PIG_state::pdu, readCruState(), readPduState(), saveState(), _PIG_cfg::tem, and _PIG_tem::tkr.

unsigned PIG_extract_evt ( PIG_evt_cfg cfg  ) 

Extract one or more nodes from the event fabric.

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

References _PIG_ebmState::contributors, _PIG_ebmState::destinations, _PIG_ebmState::inputs, readEbmState(), and saveEbmState().

Referenced by PIG_shed().

unsigned 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

References _PIG_ebmState::contributors, _PIG_ebmState::destinations, _PIG_state::ebm, and _PIG_ebmState::inputs.

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

References _PIG_cruState::command, readCruState(), and _PIG_cruState::response.

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

References _PIG_tem::cal, _PIG_state::cru, getState(), _PIG_state::pdu, readCruState(), readPduState(), saveState(), _PIG_cfg::tem, and _PIG_tem::tkr.

unsigned PIG_insert_evt ( PIG_evt_cfg cfg  ) 

Insert one or more nodes into the event fabric.

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

References _PIG_ebmState::contributors, _PIG_ebmState::destinations, _PIG_ebmState::inputs, readEbmState(), and saveEbmState().

Referenced by PIG_siu_init().

unsigned PIG_order_EPU ( unsigned  order[PIG_N_EPU]  ) 

Change the power-on order of the EPUs from the default to order.

Parameters:
order Array of EPU ids specifying the power on order
Return values:
PIG_INMUD Success
PIG_BADORD Array of IDs contains duplicate or out of range values

References epu_order.

unsigned PIG_order_FREE ( unsigned  order[PIG_N_FREE]  ) 

Change the power-on order of the FREE boards from the default to order.

Parameters:
order Array of FREE ids specifying the power on order
Return values:
PIG_INMUD Success
PIG_BADORD Array of IDs contains duplicate or out of range values

References free_order.

unsigned PIG_order_TEM ( unsigned  order[PIG_N_TEM]  ) 

Change the power-on order of the TEMs from the default to order.

Parameters:
order Array of TEM ids specifying the power on order
Return values:
PIG_INMUD Success
PIG_BADORD Array of IDs contains duplicate or out of range values

References tem_order.

unsigned PIG_record ( void *  buf,
ITC_cb_Completion *  rtn,
void *  prm0,
void *  prm1,
void *  prm2 
)

Record the PIG registers to the SSR.

Takes a snapshot of the registers controlled by PIG and sends the resulting record to the SSR

Parameters:
buf Pointer to a buffer to use for the record
rtn Completion routine
prm0 Completion routine user parameter 0
prm1 Completion routine user parameter 1
prm2 Completion routine user parameter 2

References PIG_sizeofRecord(), and readState().

unsigned PIG_safe ( void   ) 

void PIG_set_epu_delay ( unsigned  delay  ) 

Set the delay after EPU power on.

Parameters:
delay Time (in 100ths of a second) to wait after powering on an EPU

References pig_epu_delay.

void PIG_set_off_delay ( unsigned  delay  ) 

Set the delay after power-off of a component.

Parameters:
delay Time (in 100ths of a second) to wait after powering off a component

References pig_off_delay.

void PIG_set_on_delay ( unsigned  delay  ) 

Set the delay after power-on of a component.

Parameters:
delay Time (in 100ths of a second) to wait after powering on a component

References pig_on_delay.

unsigned PIG_shed ( void   ) 

Shed the LAT power load.

This routine powers down all the components of the LAT.

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

References PIG_extract_evt(), and PIG_safe().

unsigned PIG_siu_init ( PIG_siu_cfg  cfg  ) 

Configure the SIU in response to the MAIN_FEED_ON notification.

Parameters:
cfg SIU configuration structure
Returns:
One of the PIG_msgs

References cmdrsp_init(), _PIG_siu_cfg::dab_s, getPwrState(), PIG_insert_evt(), savePwrState(), _PIG_pwrState::sib, SIB_query(), _PIG_evt_cfg::siu, and _PIG_siu_cfg::siu_i.

size_t PIG_sizeofRecord ( void   ) 

Get the size of a PIG datagram.

Calculates the space required to send a record of the registers controlled by PIG to the SSR.

Returns:
Size of a record in bytes

Referenced by PIG_record().

unsigned PIG_verify ( void   ) 


Generated on Fri Sep 30 18:51:58 2011 by  doxygen 1.5.8