GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LEM / V4-8-1 > lem / rad750
#include <LEM/LEM_msgs.h>
#include <LEM/encode.h>
#include <LEM/encode_macros.h>
#include <LEM_DB/schema.h>
#include <MSG/MSG_pubdefs.h>
#include <stdio.h>
Functions | |
| static __inline unsigned | getWait (LEM_FUNCTION function, unsigned addr0, unsigned addr1, unsigned addr2, unsigned addr3, unsigned regId) |
| Get the stall/timeout for this register operation. | |
| void | LEM_set_load_to (unsigned timeout) |
| Retained for backward compatibility. | |
| void | LEM_set_read_to (unsigned timeout) |
| Retained for backward compatibility. | |
| unsigned | LEM_get_load_to (void) |
| Retained for backward compatibility. | |
| unsigned | LEM_get_read_to (void) |
| Retained for backward compatibility. | |
| void | TEM_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the common controller block of a TEM. | |
| void | TIC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the TIC block of a TEM. | |
| void | CCC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned ccc, unsigned reg, unsigned payload) |
| Create a LATp command targeted at a CCC. | |
| void | CRC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned ccc, unsigned crc, unsigned reg, unsigned short payload) |
| Create a LATp command targeted at a CRC. | |
| void | CFE_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned ccc, unsigned crc, unsigned cfe, unsigned reg, unsigned short payload) |
| Create a LATp command targeted at a CFE. | |
| void | TCC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned tcc, unsigned reg, unsigned payload) |
| Create a LATp command targeted at a TCC. | |
| void | TRC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned tcc, unsigned trc, unsigned reg, unsigned long long payload) |
| Create a LATp command targeted at a TRC. | |
| void | TFE_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned tcc, unsigned trc, unsigned tfe, unsigned reg, unsigned long long payload) |
| Create a LATp command targeted at a TFE. | |
| void | TDC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned tcc, unsigned trc, unsigned tfe, unsigned long long payload) |
| Create a LATp command targeted at the DAC register of a TFE. | |
| void | AEM_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the common controller block of the AEM. | |
| void | AEM_ENV_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned long long payload) |
| Create a LATp command targeted at the Environment block of the AEM. | |
| void | ARC_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned arc, unsigned reg, unsigned short payload) |
| Create a LATp command targeted at an ARC. | |
| void | AFE_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned arc, unsigned afe, unsigned reg, unsigned short payload) |
| Create a LATp command targeted at an AFE. | |
| void | PDU_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the common controller of the PDU. | |
| void | PDU_ENV_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the environment block of the PDU. | |
| void | CRU_encode (LEM_ci *cmd, LEM_FUNCTION function, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the CRU. | |
| void | EBM_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the common controller block of the EBM. | |
| void | EBM_STAT_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the statistics block of the EBM. | |
| void | GEM_encode (LEM_ci *cmd, LEM_FUNCTION function, LEM_LATP_ADDR addr, LEM_REG_BLK blk, unsigned reg, unsigned payload) |
| Create a LATp command targeted at the GEM. | |
| void | LAM_encode (LEM_ci *cmd, LEM_LATP_ADDR addr) |
| Create a look-at-me command. | |
| void | LAM_LCB_encode (LEM_ci *cmd, LEM_LATP_ADDR addr, unsigned value, unsigned enable_mask) |
| Create a look-at-me command targetted at an LCB. | |
$Id: encode.c,v 1.16 2011/03/25 18:51:53 apw Exp $
| void AEM_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the common controller block of the AEM.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical address of the AEM | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with the load command |
References AEM_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void AEM_ENV_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned long long | payload | |||
| ) |
Create a LATp command targeted at the Environment block of the AEM.
| cmd | pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the AEM | |
| reg | The ID of the target register | |
| payload | 64 bits of data to send with the load command |
References AEM_ENV_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void AFE_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | arc, | |||
| unsigned | afe, | |||
| unsigned | reg, | |||
| unsigned short | payload | |||
| ) |
Create a LATp command targeted at an AFE.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of ACD_CMD_READ, ACD_CMD_LOAD, ACD_CMD_DATALESS | |
| addr | Logical LATp address of the AEM | |
| arc | The ID of the target ARC, or BCAST to broadcast to all the ARCs | |
| afe | The ID of the target AFE, or BCAST to broadcast to all the AFEs | |
| reg | The ID of the target register | |
| payload | 16 bits of data to send with a load command |
References AFE_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void ARC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | arc, | |||
| unsigned | reg, | |||
| unsigned short | payload | |||
| ) |
Create a LATp command targeted at an ARC.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of ACD_CMD_READ, ACD_CMD_LOAD, ACD_CMD_DATALESS | |
| addr | Logical LATp address of the AEM | |
| arc | The ID of the target ARC, or BCAST to broadcast to all the ARCs | |
| reg | The ID of the target register | |
| payload | 16 bits of data to send with a load command |
References ARC_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void CCC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | ccc, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at a CCC.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| ccc | The ID of the target CCC, or BCAST to broadcast to all CCCs | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References CCC_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void CFE_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | ccc, | |||
| unsigned | crc, | |||
| unsigned | cfe, | |||
| unsigned | reg, | |||
| unsigned short | payload | |||
| ) |
Create a LATp command targeted at a CFE.
| cmd | Pointer to the LEM_ci to packe | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| ccc | The ID of the target CCC, or BCAST to broadcast to all CCCs | |
| crc | The ID of the target CRC, or BCAST to broadcast to all CRCs | |
| cfe | The ID of the target CFE, or BCAST to broadcast to all CFEs | |
| reg | The ID of the target register | |
| payload | 16 bits to send with a load command |
References CFE_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void CRC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | ccc, | |||
| unsigned | crc, | |||
| unsigned | reg, | |||
| unsigned short | payload | |||
| ) |
Create a LATp command targeted at a CRC.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| ccc | The ID of the target CCC, or BCAST to broadcast to all CCCs | |
| crc | The ID of the target CRC, or BCAST to broadcast to all CRCs | |
| reg | The ID of the target register | |
| payload | 16 bits to send with a load command |
References CRC_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void CRU_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the CRU.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References CRU_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void EBM_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the common controller block of the EBM.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the EBM | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References EBM_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void EBM_STAT_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the statistics block of the EBM.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the EBM | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References EBM_STAT_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void GEM_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| LEM_REG_BLK | blk, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the GEM.
| cmd | Ptr to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the GEM | |
| blk | The ID of the register block (one of the GEM_BLK_X from LEM_REG_BLK) | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References GEM_ENCODE, getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| unsigned getWait | ( | LEM_FUNCTION | function, | |
| unsigned | addr0, | |||
| unsigned | addr1, | |||
| unsigned | addr2, | |||
| unsigned | addr3, | |||
| unsigned | regId | |||
| ) | [static] |
Get the stall/timeout for this register operation.
Note that the ARC and AFE dataless commands are identical to load commands, so use the load wait time rather than the dataless wait time.
| function | One of CMD_READ, CMD_LOAD or CMD_DATALESS | |
| addr0 | LATp node address | |
| addr1 | Second element in the register address (or -1) | |
| addr2 | Third element in the register address (or -1) | |
| addr3 | Fourth element in the register address (or -1) | |
| regId | Register ID |
| The | timeout/stall time to insert into the command item |
Referenced by AEM_encode(), AEM_ENV_encode(), AFE_encode(), ARC_encode(), CCC_encode(), CFE_encode(), CRC_encode(), CRU_encode(), EBM_encode(), EBM_STAT_encode(), GEM_encode(), PDU_encode(), PDU_ENV_encode(), TCC_encode(), TDC_encode(), TEM_encode(), TFE_encode(), TIC_encode(), and TRC_encode().
| void LAM_encode | ( | LEM_ci * | cmd, | |
| LEM_LATP_ADDR | addr | |||
| ) |
Create a look-at-me command.
| cmd | Ptr to the LEM_ci to pack | |
| addr | Logical LATp address of the target (usually the BCAST address) |
References LEM_ci::header, LAM_ENCODE, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| void LAM_LCB_encode | ( | LEM_ci * | cmd, | |
| LEM_LATP_ADDR | addr, | |||
| unsigned | value, | |||
| unsigned | enable_mask | |||
| ) |
Create a look-at-me command targetted at an LCB.
| cmd | Ptr to the LEM_ci to pack | |
| addr | Logical LATp address of the target (usually the BCAST address) | |
| value | Value to set the LATp CSR register to | |
| enable_mask | Enable mask for the register write |
References LEM_ci::header, LAM_LCB_ENCODE, LCB_HDR_ENCODE, LEM_ci::payload, and LEM_ci::stall.
| unsigned LEM_get_load_to | ( | void | ) |
Retained for backward compatibility.
| unsigned LEM_get_read_to | ( | void | ) |
Retained for backward compatibility.
| void LEM_set_load_to | ( | unsigned | timeout | ) |
Retained for backward compatibility.
| timeout | Ignored |
| void LEM_set_read_to | ( | unsigned | timeout | ) |
Retained for backward compatibility.
| timeout | Ignored |
| void PDU_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the common controller of the PDU.
| cmd | Ptr to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, PDU_ENCODE, and LEM_ci::stall.
| void PDU_ENV_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the environment block of the PDU.
| cmd | Ptr to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | One of LEM_LATP_ADDR | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, PDU_ENV_ENCODE, and LEM_ci::stall.
| void TCC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | tcc, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at a TCC.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical address of the TEM | |
| tcc | The ID of the target TCC, or BCAST to broadcast to all TCCs | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, LEM_ci::stall, and TCC_ENCODE.
| void TDC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | tcc, | |||
| unsigned | trc, | |||
| unsigned | tfe, | |||
| unsigned long long | payload | |||
| ) |
Create a LATp command targeted at the DAC register of a TFE.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| tcc | The ID of the target TCC, or BCAST to broadcast to all TCCs | |
| trc | The ID of the target TRC, or BCAST to broadcast to all TRCs | |
| tfe | The ID of the target TFE, or BCAST to broadcast to all TFEs | |
| payload | 64 bits of data to send with the load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, LEM_ci::stall, and TDC_ENCODE.
| void TEM_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the common controller block of a TEM.
| cmd | Ptr to LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, LEM_ci::stall, and TEM_ENCODE.
| void TFE_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | tcc, | |||
| unsigned | trc, | |||
| unsigned | tfe, | |||
| unsigned | reg, | |||
| unsigned long long | payload | |||
| ) |
Create a LATp command targeted at a TFE.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| tcc | The ID of the target TCC, or BCAST to broadcast to all TCCs | |
| trc | The ID of the target TRC, or BCAST to broadcast to all TRCs | |
| tfe | The ID of the target TFE, or BCAST to broadcast to all TFEs | |
| reg | The ID of the target register | |
| payload | 64 bits of data to send with the load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, LEM_ci::stall, and TFE_ENCODE.
| void TIC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | reg, | |||
| unsigned | payload | |||
| ) |
Create a LATp command targeted at the TIC block of a TEM.
| cmd | Ptr to LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| reg | The ID of the target register | |
| payload | 32 bits of data to send with a load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, LEM_ci::stall, and TIC_ENCODE.
| void TRC_encode | ( | LEM_ci * | cmd, | |
| LEM_FUNCTION | function, | |||
| LEM_LATP_ADDR | addr, | |||
| unsigned | tcc, | |||
| unsigned | trc, | |||
| unsigned | reg, | |||
| unsigned long long | payload | |||
| ) |
Create a LATp command targeted at a TRC.
| cmd | Pointer to the LEM_ci to pack | |
| function | One of CMD_READ, CMD_LOAD, CMD_DATALESS | |
| addr | Logical LATp address of the TEM | |
| tcc | The ID of the target TCC, or BCAST to broadcast to all TCCs | |
| trc | The ID of the target TRC, or BCAST to broadcast to all TRCs | |
| reg | The ID of the target register | |
| payload | 64 bits of data to send with a load command |
References getWait(), LEM_ci::header, LCB_HDR_ENCODE, LEM_ci::payload, LEM_ci::stall, and TRC_ENCODE.
1.5.8