\hypertarget{gGTIC_8c}{
\section{g\-GTIC.c File Reference}
\label{gGTIC_8c}\index{gGTIC.c@{gGTIC.c}}
}
Implements command/response for the GTIC.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}gt\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-TEM\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GTEM/g\-GTIC.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{gGTIC_8c_a0}{
\#define \hyperlink{gGTIC_8c_a0}{\_\-\_\-GTIC\_\-REG\_\-ADCS}\ (14)}
\label{gGTIC_8c_a0}

\begin{CompactList}\small\item\em Constant for GTIC ADCS register number. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gGTIC_8c_a1}{g\-GTICcmd} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the GTIC address. \item\end{CompactList}\item 
int \hyperlink{gGTIC_8c_a2}{g\-GTICload} (\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{gGTIC_8c_a3}{g\-GTICread} (\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{gGTIC_8c_a4}{g\-GTICread\-Env} (\hyperlink{struct__gtem}{gtem\-Handle} gt, unsigned short tem\-Addr, unsigned short $\ast$env)
\begin{CompactList}\small\item\em Reads a block of 8 16-bit ADC values for environmental quantities. \item\end{CompactList}\end{CompactItemize}


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

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


\subsection{Function Documentation}
\hypertarget{gGTIC_8c_a1}{
\index{gGTIC.c@{g\-GTIC.c}!gGTICcmd@{gGTICcmd}}
\index{gGTICcmd@{gGTICcmd}!gGTIC.c@{g\-GTIC.c}}
\subsubsection[gGTICcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTICcmd (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em opcode})}}
\label{gGTIC_8c_a1}


Sends a dataless command to the GTIC 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 GTIC address specified by {\em tem\-Addr\/}. \hypertarget{gGTIC_8c_a2}{
\index{gGTIC.c@{g\-GTIC.c}!gGTICload@{gGTICload}}
\index{gGTICload@{gGTICload}!gGTIC.c@{g\-GTIC.c}}
\subsubsection[gGTICload]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTICload (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gGTIC_8c_a2}


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 GTIC to load \item[{\em value}]32-bit value to load into GTIC register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the GTIC register specified by {\em reg\/} with {\em value\/} \hypertarget{gGTIC_8c_a3}{
\index{gGTIC.c@{g\-GTIC.c}!gGTICread@{gGTICread}}
\index{gGTICread@{gGTICread}!gGTIC.c@{g\-GTIC.c}}
\subsubsection[gGTICread]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTICread (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short {\em reg}, unsigned int $\ast$ {\em val})}}
\label{gGTIC_8c_a3}


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 GTIC 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 GTIC register specified by {\em reg\/}. {\em val\/} is filled on return. \hypertarget{gGTIC_8c_a4}{
\index{gGTIC.c@{g\-GTIC.c}!gGTICreadEnv@{gGTICreadEnv}}
\index{gGTICreadEnv@{gGTICreadEnv}!gGTIC.c@{g\-GTIC.c}}
\subsubsection[gGTICreadEnv]{\setlength{\rightskip}{0pt plus 5cm}int g\-GTICread\-Env (\hyperlink{struct__gtem}{gtem\-Handle} {\em gt}, unsigned short {\em tem\-Addr}, unsigned short $\ast$ {\em env})}}
\label{gGTIC_8c_a4}


Reads a block of 8 16-bit ADC values for environmental quantities. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gt}]gtem\-Handle for TEM \item[{\em tem\-Addr}]TEM address of command \item[{\em env}]pointer to storage to hold 8 $\ast$ 16-bit environmental quantities \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Reads the GTIC ADCS register which returns 8 12-bit environmental ADC values. This function returns the data as 8 16-bit values. 