GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIH / dev > lih_test / rad750


Interface   Data Structures   File List   Data Fields   Globals  

LIH_test.c File Reference

Some useful LIH commands (to be run on same CPU as LIH task). More...

#include <stdio.h>
#include <CCSDS/CCSDS_pkt.h>
#include <ITC/ITC_pubdefs.h>
#include <LIH/LIH_msgs.h>
#include <LIH/LIH_cmddefs.h>
#include <LIH_prvdefs.h>

Defines

#define LIH_L_TESTPKT   (256)

Functions

unsigned char * composeCommand (unsigned int func, unsigned int size)
 Start filling out a telecommand.
void freePacket (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2)
 Free the LIH command "buffer".
void LIH_dumpAdc (unsigned int adx)
 Immediate dump of the database entries for an ADC.
unsigned int LIH_sendDumpLimits (unsigned int reason, unsigned int ident)
 Send command to dump the limits.
unsigned int LIH_sendDumpLimitsAdc (unsigned int adx)
 Send command to dump the limits for a single ADC.
unsigned int LIH_sendEnableActions (unsigned int state)
 Send command enable/disable taking action on limits.
unsigned int LIH_sendSetActionsAdc (unsigned int adx, unsigned int from, unsigned int to, signed short alert, signed short diag, signed short msg)
 Send command enable/disable taking action on limits.
unsigned int LIH_sendSetLimitsAdc (unsigned int adx, signed short zero, signed short one, signed short two, signed short three, signed short four, signed short five)
 Send command enable/disable taking action on limits.
unsigned int LIH_sendSetNagTimesAdc (unsigned int adx, signed int zero, signed int one, signed int two, signed int three, signed int four, signed int five, signed int six, signed int seven)
 Send command enable/disable taking action on limits.
unsigned int LIH_sendSetPersistAdc (unsigned int adx, signed int delta)
 Send command enable/disable taking action on limits.
unsigned int LIH_sendSetSettleAdc (unsigned int adx, signed int delta)
 Send command enable/disable taking action on limits.

Variables

static unsigned int LIH_lock
 Test packet interlock control.
static unsigned char LIH_pkt [LIH_L_TESTPKT]
 Test packet buffer.
ITC_CommandItem LIH_CmdLength [10]
 Annoying. Must be maintained by hand.


Detailed Description

Some useful LIH commands (to be run on same CPU as LIH task).

CVS $Id: LIH_test.c,v 1.2 2011/03/29 22:38:00 apw Exp $
Author:
A.P.Waite

Function Documentation

unsigned char * composeCommand ( unsigned int  func,
unsigned int  size 
)

Start filling out a telecommand.

Parameters:
func (in) Function code
size (in) Command size
Return values:
NULL Command buffer in use
x Address of queue item

References freePacket().

Referenced by LIH_sendDumpLimits(), LIH_sendDumpLimitsAdc(), LIH_sendEnableActions(), LIH_sendSetActionsAdc(), LIH_sendSetLimitsAdc(), LIH_sendSetNagTimesAdc(), LIH_sendSetPersistAdc(), and LIH_sendSetSettleAdc().

void freePacket ( ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2 
)

Free the LIH command "buffer".

Parameters:
qitem (in) Queue item (unused)
status (in) Processing completion code (unused)
prm0 (in) User parameter 0 (unused)
prm1 (in) User parameter 1 (unused)
prm2 (in) User parameter 2 (unused)
Return values:
LIH_SUCCESS Success
freePacket() frees a test packet.

Referenced by composeCommand(), LIH_sendDumpLimits(), LIH_sendDumpLimitsAdc(), LIH_sendEnableActions(), LIH_sendSetActionsAdc(), LIH_sendSetLimitsAdc(), LIH_sendSetNagTimesAdc(), LIH_sendSetPersistAdc(), and LIH_sendSetSettleAdc().

void LIH_dumpAdc ( unsigned int  adx  ) 

Immediate dump of the database entries for an ADC.

Parameters:
adx (in) ADC index
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_Control::enable, and _LIH_Control::tbl.

unsigned int LIH_sendDumpLimits ( unsigned int  reason,
unsigned int  ident 
)

Send command to dump the limits.

Parameters:
reason (in) Reason for generating this dump
ident (in) User provided dump identifier
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References composeCommand(), freePacket(), _LIH_DumpLimits_Prm::ident, LIH_DUMPLIMITS_FCODE, _LIH_DumpLimits_Pkt::pay, and _LIH_DumpLimits_Prm::reason.

unsigned int LIH_sendDumpLimitsAdc ( unsigned int  adx  ) 

Send command to dump the limits for a single ADC.

Parameters:
adx (in) ADC index
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_DumpLimitsAdc_Prm::adx, composeCommand(), freePacket(), LIH_DUMPLIMITSADC_FCODE, and _LIH_DumpLimitsAdc_Pkt::pay.

unsigned int LIH_sendEnableActions ( unsigned int  state  ) 

Send command enable/disable taking action on limits.

Parameters:
state (in) Enable/disable (boolean, 1 => enable)
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References composeCommand(), freePacket(), LIH_ENABLEACTIONS_FCODE, _LIH_EnableActions_Pkt::pay, and _LIH_EnableActions_Prm::state.

unsigned int LIH_sendSetActionsAdc ( unsigned int  adx,
unsigned int  from,
unsigned int  to,
signed short  alert,
signed short  diag,
signed short  msg 
)

Send command enable/disable taking action on limits.

Parameters:
adx (in) ADC index
from (in) Previous state
to (in) Next state
alert (in) Action: generate an alert
diag (in) Action: ping a housekeeping packet
msg (in) Action: generate message (with severity)
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_SetActionsAdc_Prm::adx, _LIH_SetActionsAdc_Prm::alert, composeCommand(), _LIH_SetActionsAdc_Prm::diag, freePacket(), _LIH_SetActionsAdc_Prm::from, LIH_SETACTIONSADC_FCODE, _LIH_SetActionsAdc_Prm::msg, _LIH_SetActionsAdc_Pkt::pay, and _LIH_SetActionsAdc_Prm::to.

unsigned int LIH_sendSetLimitsAdc ( unsigned int  adx,
signed short  zero,
signed short  one,
signed short  two,
signed short  three,
signed short  four,
signed short  five 
)

Send command enable/disable taking action on limits.

Parameters:
adx (in) ADC index
zero (in) limit[0]
one (in) limit[1]
two (in) limit[2]
three (in) limit[3]
four (in) limit[4]
five (in) limit[5]
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_SetLimitsAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETLIMITSADC_FCODE, _LIH_SetLimitsAdc_Prm::limit, and _LIH_SetLimitsAdc_Pkt::pay.

unsigned int LIH_sendSetNagTimesAdc ( unsigned int  adx,
signed int  zero,
signed int  one,
signed int  two,
signed int  three,
signed int  four,
signed int  five,
signed int  six,
signed int  seven 
)

Send command enable/disable taking action on limits.

Parameters:
adx (in) ADC index
zero (in) nag[0]
one (in) nag[1]
two (in) nag[2]
three (in) nag[3]
four (in) nag[4]
five (in) nag[5]
six (in) nag[6]
seven (in) nag[7]
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_SetNagTimesAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETNAGTIMESADC_FCODE, _LIH_SetNagTimesAdc_Prm::nag, and _LIH_SetNagTimesAdc_Pkt::pay.

unsigned int LIH_sendSetPersistAdc ( unsigned int  adx,
signed int  delta 
)

Send command enable/disable taking action on limits.

Parameters:
adx (in) ADC index
delta (in) Delta persistence time
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_SetPersistAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETPERSISTADC_FCODE, _LIH_SetPersistAdc_Pkt::pay, and _LIH_SetPersistAdc_Prm::persist.

unsigned int LIH_sendSetSettleAdc ( unsigned int  adx,
signed int  delta 
)

Send command enable/disable taking action on limits.

Parameters:
adx (in) ADC index
delta (in) Delta persistence time
Return values:
LIH_GENERROR Failure
LIH_SUCCESS Success

References _LIH_SetSettleAdc_Prm::adx, composeCommand(), freePacket(), LIH_SETSETTLEADC_FCODE, _LIH_SetSettleAdc_Pkt::pay, and _LIH_SetSettleAdc_Prm::settle.


Variable Documentation

ITC_CommandItem LIH_CmdLength[10]

Initial value:

 
{
    { 0 ,  8, NULL },
    { 1 , 12, NULL },
    { 2 , 10, NULL },
    { 3 , 22, NULL },
    { 4 , 20, NULL },
    { 5 , 44, NULL },
    { 6 , 16, NULL },
    { 7 , 16, NULL },
    { 8 , 10, NULL },
    { 9 , 16, NULL }
}
Annoying. Must be maintained by hand.


Generated on Tue Mar 29 15:49:42 2011 by  doxygen 1.5.8