GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-0-0 > lci / mv2304
#include "LCI/lci.h"
#include "ITC/ITC_pubdefs.h"
Typedefs | |
typedef struct _LCI_controller | LCI_controller |
Declaration of the opaque controller structure. | |
Functions | |
void | LCI_abort (void) |
Abort a calibration. | |
unsigned | LCI_calibrate (unsigned latccfg, unsigned lcicfg, unsigned lcirunid, ITC_NodeID iniNode, ITC_TaskID iniTask, ITC_QueueID iniQueue) |
Start a new calibration. | |
void | LCI_cb_statusFree (ITC_QueueItem *qitem, unsigned status, void *prm0, void *prm1, void *prm2, unsigned tx) |
unsigned | LCI_comp (unsigned comp) |
Set the calibration compression level. | |
unsigned | LCI_cycle (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned len) |
unsigned | LCI_cycles (void) |
Get the calibration cycle count. | |
void | LCI_deleteController (LCI_controller *cnt) |
Free the calibration controller structure. | |
unsigned | LCI_init (unsigned capacity, unsigned cpuid, unsigned srcid) |
Initialize the calibration system. | |
unsigned | LCI_monitor (unsigned mon) |
Set the calibration monitoring level. | |
LCI_controller * | LCI_newController (unsigned cap, unsigned cpuid, unsigned srcid) |
Create calibration controller structure. | |
unsigned | LCI_start (const TASK_attr *attr) |
Start the LCI task. | |
unsigned | LCI_startCycle (void) |
Request the next calibration cycle. | |
unsigned | LCI_status (void) |
Get the calibration state. | |
unsigned | LCI_terminate (unsigned status) |
Terminate a calibration. |
void LCI_abort | ( | void | ) |
Abort a calibration.
This routine is called when an abort calibration telecommand is received. If the current state is calibrating, it changes the state to aborting
unsigned LCI_calibrate | ( | unsigned | latccfg, | |
unsigned | lcicfg, | |||
unsigned | lcirunid, | |||
ITC_NodeID | iniNode, | |||
ITC_TaskID | iniTask, | |||
ITC_QueueID | iniQueue | |||
) |
Start a new calibration.
This routine is called when a start calibration telecommand is received. It first uses LATC to perform an initial LAT configuration then peforms a configure, collect, compact, consign cycle for each LCI configuration in the LCI file.
latccfg | File ID for the LATC configuration master to use with this calibration | |
lcicfg | File ID for the LCI configuration file to use to drive this calibration | |
lcirunid | Run ID to use in the datagrams | |
iniNode | Node ID of the task that initiated the calibration (used to send a message back when the calibration completes) | |
iniTask | Task ID of the task that initiated the calibration (used to send a message back when the calibration completes) | |
iniQueue | ID of the queue that will receive the status message. |
LCI_STATE | LCI is not in the correct state to start a calibration | |
ITC_ALOCFAIL | Memory allocation failure | |
ITC_FPAGET | Memory allocation from FPA failed | |
ITC_SENDNID | Invalid/unreachable destination node | |
ITC_SENDQID | Invalid/unreachable destination queue | |
ITC_SHRMEM | Shared memory pool stopping/stopped | |
ITC_SUCCESS | If an item is sent to the LCI bulk queue |
unsigned LCI_comp | ( | unsigned | comp | ) |
Set the calibration compression level.
This routine sets the LCI compression level and returns the old value. This feature is used only for testing.
comp | Compression level to set |
unsigned LCI_cycles | ( | void | ) |
Get the calibration cycle count.
This rouine returns the number of cycles performed since the last calibration command was issued.
void LCI_deleteController | ( | LCI_controller * | cnt | ) |
Free the calibration controller structure.
This routine frees all the resources associated with the LCI task.
unsigned LCI_init | ( | unsigned | capacity, | |
unsigned | cpuid, | |||
unsigned | srcid | |||
) |
Initialize the calibration system.
This routine performs resource allocation, initializes the ITC message queues, and sets the state to INITIALISED.
srcid | ID of the source of data being processed through LCI | |
cpuid | ID of the CPU LCI is being run on | |
capacity | Maximum number of events per calibration cycle. |
unsigned LCI_monitor | ( | unsigned | mon | ) |
Set the calibration monitoring level.
This routine sets the LCI monitoring level and returns the old value.
mon | Monitoring level to set |
LCI_controller* LCI_newController | ( | unsigned | cap, | |
unsigned | cpuid, | |||
unsigned | srcid | |||
) |
Create calibration controller structure.
This routine allocates memory for an LCI_controller structure and all associated structures.
srcid | ID of the source of data being processed through LCI | |
cpuid | ID of the CPU LCI is being run on | |
cap | Capacity of the calibration task, the maximum number of events that can be collected each cycle |
unsigned LCI_start | ( | const TASK_attr * | attr | ) |
Start the LCI task.
This routine starts the LCI task and waits for it be up and running before setting the state to WAITING.
attr | Task attributes to use for the LCI task. |
unsigned LCI_startCycle | ( | void | ) |
Request the next calibration cycle.
This routine is called whenever the next (or first) calibration cycle is to be performed. It puts an empty item to the LCI bulk queue to initiate the cycle. This indirection is needed to allow any abort requests to be processed in a timely manner.
LCI_QITEM | The attempt to allocate a QueueItem fails | |
ITC_ALOCFAIL | Memory allocation failure | |
ITC_FPAGET | Memory allocation from FPA failed | |
ITC_SENDNID | Invalid/unreachable destination node | |
ITC_SENDQID | Invalid/unreachable destination queue | |
ITC_SHRMEM | Shared memory pool stopping/stopped | |
ITC_SUCCESS | If an item is sent to the LCI bulk queue |
!!! KULDGE - ITC won't accept a NULL payload pointer.
unsigned LCI_status | ( | void | ) |
Get the calibration state.
This routine returns the current state of LCI.
unsigned LCI_terminate | ( | unsigned | status | ) |
Terminate a calibration.
This routine finishes out the calibration by sending a status message back to the originating task and setting the state to WAITING.
status | Termination status of the last calibration cycle, and hence of the whole calibration |
LCI_QITEM | The attempt to allocate a QueueItem fails | |
ITC_ALOCFAIL | Memory allocation failure | |
ITC_FPAGET | Memory allocation from FPA failed | |
ITC_SENDNID | Invalid/unreachable destination node | |
ITC_SENDQID | Invalid/unreachable destination queue | |
ITC_SHRMEM | Shared memory pool stopping/stopped | |
ITC_SUCCESS | If the item is sent |