\hypertarget{gTEM_8c}{
\section{g\-TEM.c File Reference}
\label{gTEM_8c}\index{gTEM.c@{gTEM.c}}
}
Implements command/response for the TEM.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}gt\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-TEM\_\-p.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{gTEM_8c_a0}{set\-Cmd\-Header\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, \hyperlink{union__cmdHeaderLATp}{cmd\-Header\-LATp} $\ast$ch, unsigned short type)
\begin{CompactList}\small\item\em initializes a command header structure for a TEM \item\end{CompactList}\item 
void \hyperlink{gTEM_8c_a1}{set\-Local\-AD} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short func, unsigned short reg, \hyperlink{union__localLATpAD}{local\-LATp\-AD} $\ast$ad)
\begin{CompactList}\small\item\em initializes a local access descriptor structure for a TEM \item\end{CompactList}\item 
void \hyperlink{gTEM_8c_a2}{pack\-Payload\-TEM} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned int cmd\-Header, unsigned int local\-AD, unsigned int value, unsigned int $\ast$payload)
\begin{CompactList}\small\item\em Packs the cmd\-Header, local\-LATp\-AD and value into the 64-bit payload. \item\end{CompactList}\item 
int \hyperlink{gTEM_8c_a3}{\_\-\_\-tem\-Cmd\-Load} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short type, unsigned short func, unsigned short reg, unsigned int value)
\begin{CompactList}\small\item\em Generic routine for sending response-less commands. \item\end{CompactList}\item 
int \hyperlink{gTEM_8c_a4}{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_8c_a5}{g\-TEMload} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short reg, unsigned int value)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gTEM_8c_a6}{\_\-\_\-tem\-Cmd\-Read\-N} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short type, unsigned short reg, unsigned short n\-Items, unsigned int $\ast$val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\item 
int \hyperlink{gTEM_8c_a7}{\_\-\_\-tem\-Cmd\-Read} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short type, unsigned short reg, unsigned int $\ast$val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\item 
int \hyperlink{gTEM_8c_a8}{g\-TEMread} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short reg, unsigned int $\ast$val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\item 
int \hyperlink{gTEM_8c_a9}{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_8c_a10}{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_8c_a11}{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_8c_a12}{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_8c_a13}{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_8c_a14}{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_8c_a15}{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_8c_a16}{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_8c_a17}{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_8c_a18}{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_8c_a19}{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}
Implements command/response 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_8c_a3}{
\index{gTEM.c@{g\-TEM.c}!__temCmdLoad@{\_\-\_\-temCmdLoad}}
\index{__temCmdLoad@{\_\-\_\-temCmdLoad}!gTEM.c@{g\-TEM.c}}
\subsubsection[\_\-\_\-temCmdLoad]{\setlength{\rightskip}{0pt plus 5cm}int \_\-\_\-tem\-Cmd\-Load (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em type}, unsigned short {\em func}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gTEM_8c_a3}


Generic routine for sending response-less commands. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address of command \item[{\em type}]type of on board TEM object ( GTEM or GTIC ) \item[{\em func}]command/response function code \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}
Common subroutine for sending dataless commands and loading TEM on board registers (GTEM and GTIC) registers. The {\em func\/} parameter indicates a \char`\"{}dataless\char`\"{} or \char`\"{}load\char`\"{} command.

For dataless commands {\em reg\/} is interpreted as the \char`\"{}opcode\char`\"{} of the dataless command and {\em value\/} is ignored.

For load commands {\em reg\/} is the TEM register to load with {\em value\/}. \hypertarget{gTEM_8c_a7}{
\index{gTEM.c@{g\-TEM.c}!__temCmdRead@{\_\-\_\-temCmdRead}}
\index{__temCmdRead@{\_\-\_\-temCmdRead}!gTEM.c@{g\-TEM.c}}
\subsubsection[\_\-\_\-temCmdRead]{\setlength{\rightskip}{0pt plus 5cm}int \_\-\_\-tem\-Cmd\-Read (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em type}, unsigned short {\em reg}, unsigned int $\ast$ {\em val})}}
\label{gTEM_8c_a7}


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 type}]type of on board TEM object ( GTEM or GTIC ) \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 a 32-bit value from the TEM/GTIC register specified by {\em reg\/}. {\em val\/} is filled on return.

The following error codes are returned when LATp errors occur:

\begin{itemize}
\item GERR\_\-LATP\_\-HEADER\_\-PARITY \item GERR\_\-LATP\_\-CELL\_\-PARITY \item GERR\_\-LATP\_\-TRUNCATE \end{itemize}
\hypertarget{gTEM_8c_a6}{
\index{gTEM.c@{g\-TEM.c}!__temCmdReadN@{\_\-\_\-temCmdReadN}}
\index{__temCmdReadN@{\_\-\_\-temCmdReadN}!gTEM.c@{g\-TEM.c}}
\subsubsection[\_\-\_\-temCmdReadN]{\setlength{\rightskip}{0pt plus 5cm}int \_\-\_\-tem\-Cmd\-Read\-N (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em type}, unsigned short {\em reg}, unsigned short {\em n\-Items}, unsigned int $\ast$ {\em val})}}
\label{gTEM_8c_a6}


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 type}]type of on board TEM object ( GTEM or GTIC ) \item[{\em reg}]register of TEM to read \item[{\em n\-Items}]number of 32-bit values to read from response \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 {\em n\-Items\/} 32-bit values from the TEM/GTIC register specified by {\em reg\/}. {\em val\/} is filled on return.

For most cases {\em n\-Items\/} is 1, indicating a simple 32-bit register read. For the GTIC ADCS register, however, {\em n\-Items\/} will be 3 for reading 3 32-bit words from the register. At the most {\em n\-Items\/} can be 4, if n\-Items is greater than 4 return GERR\_\-BAD\_\-PARAM.

The following error codes are returned when LATp errors occur:

\begin{itemize}
\item GERR\_\-LATP\_\-HEADER\_\-PARITY \item GERR\_\-LATP\_\-CELL\_\-PARITY \item GERR\_\-LATP\_\-TRUNCATE \end{itemize}
\hypertarget{gTEM_8c_a17}{
\index{gTEM.c@{g\-TEM.c}!getAccessDescParityTEM@{getAccessDescParityTEM}}
\index{getAccessDescParityTEM@{getAccessDescParityTEM}!gTEM.c@{g\-TEM.c}}
\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_8c_a17}


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_8c_a13}{
\index{gTEM.c@{g\-TEM.c}!getCellBodyParity@{getCellBodyParity}}
\index{getCellBodyParity@{getCellBodyParity}!gTEM.c@{g\-TEM.c}}
\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_8c_a13}


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_8c_a11}{
\index{gTEM.c@{g\-TEM.c}!getCellHeaderParity@{getCellHeaderParity}}
\index{getCellHeaderParity@{getCellHeaderParity}!gTEM.c@{g\-TEM.c}}
\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_8c_a11}


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_8c_a19}{
\index{gTEM.c@{g\-TEM.c}!getCmdPayloadParityTEM@{getCmdPayloadParityTEM}}
\index{getCmdPayloadParityTEM@{getCmdPayloadParityTEM}!gTEM.c@{g\-TEM.c}}
\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_8c_a19}


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_8c_a15}{
\index{gTEM.c@{g\-TEM.c}!getCmdStrParityTEM@{getCmdStrParityTEM}}
\index{getCmdStrParityTEM@{getCmdStrParityTEM}!gTEM.c@{g\-TEM.c}}
\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_8c_a15}


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_8c_a4}{
\index{gTEM.c@{g\-TEM.c}!gTEMcmd@{gTEMcmd}}
\index{gTEMcmd@{gTEMcmd}!gTEM.c@{g\-TEM.c}}
\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_8c_a4}


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_8c_a9}{
\index{gTEM.c@{g\-TEM.c}!gTEMlam@{gTEMlam}}
\index{gTEMlam@{gTEMlam}!gTEM.c@{g\-TEM.c}}
\subsubsection[gTEMlam]{\setlength{\rightskip}{0pt plus 5cm}int g\-TEMlam (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr})}}
\label{gTEM_8c_a9}


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_8c_a5}{
\index{gTEM.c@{g\-TEM.c}!gTEMload@{gTEMload}}
\index{gTEMload@{gTEMload}!gTEM.c@{g\-TEM.c}}
\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_8c_a5}


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_8c_a8}{
\index{gTEM.c@{g\-TEM.c}!gTEMread@{gTEMread}}
\index{gTEMread@{gTEMread}!gTEM.c@{g\-TEM.c}}
\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_8c_a8}


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_8c_a2}{
\index{gTEM.c@{g\-TEM.c}!packPayloadTEM@{packPayloadTEM}}
\index{packPayloadTEM@{packPayloadTEM}!gTEM.c@{g\-TEM.c}}
\subsubsection[packPayloadTEM]{\setlength{\rightskip}{0pt plus 5cm}void pack\-Payload\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned int {\em cmd\-Header}, unsigned int {\em local\-AD}, unsigned int {\em value}, unsigned int $\ast$ {\em payload})}}
\label{gTEM_8c_a2}


Packs the cmd\-Header, local\-LATp\-AD and value into the 64-bit payload. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em cmd\-Header}]32-bit command header word \item[{\em local\-AD}]32-bit local access descriptor word \item[{\em value}]32-bit value to load into TEM register \item[{\em payload}]pointer to 64-bits of pre-allocated storage \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void\end{Desc}
Packs the bits of {\em cmd\-Header\/}, {\em local\-AD\/} and {\em value\/} into the 64-bits pointed to by {\em payload\/}. The packing is specific to local \char`\"{}on board\char`\"{} registers for the TEM Common Controller and GCCC. \hypertarget{gTEM_8c_a16}{
\index{gTEM.c@{g\-TEM.c}!setAccessDescParityTEM@{setAccessDescParityTEM}}
\index{setAccessDescParityTEM@{setAccessDescParityTEM}!gTEM.c@{g\-TEM.c}}
\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_8c_a16}


{\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_8c_a12}{
\index{gTEM.c@{g\-TEM.c}!setCellBodyParity@{setCellBodyParity}}
\index{setCellBodyParity@{setCellBodyParity}!gTEM.c@{g\-TEM.c}}
\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_8c_a12}


{\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_8c_a10}{
\index{gTEM.c@{g\-TEM.c}!setCellHeaderParity@{setCellHeaderParity}}
\index{setCellHeaderParity@{setCellHeaderParity}!gTEM.c@{g\-TEM.c}}
\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_8c_a10}


{\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_8c_a0}{
\index{gTEM.c@{g\-TEM.c}!setCmdHeaderTEM@{setCmdHeaderTEM}}
\index{setCmdHeaderTEM@{setCmdHeaderTEM}!gTEM.c@{g\-TEM.c}}
\subsubsection[setCmdHeaderTEM]{\setlength{\rightskip}{0pt plus 5cm}void set\-Cmd\-Header\-TEM (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, \hyperlink{union__cmdHeaderLATp}{cmd\-Header\-LATp} $\ast$ {\em ch}, unsigned short {\em type})}}
\label{gTEM_8c_a0}


initializes a command header structure for a TEM 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em ch}]pointer to command header structure \item[{\em type}]type of on board TEM object \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on void \end{Desc}
\hypertarget{gTEM_8c_a18}{
\index{gTEM.c@{g\-TEM.c}!setCmdPayloadParityTEM@{setCmdPayloadParityTEM}}
\index{setCmdPayloadParityTEM@{setCmdPayloadParityTEM}!gTEM.c@{g\-TEM.c}}
\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_8c_a18}


{\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_8c_a14}{
\index{gTEM.c@{g\-TEM.c}!setCmdStrParityTEM@{setCmdStrParityTEM}}
\index{setCmdStrParityTEM@{setCmdStrParityTEM}!gTEM.c@{g\-TEM.c}}
\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_8c_a14}


{\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. \hypertarget{gTEM_8c_a1}{
\index{gTEM.c@{g\-TEM.c}!setLocalAD@{setLocalAD}}
\index{setLocalAD@{setLocalAD}!gTEM.c@{g\-TEM.c}}
\subsubsection[setLocalAD]{\setlength{\rightskip}{0pt plus 5cm}void set\-Local\-AD (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em func}, unsigned short {\em reg}, \hyperlink{union__localLATpAD}{local\-LATp\-AD} $\ast$ {\em ad})}}
\label{gTEM_8c_a1}


initializes a local access descriptor structure for a TEM 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em func}]TEM fucntion code \item[{\em reg}]register of TEM \item[{\em ad}]pointer to local access descriptor structure \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}
