\hypertarget{gTEM_8h}{
\section{g\-TEM.h File Reference}
\label{gTEM_8h}\index{gTEM.h@{gTEM.h}}
}
Defines the command and response methods for the TEM.  


\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gTEM_8h_a0}{g\-TEMcmd} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the TEM address. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a1}{g\-TEMload} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short reg\-Id, unsigned int val)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a2}{g\-TEMread} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short reg\-Id, unsigned int $\ast$val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a3}{g\-TEMlam} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr)
\begin{CompactList}\small\item\em Sends the \char`\"{}Look At Me\char`\"{} message to the TEM. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a4}{set\-Cell\-Header\-Parity} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the LATp Cell\-Header Parity is inverted \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a5}{get\-Cell\-Header\-Parity} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns the current LATp cell header parity setting in {\em p\/}. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a6}{set\-Cell\-Body\-Parity} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the LATp Cell Body Parity is inverted \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a7}{get\-Cell\-Body\-Parity} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns the current LATp cell body parity setting in {\em p\/}. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a8}{set\-Cmd\-Str\-Parity\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the TEM command string parity is inverted \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a9}{get\-Cmd\-Str\-Parity\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns the current TEM command string parity. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a10}{set\-Access\-Desc\-Parity\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the TEM access descriptor parity is inverted \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a11}{get\-Access\-Desc\-Parity\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns the current TEM access descriptor parity. \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a12}{set\-Cmd\-Payload\-Parity\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the TEM command payload parity is inverted \item\end{CompactList}\item 
int \hyperlink{gTEM_8h_a13}{get\-Cmd\-Payload\-Parity\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns current TEM command payload parity. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Defines the command and response methods for the TEM. 

\begin{Desc}
\item[Author:]Curt Brune -- \href{mailto:curt@slac.stanford.edu}{\tt curt@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{gTEM_8h_a11}{
\index{gTEM.h@{g\-TEM.h}!getAccessDescParityTEM@{getAccessDescParityTEM}}
\index{getAccessDescParityTEM@{getAccessDescParityTEM}!gTEM.h@{g\-TEM.h}}
\subsubsection[getAccessDescParityTEM]{\setlength{\rightskip}{0pt plus 5cm}int get\-Access\-Desc\-Parity\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short $\ast$ {\em p})}}
\label{gTEM_8h_a11}


Returns the current TEM access descriptor parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going TEM commands will have their access descriptor parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a7}{
\index{gTEM.h@{g\-TEM.h}!getCellBodyParity@{getCellBodyParity}}
\index{getCellBodyParity@{getCellBodyParity}!gTEM.h@{g\-TEM.h}}
\subsubsection[getCellBodyParity]{\setlength{\rightskip}{0pt plus 5cm}int get\-Cell\-Body\-Parity (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short $\ast$ {\em p})}}
\label{gTEM_8h_a7}


Returns the current LATp cell body parity setting in {\em p\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
If {\em p\/} is non-zero then all out going LATp packets will have their cell body parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a5}{
\index{gTEM.h@{g\-TEM.h}!getCellHeaderParity@{getCellHeaderParity}}
\index{getCellHeaderParity@{getCellHeaderParity}!gTEM.h@{g\-TEM.h}}
\subsubsection[getCellHeaderParity]{\setlength{\rightskip}{0pt plus 5cm}int get\-Cell\-Header\-Parity (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short $\ast$ {\em p})}}
\label{gTEM_8h_a5}


Returns the current LATp cell header parity setting in {\em p\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
If {\em p\/} is non-zero then all out going LATp packets will have their cell header parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a13}{
\index{gTEM.h@{g\-TEM.h}!getCmdPayloadParityTEM@{getCmdPayloadParityTEM}}
\index{getCmdPayloadParityTEM@{getCmdPayloadParityTEM}!gTEM.h@{g\-TEM.h}}
\subsubsection[getCmdPayloadParityTEM]{\setlength{\rightskip}{0pt plus 5cm}int get\-Cmd\-Payload\-Parity\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short $\ast$ {\em p})}}
\label{gTEM_8h_a13}


Returns current TEM command payload parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going TEM commands will have their command payload parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a9}{
\index{gTEM.h@{g\-TEM.h}!getCmdStrParityTEM@{getCmdStrParityTEM}}
\index{getCmdStrParityTEM@{getCmdStrParityTEM}!gTEM.h@{g\-TEM.h}}
\subsubsection[getCmdStrParityTEM]{\setlength{\rightskip}{0pt plus 5cm}int get\-Cmd\-Str\-Parity\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short $\ast$ {\em p})}}
\label{gTEM_8h_a9}


Returns the current TEM command string parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going TEM commands will have their command string parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a0}{
\index{gTEM.h@{g\-TEM.h}!gTEMcmd@{gTEMcmd}}
\index{gTEMcmd@{gTEMcmd}!gTEM.h@{g\-TEM.h}}
\subsubsection[gTEMcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-TEMcmd (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em opcode})}}
\label{gTEM_8h_a0}


Sends a dataless command to the TEM address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address of command \item[{\em opcode}]opcode of command to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Sends the dataless command specified by {\em opcode\/} to the TEM address specified by {\em tem\-Addr\/}. \hypertarget{gTEM_8h_a3}{
\index{gTEM.h@{g\-TEM.h}!gTEMlam@{gTEMlam}}
\index{gTEMlam@{gTEMlam}!gTEM.h@{g\-TEM.h}}
\subsubsection[gTEMlam]{\setlength{\rightskip}{0pt plus 5cm}int g\-TEMlam (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr})}}
\label{gTEM_8h_a3}


Sends the \char`\"{}Look At Me\char`\"{} message to the TEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address of command \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Sends the \char`\"{}Look At Me\char`\"{} message to the TEM. This is used to switch the command/response wire used by the TEM. If the TEM decodes the \char`\"{}Look At Me\char`\"{} message on either it's A or B command channel it will switch to that channel for future commanding. \hypertarget{gTEM_8h_a1}{
\index{gTEM.h@{g\-TEM.h}!gTEMload@{gTEMload}}
\index{gTEMload@{gTEMload}!gTEM.h@{g\-TEM.h}}
\subsubsection[gTEMload]{\setlength{\rightskip}{0pt plus 5cm}int g\-TEMload (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gTEM_8h_a1}


Loads a register with value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address of command \item[{\em reg}]register of TEM to load \item[{\em value}]32-bit value to load into TEM register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the TEM register specified by {\em reg\/} with {\em value\/} \hypertarget{gTEM_8h_a2}{
\index{gTEM.h@{g\-TEM.h}!gTEMread@{gTEMread}}
\index{gTEMread@{gTEMread}!gTEM.h@{g\-TEM.h}}
\subsubsection[gTEMread]{\setlength{\rightskip}{0pt plus 5cm}int g\-TEMread (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em reg}, unsigned int $\ast$ {\em val})}}
\label{gTEM_8h_a2}


Reads a register returing value in {\em val\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address of command \item[{\em reg}]register of TEM to read \item[{\em val}]pointer to storage to hold the response of the read command \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Reads the TEM register specified by {\em reg\/}. {\em val\/} is filled on return. \hypertarget{gTEM_8h_a10}{
\index{gTEM.h@{g\-TEM.h}!setAccessDescParityTEM@{setAccessDescParityTEM}}
\index{setAccessDescParityTEM@{setAccessDescParityTEM}!gTEM.h@{g\-TEM.h}}
\subsubsection[setAccessDescParityTEM]{\setlength{\rightskip}{0pt plus 5cm}int set\-Access\-Desc\-Parity\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em p})}}
\label{gTEM_8h_a10}


{\em p\/} determines if the TEM access descriptor parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK\end{Desc}
if {\em p\/} is non-zero then all out going TEM commands will have their access descriptor parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a6}{
\index{gTEM.h@{g\-TEM.h}!setCellBodyParity@{setCellBodyParity}}
\index{setCellBodyParity@{setCellBodyParity}!gTEM.h@{g\-TEM.h}}
\subsubsection[setCellBodyParity]{\setlength{\rightskip}{0pt plus 5cm}int set\-Cell\-Body\-Parity (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em p})}}
\label{gTEM_8h_a6}


{\em p\/} determines if the LATp Cell Body Parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
If {\em p\/} is non-zero then all out going LATp packets will have their cell body parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a4}{
\index{gTEM.h@{g\-TEM.h}!setCellHeaderParity@{setCellHeaderParity}}
\index{setCellHeaderParity@{setCellHeaderParity}!gTEM.h@{g\-TEM.h}}
\subsubsection[setCellHeaderParity]{\setlength{\rightskip}{0pt plus 5cm}int set\-Cell\-Header\-Parity (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em p})}}
\label{gTEM_8h_a4}


{\em p\/} determines if the LATp Cell\-Header Parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
If {\em p\/} is non-zero then all out going LATp packets will have their cell header parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a12}{
\index{gTEM.h@{g\-TEM.h}!setCmdPayloadParityTEM@{setCmdPayloadParityTEM}}
\index{setCmdPayloadParityTEM@{setCmdPayloadParityTEM}!gTEM.h@{g\-TEM.h}}
\subsubsection[setCmdPayloadParityTEM]{\setlength{\rightskip}{0pt plus 5cm}int set\-Cmd\-Payload\-Parity\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em p})}}
\label{gTEM_8h_a12}


{\em p\/} determines if the TEM command payload parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK\end{Desc}
if {\em p\/} is non-zero then all out going TEM commands will have their command payload parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gTEM_8h_a8}{
\index{gTEM.h@{g\-TEM.h}!setCmdStrParityTEM@{setCmdStrParityTEM}}
\index{setCmdStrParityTEM@{setCmdStrParityTEM}!gTEM.h@{g\-TEM.h}}
\subsubsection[setCmdStrParityTEM]{\setlength{\rightskip}{0pt plus 5cm}int set\-Cmd\-Str\-Parity\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em p})}}
\label{gTEM_8h_a8}


{\em p\/} determines if the TEM command string parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK\end{Desc}
if {\em p\/} is non-zero then all out going TEM commands will have their command string parity inverted. This is used for testing parity errors. The default value is 0. 