\hypertarget{gGTFE_8c}{
\section{g\-GTFE.c File Reference}
\label{gGTFE_8c}\index{gGTFE.c@{gGTFE.c}}
}
Implements command/response for the GTFE.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}gt\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-TKR\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GTEM/g\-GTFE.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gGTFE_8c_a0}{g\-GTFEcmd} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short gtcc\-Addr, unsigned short gtrc\-Addr, unsigned short gtfe\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the destination. \item\end{CompactList}\item 
int \hyperlink{gGTFE_8c_a1}{g\-GTFEload} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short gtcc\-Addr, unsigned short gtrc\-Addr, unsigned short gtfe\-Addr, unsigned short reg, unsigned long long value)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gGTFE_8c_a2}{g\-GTFEread} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short gtcc\-Addr, unsigned short gtrc\-Addr, unsigned short gtfe\-Addr, unsigned short reg, unsigned long long $\ast$val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implements command/response for the GTFE. 

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


\subsection{Function Documentation}
\hypertarget{gGTFE_8c_a0}{
\index{gGTFE.c@{g\-GTFE.c}!gGTFEcmd@{gGTFEcmd}}
\index{gGTFEcmd@{gGTFEcmd}!gGTFE.c@{g\-GTFE.c}}
\subsubsection[gGTFEcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTFEcmd (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em gtcc\-Addr}, unsigned short {\em gtrc\-Addr}, unsigned short {\em gtfe\-Addr}, unsigned short {\em opcode})}}
\label{gGTFE_8c_a0}


Sends a dataless command to the destination. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address \item[{\em gtcc\-Addr}]GTCC address \item[{\em gtrc\-Addr}]GTRC address \item[{\em gtfe\-Addr}]GTFE address \item[{\em opcode}]opcode of command to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success \end{Desc}
\hypertarget{gGTFE_8c_a1}{
\index{gGTFE.c@{g\-GTFE.c}!gGTFEload@{gGTFEload}}
\index{gGTFEload@{gGTFEload}!gGTFE.c@{g\-GTFE.c}}
\subsubsection[gGTFEload]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTFEload (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em gtcc\-Addr}, unsigned short {\em gtrc\-Addr}, unsigned short {\em gtfe\-Addr}, unsigned short {\em reg}, unsigned long long {\em value})}}
\label{gGTFE_8c_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 \item[{\em gtcc\-Addr}]GTCC address \item[{\em gtrc\-Addr}]GTRC address \item[{\em gtfe\-Addr}]GTFE address \item[{\em reg}]register of GTFE to load \item[{\em value}]16-bit value to load into GTFE register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the GTFE register specified by {\em reg\/} with {\em value\/} \hypertarget{gGTFE_8c_a2}{
\index{gGTFE.c@{g\-GTFE.c}!gGTFEread@{gGTFEread}}
\index{gGTFEread@{gGTFEread}!gGTFE.c@{g\-GTFE.c}}
\subsubsection[gGTFEread]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTFEread (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em gtcc\-Addr}, unsigned short {\em gtrc\-Addr}, unsigned short {\em gtfe\-Addr}, unsigned short {\em reg}, unsigned long long $\ast$ {\em val})}}
\label{gGTFE_8c_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\-Addrination of command \item[{\em gtcc\-Addr}]GTCC address \item[{\em gtrc\-Addr}]GTRC address \item[{\em gtfe\-Addr}]GTFE address \item[{\em reg}]register of GTFE 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}
\begin{Desc}
\item[See also:]\_\-g\-GTFEread()\end{Desc}
Reads the GTFE 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}
