\hypertarget{gGCFE_8c}{
\section{g\-GCFE.c File Reference}
\label{gGCFE_8c}\index{gGCFE.c@{gGCFE.c}}
}
Implements command/response for the GCFE.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}gt\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-CAL\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GTEM/g\-GCFE.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gGCFE_8c_a0}{g\-GCFEcmd} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short gccc\-Addr, unsigned short gcrc\-Addr, unsigned short gcfe\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the destination. \item\end{CompactList}\item 
int \hyperlink{gGCFE_8c_a1}{g\-GCFEload} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short gccc\-Addr, unsigned short gcrc\-Addr, unsigned short gcfe\-Addr, unsigned short reg, unsigned short value)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gGCFE_8c_a2}{g\-GCFEread} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short gccc\-Addr, unsigned short gcrc\-Addr, unsigned short gcfe\-Addr, unsigned short reg, unsigned short $\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 GCFE. 

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


\subsection{Function Documentation}
\hypertarget{gGCFE_8c_a0}{
\index{gGCFE.c@{g\-GCFE.c}!gGCFEcmd@{gGCFEcmd}}
\index{gGCFEcmd@{gGCFEcmd}!gGCFE.c@{g\-GCFE.c}}
\subsubsection[gGCFEcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-GCFEcmd (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em gccc\-Addr}, unsigned short {\em gcrc\-Addr}, unsigned short {\em gcfe\-Addr}, unsigned short {\em opcode})}}
\label{gGCFE_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 gccc\-Addr}]GCCC address \item[{\em gcrc\-Addr}]GCRC address \item[{\em gcfe\-Addr}]GCFE address \item[{\em opcode}]opcode of command to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success \end{Desc}
\hypertarget{gGCFE_8c_a1}{
\index{gGCFE.c@{g\-GCFE.c}!gGCFEload@{gGCFEload}}
\index{gGCFEload@{gGCFEload}!gGCFE.c@{g\-GCFE.c}}
\subsubsection[gGCFEload]{\setlength{\rightskip}{0pt plus 5cm}int g\-GCFEload (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em gccc\-Addr}, unsigned short {\em gcrc\-Addr}, unsigned short {\em gcfe\-Addr}, unsigned short {\em reg}, unsigned short {\em value})}}
\label{gGCFE_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 gccc\-Addr}]GCCC address \item[{\em gcrc\-Addr}]GCRC address \item[{\em gcfe\-Addr}]GCFE address \item[{\em reg}]register of GCFE to load \item[{\em value}]16-bit value to load into GCFE register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the GCFE register specified by {\em reg\/} with {\em value\/} \hypertarget{gGCFE_8c_a2}{
\index{gGCFE.c@{g\-GCFE.c}!gGCFEread@{gGCFEread}}
\index{gGCFEread@{gGCFEread}!gGCFE.c@{g\-GCFE.c}}
\subsubsection[gGCFEread]{\setlength{\rightskip}{0pt plus 5cm}int g\-GCFEread (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em gccc\-Addr}, unsigned short {\em gcrc\-Addr}, unsigned short {\em gcfe\-Addr}, unsigned short {\em reg}, unsigned short $\ast$ {\em val})}}
\label{gGCFE_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 gccc\-Addr}]GCCC address \item[{\em gcrc\-Addr}]GCRC address \item[{\em gcfe\-Addr}]GCFE address \item[{\em reg}]register of GCFE 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\-GCFEread()\end{Desc}
Reads the GCFE 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}
