\hypertarget{encode_8h}{
\section{encode.h File Reference}
\label{encode_8h}\index{encode.h@{encode.h}}
}
Fill the payload of a command item with a LATp command. 

{\tt \#include \char`\"{}LEM/encode\_\-structs.h\char`\"{}}\par
{\tt \#include \char`\"{}LEM/defs.h\char`\"{}}\par


Include dependency graph for encode.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=196pt]{encode_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=95pt]{encode_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{encode_8h_a0}{LEM\_\-set\_\-load\_\-to} (unsigned timeout)
\begin{CompactList}\small\item\em Retained for backward compatibility. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a1}{LEM\_\-set\_\-read\_\-to} (unsigned timeout)
\begin{CompactList}\small\item\em Retained for backward compatibility. \item\end{CompactList}\item 
unsigned \hyperlink{encode_8h_a2}{LEM\_\-get\_\-load\_\-to} (void)
\begin{CompactList}\small\item\em Retained for backward compatibility. \item\end{CompactList}\item 
unsigned \hyperlink{encode_8h_a3}{LEM\_\-get\_\-read\_\-to} (void)
\begin{CompactList}\small\item\em Retained for backward compatibility. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a4}{TEM\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the common controller block of a TEM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a5}{TIC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the TIC block of a TEM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a6}{CCC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned ccc, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at a CCC. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a7}{CRC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned ccc, unsigned crc, unsigned reg, unsigned short payload)
\begin{CompactList}\small\item\em Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at a CRC. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a8}{CFE\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned ccc, unsigned crc, unsigned cfe, unsigned reg, unsigned short payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at a CFE. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a9}{TCC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned tcc, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at a TCC. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a10}{TRC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned tcc, unsigned trc, unsigned reg, unsigned long long payload)
\begin{CompactList}\small\item\em Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at a TRC. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a11}{TFE\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned tcc, unsigned trc, unsigned tfe, unsigned reg, unsigned long long payload)
\begin{CompactList}\small\item\em Create a LATp Command targeted at a TFE. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a12}{TDC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned tcc, unsigned trc, unsigned tfe, unsigned long long payload)
\begin{CompactList}\small\item\em Create a LATp Command targeted at the DAC register of a TFE. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a13}{AEM\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at the common controller block of the AEM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a14}{AEM\_\-ENV\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned long long payload)
\begin{CompactList}\small\item\em Create a LATp Command targeted at the Environment block of the AEM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a15}{ARC\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned arc, unsigned reg, unsigned short payload)
\begin{CompactList}\small\item\em Create a LATp Command targeted at an ARC. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a16}{AFE\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned arc, unsigned afe, unsigned reg, unsigned short payload)
\begin{CompactList}\small\item\em Create a LATp Command targeted at an AFE. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a17}{PDU\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp Command targeted at the common controller of the PDU. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a18}{PDU\_\-ENV\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the environment block of the PDU. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a19}{CRU\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the CRU. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a20}{EBM\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the common controller block of the EBM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a21}{EBM\_\-STAT\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the statistics block of the EBM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a22}{GEM\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} function, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, \hyperlink{defs_8h_a422}{LEM\_\-REG\_\-BLK} blk, unsigned reg, unsigned payload)
\begin{CompactList}\small\item\em Create a LATp command targeted at the GEM. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a23}{LAM\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr)
\begin{CompactList}\small\item\em Create a look-at-me command. \item\end{CompactList}\item 
void \hyperlink{encode_8h_a24}{LAM\_\-LCB\_\-encode} (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$cmd, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} addr, unsigned value, unsigned enable\_\-mask)
\begin{CompactList}\small\item\em Create a look-at-me command targetted at an LCB. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Fill the payload of a command item with a LATp command. 

\begin{Desc}
\item[Author:]James Swain - \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{encode_8h_a13}{
\index{encode.h@{encode.h}!AEM_encode@{AEM\_\-encode}}
\index{AEM_encode@{AEM\_\-encode}!encode.h@{encode.h}}
\subsubsection[AEM\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void AEM\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a13}


Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at the common controller block of the AEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical address of the AEM \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with the load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a14}{
\index{encode.h@{encode.h}!AEM_ENV_encode@{AEM\_\-ENV\_\-encode}}
\index{AEM_ENV_encode@{AEM\_\-ENV\_\-encode}!encode.h@{encode.h}}
\subsubsection[AEM\_\-ENV\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void AEM\_\-ENV\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned long long {\em payload})}}
\label{encode_8h_a14}


Create a LATp Command targeted at the Environment block of the AEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the AEM \item[{\em reg}]should be the ID of the target register \item[{\em payload}]64 bits of data to send with the load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a16}{
\index{encode.h@{encode.h}!AFE_encode@{AFE\_\-encode}}
\index{AFE_encode@{AFE\_\-encode}!encode.h@{encode.h}}
\subsubsection[AFE\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void AFE\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em arc}, unsigned {\em afe}, unsigned {\em reg}, unsigned short {\em payload})}}
\label{encode_8h_a16}


Create a LATp Command targeted at an AFE. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of ACD\_\-CMD\_\-READ, ACD\_\-CMD\_\-LOAD, ACD\_\-CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the AEM \item[{\em arc}]should be the ID of the target ARC, or BCAST to broadcast to all the ARCs \item[{\em afe}]should be the ID of the target AFE, or BCAST to broadcast to all the AFEs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]16 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a15}{
\index{encode.h@{encode.h}!ARC_encode@{ARC\_\-encode}}
\index{ARC_encode@{ARC\_\-encode}!encode.h@{encode.h}}
\subsubsection[ARC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void ARC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em arc}, unsigned {\em reg}, unsigned short {\em payload})}}
\label{encode_8h_a15}


Create a LATp Command targeted at an ARC. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of ACD\_\-CMD\_\-READ, ACD\_\-CMD\_\-LOAD, ACD\_\-CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the AEM \item[{\em arc}]should be the ID of the target ARC, or BCAST to broadcast to all the ARCs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]16 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a6}{
\index{encode.h@{encode.h}!CCC_encode@{CCC\_\-encode}}
\index{CCC_encode@{CCC\_\-encode}!encode.h@{encode.h}}
\subsubsection[CCC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void CCC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em ccc}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a6}


Create a LATp command targeted at a CCC. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em ccc}]should be the ID of the target CCC, or BCAST to broadcast to all CCCs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a8}{
\index{encode.h@{encode.h}!CFE_encode@{CFE\_\-encode}}
\index{CFE_encode@{CFE\_\-encode}!encode.h@{encode.h}}
\subsubsection[CFE\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void CFE\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em ccc}, unsigned {\em crc}, unsigned {\em cfe}, unsigned {\em reg}, unsigned short {\em payload})}}
\label{encode_8h_a8}


Create a LATp command targeted at a CFE. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to packe \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em ccc}]should be the ID of the target CCC, or BCAST to broadcast to all CCCs \item[{\em crc}]should be the ID of the target CRC, or BCAST to broadcast to all CRCs \item[{\em cfe}]should be the ID of the target CFE, or BCAST to broadcast to all CFEs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]16 bits to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a7}{
\index{encode.h@{encode.h}!CRC_encode@{CRC\_\-encode}}
\index{CRC_encode@{CRC\_\-encode}!encode.h@{encode.h}}
\subsubsection[CRC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void CRC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em ccc}, unsigned {\em crc}, unsigned {\em reg}, unsigned short {\em payload})}}
\label{encode_8h_a7}


Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at a CRC. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em ccc}]should be the ID of the target CCC, or BCAST to broadcast to all CCCs \item[{\em crc}]should be the ID of the target CRC, or BCAST to broadcast to all CRCs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]16 bits to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a19}{
\index{encode.h@{encode.h}!CRU_encode@{CRU\_\-encode}}
\index{CRU_encode@{CRU\_\-encode}!encode.h@{encode.h}}
\subsubsection[CRU\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void CRU\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a19}


Create a LATp command targeted at the CRU. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a20}{
\index{encode.h@{encode.h}!EBM_encode@{EBM\_\-encode}}
\index{EBM_encode@{EBM\_\-encode}!encode.h@{encode.h}}
\subsubsection[EBM\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void EBM\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a20}


Create a LATp command targeted at the common controller block of the EBM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the EBM \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a21}{
\index{encode.h@{encode.h}!EBM_STAT_encode@{EBM\_\-STAT\_\-encode}}
\index{EBM_STAT_encode@{EBM\_\-STAT\_\-encode}!encode.h@{encode.h}}
\subsubsection[EBM\_\-STAT\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void EBM\_\-STAT\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a21}


Create a LATp command targeted at the statistics block of the EBM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the EBM \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a22}{
\index{encode.h@{encode.h}!GEM_encode@{GEM\_\-encode}}
\index{GEM_encode@{GEM\_\-encode}!encode.h@{encode.h}}
\subsubsection[GEM\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void GEM\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, \hyperlink{defs_8h_a422}{LEM\_\-REG\_\-BLK} {\em blk}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a22}


Create a LATp command targeted at the GEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the GEM \item[{\em blk}]should be the ID of the register block (one of the GEM\_\-BLK\_\-X from LEM\_\-REG\_\-BLK) \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a23}{
\index{encode.h@{encode.h}!LAM_encode@{LAM\_\-encode}}
\index{LAM_encode@{LAM\_\-encode}!encode.h@{encode.h}}
\subsubsection[LAM\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void LAM\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr})}}
\label{encode_8h_a23}


Create a look-at-me command. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em addr}]Logical LATp address of the target (usually the BCAST address)\end{description}
\end{Desc}
\hypertarget{encode_8h_a24}{
\index{encode.h@{encode.h}!LAM_LCB_encode@{LAM\_\-LCB\_\-encode}}
\index{LAM_LCB_encode@{LAM\_\-LCB\_\-encode}!encode.h@{encode.h}}
\subsubsection[LAM\_\-LCB\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void LAM\_\-LCB\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em value}, unsigned {\em enable\_\-mask})}}
\label{encode_8h_a24}


Create a look-at-me command targetted at an LCB. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em addr}]Logical LATp address of the target (usually the BCAST address) \item[{\em value}]Value to set the LATp CSR register to \item[{\em enable\_\-mask}]Enable mask for the register write\end{description}
\end{Desc}
\hypertarget{encode_8h_a2}{
\index{encode.h@{encode.h}!LEM_get_load_to@{LEM\_\-get\_\-load\_\-to}}
\index{LEM_get_load_to@{LEM\_\-get\_\-load\_\-to}!encode.h@{encode.h}}
\subsubsection[LEM\_\-get\_\-load\_\-to]{\setlength{\rightskip}{0pt plus 5cm}unsigned LEM\_\-get\_\-load\_\-to (void)}}
\label{encode_8h_a2}


Retained for backward compatibility. 

\begin{Desc}
\item[Returns:]0 \end{Desc}
\begin{Desc}
\item[Warning:]Function reports the error LCI\_\-NOIMPL and returns 0\end{Desc}
\hypertarget{encode_8h_a3}{
\index{encode.h@{encode.h}!LEM_get_read_to@{LEM\_\-get\_\-read\_\-to}}
\index{LEM_get_read_to@{LEM\_\-get\_\-read\_\-to}!encode.h@{encode.h}}
\subsubsection[LEM\_\-get\_\-read\_\-to]{\setlength{\rightskip}{0pt plus 5cm}unsigned LEM\_\-get\_\-read\_\-to (void)}}
\label{encode_8h_a3}


Retained for backward compatibility. 

\begin{Desc}
\item[Returns:]0 \end{Desc}
\begin{Desc}
\item[Warning:]Function reports the error LCI\_\-NOIMPL and returns 0\end{Desc}
\hypertarget{encode_8h_a0}{
\index{encode.h@{encode.h}!LEM_set_load_to@{LEM\_\-set\_\-load\_\-to}}
\index{LEM_set_load_to@{LEM\_\-set\_\-load\_\-to}!encode.h@{encode.h}}
\subsubsection[LEM\_\-set\_\-load\_\-to]{\setlength{\rightskip}{0pt plus 5cm}void LEM\_\-set\_\-load\_\-to (unsigned {\em timeout})}}
\label{encode_8h_a0}


Retained for backward compatibility. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timeout}]Ignored \end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]Function just reports the error LCI\_\-NOIMPL\end{Desc}
\hypertarget{encode_8h_a1}{
\index{encode.h@{encode.h}!LEM_set_read_to@{LEM\_\-set\_\-read\_\-to}}
\index{LEM_set_read_to@{LEM\_\-set\_\-read\_\-to}!encode.h@{encode.h}}
\subsubsection[LEM\_\-set\_\-read\_\-to]{\setlength{\rightskip}{0pt plus 5cm}void LEM\_\-set\_\-read\_\-to (unsigned {\em timeout})}}
\label{encode_8h_a1}


Retained for backward compatibility. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timeout}]Ignored \end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]Function just reports the error LCI\_\-NOIMPL\end{Desc}
\hypertarget{encode_8h_a17}{
\index{encode.h@{encode.h}!PDU_encode@{PDU\_\-encode}}
\index{PDU_encode@{PDU\_\-encode}!encode.h@{encode.h}}
\subsubsection[PDU\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void PDU\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a17}


Create a LATp Command targeted at the common controller of the PDU. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a18}{
\index{encode.h@{encode.h}!PDU_ENV_encode@{PDU\_\-ENV\_\-encode}}
\index{PDU_ENV_encode@{PDU\_\-ENV\_\-encode}!encode.h@{encode.h}}
\subsubsection[PDU\_\-ENV\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void PDU\_\-ENV\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a18}


Create a LATp command targeted at the environment block of the PDU. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]should be one of LEM\_\-LATP\_\-ADDR \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a9}{
\index{encode.h@{encode.h}!TCC_encode@{TCC\_\-encode}}
\index{TCC_encode@{TCC\_\-encode}!encode.h@{encode.h}}
\subsubsection[TCC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void TCC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em tcc}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a9}


Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at a TCC. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical address of the TEM \item[{\em tcc}]should be the ID of the target TCC, or BCAST to broadcast to all TCCs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a12}{
\index{encode.h@{encode.h}!TDC_encode@{TDC\_\-encode}}
\index{TDC_encode@{TDC\_\-encode}!encode.h@{encode.h}}
\subsubsection[TDC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void TDC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em tcc}, unsigned {\em trc}, unsigned {\em tfe}, unsigned long long {\em payload})}}
\label{encode_8h_a12}


Create a LATp Command targeted at the DAC register of a TFE. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em tcc}]should be the ID of the target TCC, or BCAST to broadcast to all TCCs \item[{\em trc}]should be the ID of the target TRC, or BCAST to broadcast to all TRCs \item[{\em tfe}]should be the ID of the target TFE, or BCAST to broadcast to all TFEs \item[{\em payload}]64 bits of data to send with the load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a4}{
\index{encode.h@{encode.h}!TEM_encode@{TEM\_\-encode}}
\index{TEM_encode@{TEM\_\-encode}!encode.h@{encode.h}}
\subsubsection[TEM\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void TEM\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a4}


Create a LATp command targeted at the common controller block of a TEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a11}{
\index{encode.h@{encode.h}!TFE_encode@{TFE\_\-encode}}
\index{TFE_encode@{TFE\_\-encode}!encode.h@{encode.h}}
\subsubsection[TFE\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void TFE\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em tcc}, unsigned {\em trc}, unsigned {\em tfe}, unsigned {\em reg}, unsigned long long {\em payload})}}
\label{encode_8h_a11}


Create a LATp Command targeted at a TFE. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em tcc}]should be the ID of the target TCC, or BCAST to broadcast to all TCCs \item[{\em trc}]should be the ID of the target TRC, or BCAST to broadcast to all TRCs \item[{\em tfe}]should be the ID of the target TFE, or BCAST to broadcast to all TFEs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]64 bits of data to send with the load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a5}{
\index{encode.h@{encode.h}!TIC_encode@{TIC\_\-encode}}
\index{TIC_encode@{TIC\_\-encode}!encode.h@{encode.h}}
\subsubsection[TIC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void TIC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em reg}, unsigned {\em payload})}}
\label{encode_8h_a5}


Create a LATp command targeted at the TIC block of a TEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Ptr to \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em reg}]should be the ID of the target register \item[{\em payload}]32 bits of data to send with a load command\end{description}
\end{Desc}
\hypertarget{encode_8h_a10}{
\index{encode.h@{encode.h}!TRC_encode@{TRC\_\-encode}}
\index{TRC_encode@{TRC\_\-encode}!encode.h@{encode.h}}
\subsubsection[TRC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}void TRC\_\-encode (\hyperlink{structLEM__ci}{LEM\_\-ci} $\ast$ {\em cmd}, \hyperlink{defs_8h_a419}{LEM\_\-FUNCTION} {\em function}, \hyperlink{defs_8h_a429}{LEM\_\-LATP\_\-ADDR} {\em addr}, unsigned {\em tcc}, unsigned {\em trc}, unsigned {\em reg}, unsigned long long {\em payload})}}
\label{encode_8h_a10}


Create a \hyperlink{structLEM__ci}{LEM\_\-ci} targeted at a TRC. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]Pointer to the \hyperlink{structLEM__ci}{LEM\_\-ci} to pack \item[{\em function}]should be one of CMD\_\-READ, CMD\_\-LOAD, CMD\_\-DATALESS \item[{\em addr}]Logical LATp address of the TEM \item[{\em tcc}]should be the ID of the target TCC, or BCAST to broadcast to all TCCs \item[{\em trc}]should be the ID of the target TRC, or BCAST to broadcast to all TRCs \item[{\em reg}]should be the ID of the target register \item[{\em payload}]64 bits of data to send with a load command\end{description}
\end{Desc}
