\hypertarget{gio_8c}{
\section{gio.c File Reference}
\label{gio_8c}\index{gio.c@{gio.c}}
}
Implements input/output methods.  


{\tt \#include \char`\"{}GNAT/gio.h\char`\"{}}\par
{\tt \#include \char`\"{}gnat\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GNAT/VME.h\char`\"{}}\par
{\tt \#include \char`\"{}latp\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GNAT/log.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gio_8c_a0}{board\-Probe} (unsigned int local\-Addr)
\begin{CompactList}\small\item\em attempts to detect the presence of the board at the local\-Adr location \item\end{CompactList}\item 
int \hyperlink{gio_8c_a1}{g\-Probe} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em attempts to probe the local address previously determined by g\-Map\-Addr() \item\end{CompactList}\item 
int \hyperlink{gio_8c_a2}{g\-Flush\-All\-F} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em flushes the record and playback FIFOs of the board referenced by handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a3}{g\-Flush\-RF} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em flushes the record FIFO of the board referenced by handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a4}{g\-Flush\-PF} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em flushes the playback FIFO of the board referenced by handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a5}{g\-Reset} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em resets the board referenced by handle. Returns the board to a known state. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a6}{g\-HWver} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int $\ast$version, unsigned short int $\ast$revision)
\begin{CompactList}\small\item\em fetchs the hardware {\em version\/} and {\em revision\/} numbers from the board \item\end{CompactList}\item 
int \hyperlink{gio_8c_a7}{g\-SWver} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int $\ast$version, unsigned short int $\ast$revision)
\begin{CompactList}\small\item\em fetchs the software {\em version\/} and {\em revision\/} numbers from the board \item\end{CompactList}\item 
int \hyperlink{gio_8c_a8}{g\-Write\-PF16} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int val)
\begin{CompactList}\small\item\em writes the 16-bit short word {\em val\/} to the play back FIFO \item\end{CompactList}\item 
int \hyperlink{gio_8c_a9}{g\-Write\-PF16n} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int n\-Item, unsigned short int val)
\begin{CompactList}\small\item\em writes the 16-bit short word {\em val\/} to the play back FIFO {\em n\-Item\/} times \item\end{CompactList}\item 
int \hyperlink{gio_8c_a10}{g\-Write\-PF16v} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int n\-Val, unsigned short int $\ast$a\-Val)
\begin{CompactList}\small\item\em writes the array of 16-bit short words {\em a\-Val\/} to the play back FIFO \item\end{CompactList}\item 
int \hyperlink{gio_8c_a11}{g\-Write\-PF32} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int val)
\begin{CompactList}\small\item\em writes the 32-bit word {\em val\/} to the play back FIFO \item\end{CompactList}\item 
int \hyperlink{gio_8c_a12}{g\-Write\-PF32n} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int n\-Item, unsigned int val)
\begin{CompactList}\small\item\em writes the 32-bit word {\em val\/} to the play back FIFO \item\end{CompactList}\item 
int \hyperlink{gio_8c_a13}{g\-Write\-PF32v} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int n\-Val, unsigned int $\ast$a\-Val)
\begin{CompactList}\small\item\em writes the array of 32-bit words {\em a\-Val\/} to the play back FIFO \item\end{CompactList}\item 
int \hyperlink{gio_8c_a14}{g\-Read\-RF16} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int $\ast$val)
\begin{CompactList}\small\item\em reads a 16-bit short word from record FIFO and stores it {\em val\/} \item\end{CompactList}\item 
int \hyperlink{gio_8c_a15}{g\-Read\-RF16v} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short int n\-Val, unsigned short int $\ast$a\-Val)
\begin{CompactList}\small\item\em reads {\em n\-Val\/} 16-bit short words from the record FIFO and stores them in {\em a\-Val\/} \item\end{CompactList}\item 
int \hyperlink{gio_8c_a16}{g\-Read\-RF32} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$val)
\begin{CompactList}\small\item\em reads a 32-bit word from record FIFO and stores it {\em val\/} \item\end{CompactList}\item 
int \hyperlink{gio_8c_a17}{g\-Read\-RF32v} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int n\-Val, unsigned int $\ast$a\-Val)
\begin{CompactList}\small\item\em reads {\em n\-Val\/} 32-bit words from the record FIFO and stores them in {\em a\-Val\/} \item\end{CompactList}\item 
int \hyperlink{gio_8c_a18}{g\-Enable\-Clk0} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Enables continuous clock on channel 0, generated by board. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a19}{g\-Enable\-All\-F} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Prepares both the playback and record FIFOs for writing, by taking them out of reset. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a20}{g\-Enable\-PF} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Prepares the play back FIFO for writing, by taking it out of reset. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a21}{g\-Enable\-RF} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Prepares the record FIFO for writing, by taking it out of reset. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a22}{g\-Clr\-ALLhist} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Clears the latched occupancy status for both Playback and Record FIFOs. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a23}{g\-Clr\-PFhist} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Clears the latched occupancy status for the Playback FIFOs. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a24}{g\-Clr\-RFhist} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Clears the latched occupancy status for the record FIFO. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a25}{g\-Is\-Empty\-RF} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Checks if the record FIFO is empty. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a26}{g\-Start\-PB} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Start the playblack sequence. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a27}{g\-Set\-Acq\-Src} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int src)
\begin{CompactList}\small\item\em Set the source for initiating playback. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a28}{g\-Set\-Rec\-Dly} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned char dly)
\begin{CompactList}\small\item\em Set the delay for the read back FIFO. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a29}{g\-Set\-Clk\-Dly} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned char dly)
\begin{CompactList}\small\item\em Set the delay for the channel 0 clock. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a30}{g\-Set\-Irq\-Level} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int level)
\begin{CompactList}\small\item\em Set interrupt level for this gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a31}{g\-Get\-Irq\-Level} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$level)
\begin{CompactList}\small\item\em Get interrupt level for this gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a32}{g\-Set\-Irq\-Vector} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int vector)
\begin{CompactList}\small\item\em Set interrupt vector for this gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a33}{g\-Get\-Irq\-Vector} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$vec)
\begin{CompactList}\small\item\em Get interrupt vector for this gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a34}{g\-Set\-Irq\-Delay} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int dly)
\begin{CompactList}\small\item\em Set interrupt delay for this gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a35}{g\-Connect\-Irq} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Prepares driver and board for interrupts. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a36}{g\-Enable\-Irq} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Enables interrupt. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a37}{g\-Disable\-Irq} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Disables interrupt. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a38}{g\-Set\-Active} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int mode)
\begin{CompactList}\small\item\em Set active member for gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a39}{g\-Get\-Active} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$mode)
\begin{CompactList}\small\item\em Returns current active mode for gnat\-Handle. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a40}{g\-Flush\-Pipeline} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Purges stale cruft from internal FPGA state machine. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a41}{g\-Set\-Out\-Mask} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int mask)
\begin{CompactList}\small\item\em Sets the output XOR bit mask used when writing to the FIFO. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a42}{g\-Get\-Out\-Mask} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$mask)
\begin{CompactList}\small\item\em Gets the output XOR bit mask used when writing to the FIFO. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a43}{g\-Take\-Int\-Sem} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Takes the interrupt sync semaphore. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a44}{g\-Version} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned short hw\-Ver, unsigned short hw\-Rev, unsigned short sw\-Ver, unsigned short sw\-Rev)
\begin{CompactList}\small\item\em Checks the COMM Board hardware version/revision. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a45}{g\-Comm\-Ready} (\hyperlink{struct__gnat}{gnat\-Handle} gh, int time\-Out)
\begin{CompactList}\small\item\em Waits for the COMM board to become ready, via polling. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a46}{g\-Lock\-FIFO} (\hyperlink{struct__gnat}{gnat\-Handle} gh, int time\-Out)
\begin{CompactList}\small\item\em Locks access to the COMM board FIFO. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a47}{g\-Un\-Lock\-FIFO} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Unlocks access to the COMM board FIFO. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a48}{g\-Set\-Cmd\-Chnl} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned char chnl)
\begin{CompactList}\small\item\em Sets the outgoing command number for the clock line. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a49}{g\-Get\-Cmd\-Chnl} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Wrapper for fetching value of {\em gh-$>$m\_\-cmd\-Channel\/}. \item\end{CompactList}\item 
int \hyperlink{gio_8c_a50}{g\-Has\-VASU} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Returns non-zero if VASU board detected. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implements input/output methods. 

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


\subsection{Function Documentation}
\hypertarget{gio_8c_a0}{
\index{gio.c@{gio.c}!boardProbe@{boardProbe}}
\index{boardProbe@{boardProbe}!gio.c@{gio.c}}
\subsubsection[boardProbe]{\setlength{\rightskip}{0pt plus 5cm}static int board\-Probe (unsigned int {\em local\-Addr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{gio_8c_a0}


attempts to detect the presence of the board at the local\-Adr location 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em local\-Addr}]address of COMM I/O board \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0 on success, non-zero for failure \end{Desc}
\hypertarget{gio_8c_a22}{
\index{gio.c@{gio.c}!gClrALLhist@{gClrALLhist}}
\index{gClrALLhist@{gClrALLhist}!gio.c@{gio.c}}
\subsubsection[gClrALLhist]{\setlength{\rightskip}{0pt plus 5cm}int g\-Clr\-ALLhist (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a22}


Clears the latched occupancy status for both Playback and Record FIFOs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a23}{g\-Clr\-PFhist()}, \hyperlink{gio_8h_a24}{g\-Clr\-RFhist()}\end{Desc}
Clears the occupancy status flags ( Empty, Full, Almost Empty, Almost Full ) for both the record FIFO and the playback FIFO. \hypertarget{gio_8c_a23}{
\index{gio.c@{gio.c}!gClrPFhist@{gClrPFhist}}
\index{gClrPFhist@{gClrPFhist}!gio.c@{gio.c}}
\subsubsection[gClrPFhist]{\setlength{\rightskip}{0pt plus 5cm}int g\-Clr\-PFhist (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a23}


Clears the latched occupancy status for the Playback FIFOs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a24}{g\-Clr\-RFhist()}, \hyperlink{gio_8h_a22}{g\-Clr\-ALLhist()}\end{Desc}
Clears the occupancy status flags ( Empty, Full, Almost Empty, Almost Full ) for the playback FIFO. \hypertarget{gio_8c_a24}{
\index{gio.c@{gio.c}!gClrRFhist@{gClrRFhist}}
\index{gClrRFhist@{gClrRFhist}!gio.c@{gio.c}}
\subsubsection[gClrRFhist]{\setlength{\rightskip}{0pt plus 5cm}int g\-Clr\-RFhist (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a24}


Clears the latched occupancy status for the record FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a23}{g\-Clr\-PFhist()}, \hyperlink{gio_8h_a22}{g\-Clr\-ALLhist()}\end{Desc}
Clears the occupancy status flags ( Empty, Full, Almost Empty, Almost Full ) for the record FIFO. \hypertarget{gio_8c_a45}{
\index{gio.c@{gio.c}!gCommReady@{gCommReady}}
\index{gCommReady@{gCommReady}!gio.c@{gio.c}}
\subsubsection[gCommReady]{\setlength{\rightskip}{0pt plus 5cm}int g\-Comm\-Ready (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, int {\em time\-Out})}}
\label{gio_8c_a45}


Waits for the COMM board to become ready, via polling. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]gnat driver handle previously allocated \item[{\em time\-Out}]timeout value in sysclk ticks \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success or GERR\_\-READY\_\-TIMEOUT on timeout. \end{Desc}
\hypertarget{gio_8c_a35}{
\index{gio.c@{gio.c}!gConnectIrq@{gConnectIrq}}
\index{gConnectIrq@{gConnectIrq}!gio.c@{gio.c}}
\subsubsection[gConnectIrq]{\setlength{\rightskip}{0pt plus 5cm}int g\-Connect\-Irq (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a35}


Prepares driver and board for interrupts. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a37}{
\index{gio.c@{gio.c}!gDisableIrq@{gDisableIrq}}
\index{gDisableIrq@{gDisableIrq}!gio.c@{gio.c}}
\subsubsection[gDisableIrq]{\setlength{\rightskip}{0pt plus 5cm}int g\-Disable\-Irq (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a37}


Disables interrupt. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a19}{
\index{gio.c@{gio.c}!gEnableAllF@{gEnableAllF}}
\index{gEnableAllF@{gEnableAllF}!gio.c@{gio.c}}
\subsubsection[gEnableAllF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Enable\-All\-F (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a19}


Prepares both the playback and record FIFOs for writing, by taking them out of reset. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a19}{g\-Enable\-RF()}, \hyperlink{gio_8h_a18}{g\-Enable\-PF()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()} \end{Desc}
\hypertarget{gio_8c_a18}{
\index{gio.c@{gio.c}!gEnableClk0@{gEnableClk0}}
\index{gEnableClk0@{gEnableClk0}!gio.c@{gio.c}}
\subsubsection[gEnableClk0]{\setlength{\rightskip}{0pt plus 5cm}int g\-Enable\-Clk0 (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a18}


Enables continuous clock on channel 0, generated by board. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a36}{
\index{gio.c@{gio.c}!gEnableIrq@{gEnableIrq}}
\index{gEnableIrq@{gEnableIrq}!gio.c@{gio.c}}
\subsubsection[gEnableIrq]{\setlength{\rightskip}{0pt plus 5cm}int g\-Enable\-Irq (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a36}


Enables interrupt. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a20}{
\index{gio.c@{gio.c}!gEnablePF@{gEnablePF}}
\index{gEnablePF@{gEnablePF}!gio.c@{gio.c}}
\subsubsection[gEnablePF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Enable\-PF (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a20}


Prepares the play back FIFO for writing, by taking it out of reset. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a19}{g\-Enable\-RF()}, \hyperlink{gio_8h_a17}{g\-Enable\-All\-F()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()} \end{Desc}
\hypertarget{gio_8c_a21}{
\index{gio.c@{gio.c}!gEnableRF@{gEnableRF}}
\index{gEnableRF@{gEnableRF}!gio.c@{gio.c}}
\subsubsection[gEnableRF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Enable\-RF (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a21}


Prepares the record FIFO for writing, by taking it out of reset. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a18}{g\-Enable\-PF()}, \hyperlink{gio_8h_a17}{g\-Enable\-All\-F()}, \hyperlink{gio_8h_a15}{g\-Read\-RF32()}, \hyperlink{gio_8h_a16}{g\-Read\-RF32v()}, \hyperlink{gio_8h_a13}{g\-Read\-RF16()}, \hyperlink{gio_8h_a14}{g\-Read\-RF16v()} \end{Desc}
\hypertarget{gio_8c_a2}{
\index{gio.c@{gio.c}!gFlushAllF@{gFlushAllF}}
\index{gFlushAllF@{gFlushAllF}!gio.c@{gio.c}}
\subsubsection[gFlushAllF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Flush\-All\-F (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a2}


flushes the record and playback FIFOs of the board referenced by handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK if successful \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a2}{g\-Flush\-RF()}, \hyperlink{gio_8h_a3}{g\-Flush\-PF()} \end{Desc}
\hypertarget{gio_8c_a4}{
\index{gio.c@{gio.c}!gFlushPF@{gFlushPF}}
\index{gFlushPF@{gFlushPF}!gio.c@{gio.c}}
\subsubsection[gFlushPF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Flush\-PF (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a4}


flushes the playback FIFO of the board referenced by handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK if successful \end{Desc}
\hypertarget{gio_8c_a40}{
\index{gio.c@{gio.c}!gFlushPipeline@{gFlushPipeline}}
\index{gFlushPipeline@{gFlushPipeline}!gio.c@{gio.c}}
\subsubsection[gFlushPipeline]{\setlength{\rightskip}{0pt plus 5cm}int g\-Flush\-Pipeline (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a40}


Purges stale cruft from internal FPGA state machine. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}
Purges stale data from internal FPGA pipeline by playing back one word of 0x3FFFF through the system. \hypertarget{gio_8c_a3}{
\index{gio.c@{gio.c}!gFlushRF@{gFlushRF}}
\index{gFlushRF@{gFlushRF}!gio.c@{gio.c}}
\subsubsection[gFlushRF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Flush\-RF (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a3}


flushes the record FIFO of the board referenced by handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK if successful \end{Desc}
\hypertarget{gio_8c_a39}{
\index{gio.c@{gio.c}!gGetActive@{gGetActive}}
\index{gGetActive@{gGetActive}!gio.c@{gio.c}}
\subsubsection[gGetActive]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Active (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em mode})}}
\label{gio_8c_a39}


Returns current active mode for gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em mode}]pointer to storage to hold current mode \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a41}{g\-Set\-Active()} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}
Returns the current active mode for the gnat\-Handle. A value of 0 means inactive, while a non-zero value means active. \hypertarget{gio_8c_a49}{
\index{gio.c@{gio.c}!gGetCmdChnl@{gGetCmdChnl}}
\index{gGetCmdChnl@{gGetCmdChnl}!gio.c@{gio.c}}
\subsubsection[gGetCmdChnl]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Cmd\-Chnl (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a49}


Wrapper for fetching value of {\em gh-$>$m\_\-cmd\-Channel\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]value of {\em gh-$>$m\_\-cmd\-Channel\/} \end{Desc}
\hypertarget{gio_8c_a31}{
\index{gio.c@{gio.c}!gGetIrqLevel@{gGetIrqLevel}}
\index{gGetIrqLevel@{gGetIrqLevel}!gio.c@{gio.c}}
\subsubsection[gGetIrqLevel]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Irq\-Level (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em level})}}
\label{gio_8c_a31}


Get interrupt level for this gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em level}]pointer to storage for interrupt level \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8c_a32}{g\-Set\-Irq\-Vector}, \hyperlink{gio_8c_a30}{g\-Set\-Irq\-Level}, \hyperlink{gio_8c_a33}{g\-Get\-Irq\-Vector} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a33}{
\index{gio.c@{gio.c}!gGetIrqVector@{gGetIrqVector}}
\index{gGetIrqVector@{gGetIrqVector}!gio.c@{gio.c}}
\subsubsection[gGetIrqVector]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Irq\-Vector (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em vec})}}
\label{gio_8c_a33}


Get interrupt vector for this gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em vec}]interrupt vector to get \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8c_a32}{g\-Set\-Irq\-Vector}, \hyperlink{gio_8c_a30}{g\-Set\-Irq\-Level}, \hyperlink{gio_8c_a31}{g\-Get\-Irq\-Level} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a42}{
\index{gio.c@{gio.c}!gGetOutMask@{gGetOutMask}}
\index{gGetOutMask@{gGetOutMask}!gio.c@{gio.c}}
\subsubsection[gGetOutMask]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Out\-Mask (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em mask})}}
\label{gio_8c_a42}


Gets the output XOR bit mask used when writing to the FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em mask}]pointer to storage for XOR bit mask \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
Gets the XOR bit mask used when writing data to the playback FIFO. \hypertarget{gio_8c_a50}{
\index{gio.c@{gio.c}!gHasVASU@{gHasVASU}}
\index{gHasVASU@{gHasVASU}!gio.c@{gio.c}}
\subsubsection[gHasVASU]{\setlength{\rightskip}{0pt plus 5cm}int g\-Has\-VASU (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a50}


Returns non-zero if VASU board detected. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]value of {\em gh-$>$m\_\-vasu\/} \end{Desc}
\hypertarget{gio_8c_a6}{
\index{gio.c@{gio.c}!gHWver@{gHWver}}
\index{gHWver@{gHWver}!gio.c@{gio.c}}
\subsubsection[gHWver]{\setlength{\rightskip}{0pt plus 5cm}int g\-HWver (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int $\ast$ {\em version}, unsigned short int $\ast$ {\em revision})}}
\label{gio_8c_a6}


fetchs the hardware {\em version\/} and {\em revision\/} numbers from the board 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em version}]3 LSB contain hardware version number \item[{\em revision}]3 LSB contain hardware revision number \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a6}{g\-SWver()} \end{Desc}
\hypertarget{gio_8c_a25}{
\index{gio.c@{gio.c}!gIsEmptyRF@{gIsEmptyRF}}
\index{gIsEmptyRF@{gIsEmptyRF}!gio.c@{gio.c}}
\subsubsection[gIsEmptyRF]{\setlength{\rightskip}{0pt plus 5cm}int g\-Is\-Empty\-RF (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a25}


Checks if the record FIFO is empty. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Non-zero if record FIFO is empty, zero otherwise. \end{Desc}
\hypertarget{gio_8c_a46}{
\index{gio.c@{gio.c}!gLockFIFO@{gLockFIFO}}
\index{gLockFIFO@{gLockFIFO}!gio.c@{gio.c}}
\subsubsection[gLockFIFO]{\setlength{\rightskip}{0pt plus 5cm}int g\-Lock\-FIFO (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, int {\em time\-Out})}}
\label{gio_8c_a46}


Locks access to the COMM board FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]gnat driver handle previously allocated \item[{\em time\-Out}]timeout value in sysclk ticks \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success or GERR\_\-READY\_\-TIMEOUT on timeout. \end{Desc}
\hypertarget{gio_8c_a1}{
\index{gio.c@{gio.c}!gProbe@{gProbe}}
\index{gProbe@{gProbe}!gio.c@{gio.c}}
\subsubsection[gProbe]{\setlength{\rightskip}{0pt plus 5cm}int g\-Probe (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a1}


attempts to probe the local address previously determined by g\-Map\-Addr() 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device to probe \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK if board probed. \end{Desc}
\begin{Desc}
\item[See also:]g\-Map\-Addr() \end{Desc}
\hypertarget{gio_8c_a14}{
\index{gio.c@{gio.c}!gReadRF16@{gReadRF16}}
\index{gReadRF16@{gReadRF16}!gio.c@{gio.c}}
\subsubsection[gReadRF16]{\setlength{\rightskip}{0pt plus 5cm}int g\-Read\-RF16 (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int $\ast$ {\em val})}}
\label{gio_8c_a14}


reads a 16-bit short word from record FIFO and stores it {\em val\/} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]pointer to 16-bit short word to hold results of read \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a14}{g\-Read\-RF16v()}, \hyperlink{gio_8h_a15}{g\-Read\-RF32()}, \hyperlink{gio_8h_a16}{g\-Read\-RF32v()} \end{Desc}
\hypertarget{gio_8c_a15}{
\index{gio.c@{gio.c}!gReadRF16v@{gReadRF16v}}
\index{gReadRF16v@{gReadRF16v}!gio.c@{gio.c}}
\subsubsection[gReadRF16v]{\setlength{\rightskip}{0pt plus 5cm}int g\-Read\-RF16v (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int {\em n\-Val}, unsigned short int $\ast$ {\em a\-Val})}}
\label{gio_8c_a15}


reads {\em n\-Val\/} 16-bit short words from the record FIFO and stores them in {\em a\-Val\/} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em n\-Val}]number of words to read from record FIFO \item[{\em a\-Val}]pointer to array of 16-bit short words -- used to hold the read data \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a13}{g\-Read\-RF16()}, \hyperlink{gio_8h_a15}{g\-Read\-RF32()}, \hyperlink{gio_8h_a16}{g\-Read\-RF32v()} \end{Desc}
\hypertarget{gio_8c_a16}{
\index{gio.c@{gio.c}!gReadRF32@{gReadRF32}}
\index{gReadRF32@{gReadRF32}!gio.c@{gio.c}}
\subsubsection[gReadRF32]{\setlength{\rightskip}{0pt plus 5cm}int g\-Read\-RF32 (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em val})}}
\label{gio_8c_a16}


reads a 32-bit word from record FIFO and stores it {\em val\/} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]32-bit word to read from record FIFO \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a16}{g\-Read\-RF32v()}, \hyperlink{gio_8h_a13}{g\-Read\-RF16()}, \hyperlink{gio_8h_a14}{g\-Read\-RF16v()}\end{Desc}
Note that the FIFO width is only 18 bits long so the result is anded with 0x3FFFF. \hypertarget{gio_8c_a17}{
\index{gio.c@{gio.c}!gReadRF32v@{gReadRF32v}}
\index{gReadRF32v@{gReadRF32v}!gio.c@{gio.c}}
\subsubsection[gReadRF32v]{\setlength{\rightskip}{0pt plus 5cm}int g\-Read\-RF32v (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em n\-Val}, unsigned int $\ast$ {\em a\-Val})}}
\label{gio_8c_a17}


reads {\em n\-Val\/} 32-bit words from the record FIFO and stores them in {\em a\-Val\/} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em n\-Val}]number of elements in {\em a\-Val\/} \item[{\em a\-Val}]pointer to array of 32-bit words -- used to hold the read data \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a15}{g\-Read\-RF32()}, \hyperlink{gio_8h_a13}{g\-Read\-RF16()}, \hyperlink{gio_8h_a14}{g\-Read\-RF16v()}\end{Desc}
Note that the FIFO width is only 18 bits long so the result is anded with 0x3FFFF. \hypertarget{gio_8c_a5}{
\index{gio.c@{gio.c}!gReset@{gReset}}
\index{gReset@{gReset}!gio.c@{gio.c}}
\subsubsection[gReset]{\setlength{\rightskip}{0pt plus 5cm}int g\-Reset (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a5}


resets the board referenced by handle. Returns the board to a known state. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device to resest \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK if board reset \end{Desc}
\hypertarget{gio_8c_a27}{
\index{gio.c@{gio.c}!gSetAcqSrc@{gSetAcqSrc}}
\index{gSetAcqSrc@{gSetAcqSrc}!gio.c@{gio.c}}
\subsubsection[gSetAcqSrc]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Acq\-Src (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em src})}}
\label{gio_8c_a27}


Set the source for initiating playback. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em src}]source bit \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}
The {\em src\/} parameter defines which of two possible sources to use for initiating playback from the FIFOs. If {\em is\/} zero the source is the transition of bit 31 of the control register from 0 to 1. If {\em is\/} non-zero the source is the external signal brought in through the front panel LEMO connector labeled \char`\"{}START IN\char`\"{}. \hypertarget{gio_8c_a38}{
\index{gio.c@{gio.c}!gSetActive@{gSetActive}}
\index{gSetActive@{gSetActive}!gio.c@{gio.c}}
\subsubsection[gSetActive]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Active (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em mode})}}
\label{gio_8c_a38}


Set active member for gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em mode}]mode to set handle to \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a42}{g\-Get\-Active()} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}
Used to mode switch between commanding and event taking for single COMM board operation. A value of 0 means inactive, while a non-zero value means active. \hypertarget{gio_8c_a29}{
\index{gio.c@{gio.c}!gSetClkDly@{gSetClkDly}}
\index{gSetClkDly@{gSetClkDly}!gio.c@{gio.c}}
\subsubsection[gSetClkDly]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Clk\-Dly (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned char {\em dly})}}
\label{gio_8c_a29}


Set the delay for the channel 0 clock. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em dly}]the number of 2ns ticks to delay the channel 0 clock \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a26}{g\-Start\-PB()} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}
Fix-up for timing skews between multiple COMM boards. The delay field is 6 bits wide, allowing for delays from 0 to 64ns in 2ns increments. \hypertarget{gio_8c_a48}{
\index{gio.c@{gio.c}!gSetCmdChnl@{gSetCmdChnl}}
\index{gSetCmdChnl@{gSetCmdChnl}!gio.c@{gio.c}}
\subsubsection[gSetCmdChnl]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Cmd\-Chnl (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned char {\em chnl})}}
\label{gio_8c_a48}


Sets the outgoing command number for the clock line. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em chnl}]channel number \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success \end{Desc}
\hypertarget{gio_8c_a34}{
\index{gio.c@{gio.c}!gSetIrqDelay@{gSetIrqDelay}}
\index{gSetIrqDelay@{gSetIrqDelay}!gio.c@{gio.c}}
\subsubsection[gSetIrqDelay]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Irq\-Delay (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em dly})}}
\label{gio_8c_a34}


Set interrupt delay for this gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em dly}]interrupt dly to set \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a31}{g\-Set\-Irq\-Level()}, \hyperlink{gio_8h_a33}{g\-Set\-Irq\-Vector()} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a30}{
\index{gio.c@{gio.c}!gSetIrqLevel@{gSetIrqLevel}}
\index{gSetIrqLevel@{gSetIrqLevel}!gio.c@{gio.c}}
\subsubsection[gSetIrqLevel]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Irq\-Level (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em level})}}
\label{gio_8c_a30}


Set interrupt level for this gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em level}]interrupt level to set \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8c_a32}{g\-Set\-Irq\-Vector}, \hyperlink{gio_8c_a34}{g\-Set\-Irq\-Delay}, \hyperlink{gio_8c_a31}{g\-Get\-Irq\-Level}, \hyperlink{gio_8c_a33}{g\-Get\-Irq\-Vector} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a32}{
\index{gio.c@{gio.c}!gSetIrqVector@{gSetIrqVector}}
\index{gSetIrqVector@{gSetIrqVector}!gio.c@{gio.c}}
\subsubsection[gSetIrqVector]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Irq\-Vector (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em vector})}}
\label{gio_8c_a32}


Set interrupt vector for this gnat\-Handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em vector}]interrupt vector to set \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8c_a30}{g\-Set\-Irq\-Level}, \hyperlink{gio_8c_a34}{g\-Set\-Irq\-Delay} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a41}{
\index{gio.c@{gio.c}!gSetOutMask@{gSetOutMask}}
\index{gSetOutMask@{gSetOutMask}!gio.c@{gio.c}}
\subsubsection[gSetOutMask]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Out\-Mask (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em mask})}}
\label{gio_8c_a41}


Sets the output XOR bit mask used when writing to the FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em mask}]XOR bit mask \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a39}{g\-Get\-Out\-Mask()}\end{Desc}
Sets the XOR bit mask used when writing data to the playback FIFO. \hypertarget{gio_8c_a28}{
\index{gio.c@{gio.c}!gSetRecDly@{gSetRecDly}}
\index{gSetRecDly@{gSetRecDly}!gio.c@{gio.c}}
\subsubsection[gSetRecDly]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Rec\-Dly (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned char {\em dly})}}
\label{gio_8c_a28}


Set the delay for the read back FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em dly}]the number of 25ns ticks to delay the read back FIFO. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a26}{g\-Start\-PB()} \end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}
After starting playback wait {\em dly\/} 25ns intervals before clocking data into the record FIFO. The delay register is 8 bits wide, allowing for delays from 0 to 6.4usec in 25ns increments. \hypertarget{gio_8c_a26}{
\index{gio.c@{gio.c}!gStartPB@{gStartPB}}
\index{gStartPB@{gStartPB}!gio.c@{gio.c}}
\subsubsection[gStartPB]{\setlength{\rightskip}{0pt plus 5cm}int g\-Start\-PB (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a26}


Start the playblack sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a7}{
\index{gio.c@{gio.c}!gSWver@{gSWver}}
\index{gSWver@{gSWver}!gio.c@{gio.c}}
\subsubsection[gSWver]{\setlength{\rightskip}{0pt plus 5cm}int g\-SWver (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int $\ast$ {\em version}, unsigned short int $\ast$ {\em revision})}}
\label{gio_8c_a7}


fetchs the software {\em version\/} and {\em revision\/} numbers from the board 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em version}]3 LSB contain software version number \item[{\em revision}]3 LSB contain software revision number \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a5}{g\-HWver()} \end{Desc}
\hypertarget{gio_8c_a43}{
\index{gio.c@{gio.c}!gTakeIntSem@{gTakeIntSem}}
\index{gTakeIntSem@{gTakeIntSem}!gio.c@{gio.c}}
\subsubsection[gTakeIntSem]{\setlength{\rightskip}{0pt plus 5cm}int g\-Take\-Int\-Sem (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a43}


Takes the interrupt sync semaphore. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a47}{
\index{gio.c@{gio.c}!gUnLockFIFO@{gUnLockFIFO}}
\index{gUnLockFIFO@{gUnLockFIFO}!gio.c@{gio.c}}
\subsubsection[gUnLockFIFO]{\setlength{\rightskip}{0pt plus 5cm}int g\-Un\-Lock\-FIFO (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gio_8c_a47}


Unlocks access to the COMM board FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]gnat driver handle previously allocated \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success or GERR\_\-READY\_\-TIMEOUT on timeout. \end{Desc}
\hypertarget{gio_8c_a44}{
\index{gio.c@{gio.c}!gVersion@{gVersion}}
\index{gVersion@{gVersion}!gio.c@{gio.c}}
\subsubsection[gVersion]{\setlength{\rightskip}{0pt plus 5cm}int g\-Version (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short {\em hw\-Ver}, unsigned short {\em hw\-Rev}, unsigned short {\em sw\-Ver}, unsigned short {\em sw\-Rev})}}
\label{gio_8c_a44}


Checks the COMM Board hardware version/revision. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em hw\-Ver}]COMM Board hardware version \item[{\em hw\-Rev}]COMM Board hardware revision \item[{\em sw\-Ver}]COMM Board firmware version \item[{\em sw\-Rev}]COMM Board firmware revision \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\hypertarget{gio_8c_a8}{
\index{gio.c@{gio.c}!gWritePF16@{gWritePF16}}
\index{gWritePF16@{gWritePF16}!gio.c@{gio.c}}
\subsubsection[gWritePF16]{\setlength{\rightskip}{0pt plus 5cm}int g\-Write\-PF16 (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int {\em val})}}
\label{gio_8c_a8}


writes the 16-bit short word {\em val\/} to the play back FIFO 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]16-bit short word to write to play back FIFO \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
The data is written to the play back FIFO -- the data is first XOR-ed with gh-$>$m\_\-out\-Mask before writing to the FIFO. \hypertarget{gio_8c_a9}{
\index{gio.c@{gio.c}!gWritePF16n@{gWritePF16n}}
\index{gWritePF16n@{gWritePF16n}!gio.c@{gio.c}}
\subsubsection[gWritePF16n]{\setlength{\rightskip}{0pt plus 5cm}int g\-Write\-PF16n (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int {\em n\-Item}, unsigned short int {\em val})}}
\label{gio_8c_a9}


writes the 16-bit short word {\em val\/} to the play back FIFO {\em n\-Item\/} times 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em n\-Item}]number of times to writes {\em val\/} to FIFO \item[{\em val}]16-bit short word to write to play back FIFO \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
{\em n\-Item\/} copies of {\em val\/} is written to the play back FIFO -- the data is first XOR-ed with gh-$>$m\_\-out\-Mask before writing to the FIFO. \hypertarget{gio_8c_a10}{
\index{gio.c@{gio.c}!gWritePF16v@{gWritePF16v}}
\index{gWritePF16v@{gWritePF16v}!gio.c@{gio.c}}
\subsubsection[gWritePF16v]{\setlength{\rightskip}{0pt plus 5cm}int g\-Write\-PF16v (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int {\em n\-Val}, unsigned short int $\ast$ {\em a\-Val})}}
\label{gio_8c_a10}


writes the array of 16-bit short words {\em a\-Val\/} to the play back FIFO 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em n\-Val}]number of elements in {\em a\-Val\/} \item[{\em a\-Val}]pointer to array of 16-bit short words \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
The data is written to the play back FIFO -- the data is first XOR-ed with gh-$>$m\_\-out\-Mask before writing to the FIFO. \hypertarget{gio_8c_a11}{
\index{gio.c@{gio.c}!gWritePF32@{gWritePF32}}
\index{gWritePF32@{gWritePF32}!gio.c@{gio.c}}
\subsubsection[gWritePF32]{\setlength{\rightskip}{0pt plus 5cm}int g\-Write\-PF32 (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em val})}}
\label{gio_8c_a11}


writes the 32-bit word {\em val\/} to the play back FIFO 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]32-bit word to write to play back FIFO \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
The data is written to the play back FIFO -- the data is first XOR-ed with gh-$>$m\_\-out\-Mask before writing to the FIFO. \hypertarget{gio_8c_a12}{
\index{gio.c@{gio.c}!gWritePF32n@{gWritePF32n}}
\index{gWritePF32n@{gWritePF32n}!gio.c@{gio.c}}
\subsubsection[gWritePF32n]{\setlength{\rightskip}{0pt plus 5cm}int g\-Write\-PF32n (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned short int {\em n\-Item}, unsigned int {\em val})}}
\label{gio_8c_a12}


writes the 32-bit word {\em val\/} to the play back FIFO 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em n\-Item}]number of times to writes {\em val\/} to FIFO \item[{\em val}]32-bit word to write to play back FIFO \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a12}{g\-Write\-PF32v()}, \hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
{\em n\-Item\/} copies of {\em val\/} is written to the play back FIFO -- the data is first XOR-ed with gh-$>$m\_\-out\-Mask before writing to the FIFO. \hypertarget{gio_8c_a13}{
\index{gio.c@{gio.c}!gWritePF32v@{gWritePF32v}}
\index{gWritePF32v@{gWritePF32v}!gio.c@{gio.c}}
\subsubsection[gWritePF32v]{\setlength{\rightskip}{0pt plus 5cm}int g\-Write\-PF32v (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em n\-Val}, unsigned int $\ast$ {\em a\-Val})}}
\label{gio_8c_a13}


writes the array of 32-bit words {\em a\-Val\/} to the play back FIFO 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em n\-Val}]number of elements in {\em a\-Val\/} \item[{\em a\-Val}]pointer to array of 32-bit words \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gio_8h_a10}{g\-Write\-PF32()}, \hyperlink{gio_8h_a7}{g\-Write\-PF16()}, \hyperlink{gio_8h_a9}{g\-Write\-PF16v()}, \hyperlink{gio_8h_a38}{g\-Set\-Out\-Mask()}\end{Desc}
The data is written to the play back FIFO -- the data is first XOR-ed with gh-$>$m\_\-out\-Mask before writing to the FIFO. 