GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LEM / V4-8-1 > lem_cli / mv2304
#include <LEM/list_macros.h>
Defines | |
#define | LEM_ALLOCATE_CMD |
Create the lists for a responseless command. | |
#define | LEM_ALLOCATE_RSP |
Create the lists for a command with response. | |
#define | LEM_DO_SEND(encode, op, parity, p, args...) |
Encode and send the command across the LATp fabric, waiting for the response and checking for LCB transmit or receive errors. | |
#define | LEM_DO_CMD(encode, args...) |
Create responsless command and result lists, send the dataless command and return a status. | |
#define | LEM_DO_LOAD(encode, args...) |
Create responsless command and result lists, send the load command and return a status. | |
#define | LEM_DO_READ(encode, args...) |
Create response command and result lists and send the read command. | |
#define | LEM_DO_LOAD_LL(encode, upper, lower, args...) |
Handles loads where a 64 bit payload is split into 32 bit chunks. | |
#define | LEM_DO_ACD_CMD(encode, args...) |
Create responseless command and result lists, send the dataless command and returns a status. | |
#define | LEM_DO_ACD_LOAD(encode, args...) |
Create responsless command and result lists, send the load command and returns a status. | |
#define | LEM_DO_ACD_READ(encode, args...) |
Create response command and result lists and send the read command. | |
#define | LEM_DO_DECODE(decode, args...) |
Decode the response from a read command. |
$Id: cli_macros.h,v 1.14 2011/03/25 18:51:52 apw Exp $
#define LEM_ALLOCATE_CMD |
Value:
unsigned status = LEM_SUCCESS; \ LEM_sicl *request; \ LEM_cmd_sirl *result; \ unsigned buffer_size = LCB_REQUEST_LIST_ALIGN + sizeof(*request) \ + LCB_RESULT_LIST_ALIGN + sizeof(*result);\ unsigned char buffer[buffer_size]; \ request = (LEM_sicl* )LEM_ALIGN_REQUEST(buffer, 0); \ result = (LEM_cmd_sirl*)LEM_ALIGN_RESULT (request, sizeof(*request));
Referenced by LookAtMe(), and LookAtMeLCB().
#define LEM_ALLOCATE_RSP |
Value:
unsigned status = LEM_SUCCESS; \ LEM_sicl *request; \ LEM_rsp_sirl *result; \ unsigned buffer_size = LCB_REQUEST_LIST_ALIGN + sizeof(*request) \ + LCB_RESULT_LIST_ALIGN + sizeof(*result);\ unsigned char buffer[buffer_size]; \ request = (LEM_sicl* )LEM_ALIGN_REQUEST(buffer, 0); \ result = (LEM_rsp_sirl*)LEM_ALIGN_RESULT (request, sizeof(*request));
#define LEM_DO_ACD_CMD | ( | encode, | |||
args... | ) |
Value:
LEM_ALLOCATE_CMD; \ LEM_DO_SEND(encode, ACD_CMD_DATALESS, ## args, 0) \ return status;
encode Function to use to encode the arguments
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and ACD_CMD_DATALESS) and the last (which is always 0)
#define LEM_DO_ACD_LOAD | ( | encode, | |||
args... | ) |
Value:
LEM_ALLOCATE_CMD; \ LEM_DO_SEND(encode, ACD_CMD_LOAD, ## args); \ return status;
encode Function to use to encode the arguments
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and CMD_LOAD)
Referenced by AFE_load(), and ARC_load().
#define LEM_DO_ACD_READ | ( | encode, | |||
args... | ) |
Value:
LEM_ALLOCATE_RSP; \ LEM_DO_SEND(encode, ACD_CMD_READ, ## args, 0)
encode Function to use to encode the arguments
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and CMD_READ)
Referenced by AFE_read(), and ARC_read().
#define LEM_DO_CMD | ( | encode, | |||
args... | ) |
Value:
LEM_ALLOCATE_CMD; \ LEM_DO_SEND(encode, CMD_DATALESS, ## args, 0) \ return status;
encode Function to use to encode the arguments
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and CMD_DATALESS) and the last (which is always 0)
Referenced by AEM_CC_cmd(), AEM_ENV_cmd(), CCC_cmd(), CFE_cmd(), CRC_cmd(), CRU_cmd(), EBM_CC_cmd(), EBM_STAT_cmd(), GEM_CC_cmd(), GEM_cmd(), GEM_IE_cmd(), GEM_ROI_cmd(), GEM_SCHD_cmd(), GEM_STAT_cmd(), GEM_TAM_cmd(), GEM_WIN_cmd(), PDU_CC_cmd(), TCC_cmd(), TEM_cmd(), TFE_cmd(), TIC_cmd(), and TRC_cmd().
#define LEM_DO_DECODE | ( | decode, | |||
args... | ) |
Value:
decode(result->ri.payload.cell.data, ## args); \
return status;
decode Function to use to decode the arguments
args Usually a single pointer to location to place the decoded result, although for the TIC_ENV_decode routine this will be a set of three pointers
Referenced by AEM_CC_read(), CCC_read(), CRU_read(), EBM_CC_read(), EBM_STAT_read(), GEM_CC_read(), GEM_IE_read(), GEM_read(), GEM_ROI_read(), GEM_SCHD_read(), GEM_STAT_read(), GEM_TAM_read(), GEM_WIN_read(), PDU_CC_read(), PDU_ENV_read(), TCC_read(), TEM_read(), and TIC_read().
#define LEM_DO_LOAD | ( | encode, | |||
args... | ) |
Value:
LEM_ALLOCATE_CMD; \ LEM_DO_SEND(encode, CMD_LOAD, ## args); \ return status;
encode Function to use to encode the arguments
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and CMD_LOAD)
Referenced by AEM_CC_load(), CCC_load(), CFE_load(), CRC_load(), CRU_load(), EBM_CC_load(), EBM_STAT_load(), GEM_CC_load(), GEM_IE_load(), GEM_load(), GEM_ROI_load(), GEM_SCHD_load(), GEM_STAT_load(), GEM_TAM_load(), GEM_WIN_load(), PDU_CC_load(), TCC_load(), TEM_load(), and TIC_load().
#define LEM_DO_LOAD_LL | ( | encode, | |||
upper, | |||||
lower, | |||||
args... | ) |
Value:
unsigned long long payload = ((unsigned long long)(upper) << 32) | lower; \ LEM_DO_LOAD(encode, ## args, payload);
encode Function to use to encode the arguments
upper Most significant 32 bits of the payload
lower Least significant 32 bits of the payload
args The arguments to the encode function.
Referenced by AEM_ENV_load(), TDC_load(), TFE_load(), and TRC_load().
#define LEM_DO_READ | ( | encode, | |||
args... | ) |
Value:
LEM_ALLOCATE_RSP; \ LEM_DO_SEND(encode, CMD_READ, ## args, 0)
encode Function to use to encode the arguments
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and CMD_READ)
Referenced by AEM_CC_read(), AEM_ENV_read(), CCC_read(), CFE_read(), CRC_read(), CRU_read(), EBM_CC_read(), EBM_STAT_read(), GEM_CC_read(), GEM_IE_read(), GEM_read(), GEM_ROI_read(), GEM_SCHD_read(), GEM_STAT_read(), GEM_TAM_read(), GEM_WIN_read(), PDU_CC_read(), PDU_ENV_read(), TCC_read(), TDC_read(), TEM_read(), TFE_read(), TIC_ENV_read(), TIC_read(), and TRC_read().
#define LEM_DO_SEND | ( | encode, | |||
op, | |||||
parity, | |||||
p, | |||||
args... | ) |
Value:
{\ encode(&request->ci, op, ## args); \ parity(&request->ci, p); \ status = LCBD_qioW(LCBD_get(), sizeof(*request)/(2*sizeof(int)), \ (LCBD_cl*)request, (LCBD_rl*)result); \ if (_msg_failure(status)) return status; \ if (result->xcb.usr.rd.bf.xstatus) \ status = LCBD_rst_xfr_err_map(result->xcb.usr.rd.bf.xstatus);\ if (result->ri.err.ui) \ status = LCBD_rst_rcv_err_map(result->ri.err.ui); \ LEM_timestamp = result->ri.header.bf.timestamp; \ }
encode Function to use to encode the arguments
parity Function to use to set the parity bits
p Bit mask indicating which parity bits (if any) to invert
op Operation (CMD_LOAD | CMD_DATALESS | CMD_READ)
args The arguments to the encode function, except for the first two (which are always the LATpCommand structure and CMD_XXX)