GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LEM / V4-7-1

Constituent: lem_lists     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

list.h File Reference

Functions giving size of and allocating command/response lists. More...

#include "LEM/list_macros.h"

Include dependency graph for list.h:

This graph shows which files directly or indirectly include this file:


Functions

size_t LEM_sizeofCmdList (unsigned nItems)
size_t LEM_sizeofRspList (unsigned nItems)
size_t LEM_sizeofRsplsList (unsigned nItems)
size_t LEM_sizeofDcdList (unsigned nItems)
void * LEM_allocCmdList (unsigned nItems)
void * LEM_allocRspList (unsigned nItems)
void * LEM_allocRsplsList (unsigned nItems)
void * LEM_allocDcdList (unsigned nItems)
void LEM_initCmdRsp (LEM_micr *cr, unsigned nItems, void *cmdList, void *rspList, void *dcdList)
unsigned LEM_allocCmdRsp (LEM_micr *cr, unsigned nItems)
void LEM_freeCmdRsp (LEM_micr *cr)
 Free the memory previously allocated and "zero" the structure.
LEM_micrLEM_newMICR (void)
 Allocate a multi-item command response structure, allocate the lists.
void LEM_deleteMICR (LEM_micr *cr)
 Free the command and response list, free the LEM_micr structure.
void LEM_dumpMICR (LEM_micr *cr)
 Print out the command and response lists in some nice formatted manner.
unsigned LEM_queueWait (LEM_micr *cr)
 Queue a homogeneous list of commands to the LCB, wait for the list to complete then check for transfer errors.
unsigned LEM_handleLoadErrors (LEM_micr *cr)
 Assumes that the command list was a homogeneous list of load commands so iterates over the responsless version of the result list and checks that there were no errors.
unsigned LEM_handleReadErrors (LEM_micr *cr)
 Assumes that the command list was a homogeneous list of read commands so iterates over the respons version of the result list and checks that there were no errors.
unsigned LEM_decode (LEM_micr *cr)
 Iterates through the result items, checks for errors then calls the decode-item function using the result-item payload an decode-item des pointer as parameters.
void LEM_errorIgnore (unsigned error, unsigned index, void *param)
 NO-OP function with the signature of an error handling function.

Detailed Description

Functions giving size of and allocating command/response lists.

Author:
James Swain - jswain@slac.stanford.edu
history 08 Dec 2004: Created.

Function Documentation

void* LEM_allocCmdList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Allocate a correctly aligned block of memeory that will accomodate the maximum size of command list

unsigned LEM_allocCmdRsp LEM_micr cr,
unsigned  nItems
 

Parameters:
cr Pointer to the structure that will hold pointers to the lists
nItems Number of items on the lists
Returns:
LEM_SUCCESS if all goes well, or LEM_MEMERR if the allocation failes

void* LEM_allocDcdList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Allocate a block of memory that will accomodate the requested number of decode items

void* LEM_allocRspList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Allocate a correctly aligned block of memory that will accomodate the maximum size of response-containing result list

void* LEM_allocRsplsList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Allocate a correctly aligned block of memory that will accomodate the maximum size of responsless result list

unsigned LEM_decode LEM_micr cr  ) 
 

Iterates through the result items, checks for errors then calls the decode-item function using the result-item payload an decode-item des pointer as parameters.

Parameters:
cr Pointer to a multi-item C/R structure that has been filled, queued and transferred correctly
Returns:
Mapped resutl item error from LCBD, or LEM_SUCCESS if all result items are good.
If a result item has an error, and an error handling routine has been included in the decode item then the error handling routine is called (use LEM_errorIgnore to ignore errors and use LEM_errorReport to just report the error without further action). If the efn pointer is NULL, then the decode reports and then halts on the first error.

void LEM_deleteMICR LEM_micr cr  ) 
 

Free the command and response list, free the LEM_micr structure.

Parameters:
cr Pointer to an LEM_micr structure created using LEM_newMICR

void LEM_dumpMICR LEM_micr cr  ) 
 

Print out the command and response lists in some nice formatted manner.

Parameters:
cr Pointer to an initialised, filled mulit-item command/response structure

void LEM_errorIgnore unsigned  error,
unsigned  index,
void *  param
 

NO-OP function with the signature of an error handling function.

Parameters:
error Error field of the result item
index Position of the result list of the failed item
param User defined parameter
Use this to ignore errors in result lists

void LEM_freeCmdRsp LEM_micr cr  ) 
 

Free the memory previously allocated and "zero" the structure.

Parameters:
cr Pointer to a command response list created with LEM_allocCmdRsp

unsigned LEM_handleLoadErrors LEM_micr cr  ) 
 

Assumes that the command list was a homogeneous list of load commands so iterates over the responsless version of the result list and checks that there were no errors.

Parameters:
cr Pointer to a multi-item C/R structure that has been filled, queue and transferred correctly
Returns:
Mapped result item error from LCBD, if no error handling function is defined, or LEM_SUCCESS.
If a result item has an error, and an error handling routine has been included in the decode item then the error handling routine is called (use LEM_errorIgnore to ignore errors and use LEM_errorReport to just report the error without further action). If the efn pointer is NULL, then fn reports and then halts on the first error.

unsigned LEM_handleReadErrors LEM_micr cr  ) 
 

Assumes that the command list was a homogeneous list of read commands so iterates over the respons version of the result list and checks that there were no errors.

Parameters:
cr Pointer to a multi-item C/R structure that has been filled, queued and transferred correctly
Returns:
Mapped result item error from LCBD, if no error handling function is defined, or LEM_SUCCESS.
If a result item has an error, and an error handling routine has been included in the decode item then the error handling routine is called (use LEM_errorIgnore to ignore errors and use LEM_errorReport to just report the error without further action). If the efn pointer is NULL, then fn reports and then halts on the first error.

void LEM_initCmdRsp LEM_micr cr,
unsigned  nItems,
void *  cmdList,
void *  rspList,
void *  dcdList
 

Parameters:
cr Pointer to the structure that will hold pointer to the lists
nItems Number of items on the lists
cmdList Pointer to a block of memory aligned to be a command (request) list
rspList Pointer to a block of memory aligned to be a result list - the same memory is used for both responsefull and responseless lists
dcdList Pointer to a block of memeory for the decode list

LEM_micr* LEM_newMICR void   ) 
 

Allocate a multi-item command response structure, allocate the lists.

Returns:
Pointer to an initialised multi-item command/response structure (with maximum length lists)

unsigned LEM_queueWait LEM_micr cr  ) 
 

Queue a homogeneous list of commands to the LCB, wait for the list to complete then check for transfer errors.

Parameters:
cr Pointer to an initialised multi-item command/response structure with populated command list
Returns:
Mapped transfer or result item error from LCBD, or LEM_SUCCESS

size_t LEM_sizeofCmdList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Size of the command list with the maximum number of command items in it

size_t LEM_sizeofDcdList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Size of the decode list with the requested number of decode items

size_t LEM_sizeofRspList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Size of the result list with the maximum number of response-containing result items in it

size_t LEM_sizeofRsplsList unsigned  nItems  ) 
 

Parameters:
nItems Number of items on the command and response lists
Returns:
Size of the result list with the maximum number of responseless result items in it


Generated on Thu Apr 13 23:00:48 2006 by  doxygen 1.4.4