\hypertarget{latp_8h}{
\section{latp.h File Reference}
\label{latp_8h}\index{latp.h@{latp.h}}
}
Structures and functions used to generate a list of register addresses and value/destinations to load/read. 

{\tt \#include \char`\"{}RIM/rim.h\char`\"{}}\par


Include dependency graph for latp.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=251pt]{latp_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=122pt]{latp_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{structRIM__errorInfo}{RIM\_\-error\-Info}
\begin{CompactList}\small\item\em Information used to record a read error occured. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{latp_8h_a0}{
typedef void( \hyperlink{latp_8h_a0}{RIM\_\-decode\-Fn} )(unsigned short $\ast$pkt, void $\ast$ptr)}
\label{latp_8h_a0}

\begin{CompactList}\small\item\em Function that Decodes the response from one type of LAT register. \item\end{CompactList}\item 
\hypertarget{latp_8h_a1}{
typedef unsigned( \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} )(void $\ast$param, const \hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$addr, unsigned reg\-Id, const void $\ast$value)}
\label{latp_8h_a1}

\begin{CompactList}\small\item\em Function that Loads one type of LAT register. \item\end{CompactList}\item 
\hypertarget{latp_8h_a2}{
typedef unsigned( \hyperlink{latp_8h_a2}{RIM\_\-read\-Fn} )(void $\ast$param, const \hyperlink{unionRIM__addr}{RIM\_\-addr} $\ast$addr, unsigned reg\-Id, \hyperlink{latp_8h_a0}{RIM\_\-decode\-Fn} $\ast$decode\-Fn, void $\ast$dst, const \hyperlink{structRIM__errorInfo}{RIM\_\-error\-Info} $\ast$info)}
\label{latp_8h_a2}

\begin{CompactList}\small\item\em Function that Reads one type of LAT register. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{latp_8h_a3}{RIM\_\-read} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, void $\ast$param, \hyperlink{latp_8h_a2}{RIM\_\-read\-Fn} $\ast$$\ast$read\-Fn, \hyperlink{latp_8h_a0}{RIM\_\-decode\-Fn} $\ast$$\ast$decode\-Fn, const \hyperlink{structRIM__map__}{RIM\_\-map} $\ast$ign)
\begin{CompactList}\small\item\em Populate the RIM structure with the current state of the LAT. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a4}{RIM\_\-load} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Loads the LAT with the configuration held in {\em imm\/}. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a5}{RIM\_\-load\-CFE} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, unsigned val, unsigned mask, unsigned shift, unsigned reg\-Id, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the {\em val\/} suitably masked and shifted. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a6}{RIM\_\-load\-CFEmask} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, unsigned mask, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the {\em val\/} suitably masked and shifted. \item\end{CompactList}\item 
void \hyperlink{latp_8h_a7}{RIM\_\-set\-SPT} (void $\ast$ptr, unsigned short value, unsigned is\-High)
\begin{CompactList}\small\item\em Decode the result item use to populate a split. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a8}{RIM\_\-load\-TDC} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, unsigned val, unsigned mask, unsigned shift, unsigned reg\-Id, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Load one of the TFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the {\em val\/} suitably masked and shifted. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a9}{RIM\_\-enable\-All\-AFE} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Enable all channels of the ACD for charge injection calibration. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a10}{RIM\_\-disable\-All\-AFE} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Disable all channels of the ACD for charge injection calibration. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8h_a11}{RIM\_\-enable\-AFE} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, unsigned rc, unsigned fe, void $\ast$param, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$load\-Fn)
\begin{CompactList}\small\item\em Enable one channel of the ACD for charge injection calibration. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Structures and functions used to generate a list of register addresses and value/destinations to load/read. 

\begin{Desc}
\item[Author:]James Swain -- \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{latp_8h_a10}{
\index{latp.h@{latp.h}!RIM_disableAllAFE@{RIM\_\-disableAllAFE}}
\index{RIM_disableAllAFE@{RIM\_\-disableAllAFE}!latp.h@{latp.h}}
\subsubsection[RIM\_\-disableAllAFE]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-disable\-All\-AFE (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a10}


Disable all channels of the ACD for charge injection calibration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the cached in-memory model of the LAT registers \item[{\em param}]Parameter passed through to the load function \item[{\em load\-Fn}]Type ordered array of functions that load a given type of LAT register \item[{\em param}]Parameter passed through to the load function\end{description}
\end{Desc}
\hypertarget{latp_8h_a11}{
\index{latp.h@{latp.h}!RIM_enableAFE@{RIM\_\-enableAFE}}
\index{RIM_enableAFE@{RIM\_\-enableAFE}!latp.h@{latp.h}}
\subsubsection[RIM\_\-enableAFE]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-enable\-AFE (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, unsigned {\em rc}, unsigned {\em fe}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a11}


Enable one channel of the ACD for charge injection calibration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the cached in-memory model of the LAT registers \item[{\em rc}]ID of the FREE board holding the channel to enable \item[{\em fe}]ID of the channel to enable \item[{\em param}]Parameter passed through to the load function \item[{\em load\-Fn}]Type ordered array of functions that load a given type of LAT register\end{description}
\end{Desc}
\hypertarget{latp_8h_a9}{
\index{latp.h@{latp.h}!RIM_enableAllAFE@{RIM\_\-enableAllAFE}}
\index{RIM_enableAllAFE@{RIM\_\-enableAllAFE}!latp.h@{latp.h}}
\subsubsection[RIM\_\-enableAllAFE]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-enable\-All\-AFE (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a9}


Enable all channels of the ACD for charge injection calibration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the cached in-memory model of the LAT registers \item[{\em load\-Fn}]Type ordered array of pointers to functions that load the LAT registers \item[{\em param}]Parameter passed through to the load function\end{description}
\end{Desc}
\hypertarget{latp_8h_a4}{
\index{latp.h@{latp.h}!RIM_load@{RIM\_\-load}}
\index{RIM_load@{RIM\_\-load}!latp.h@{latp.h}}
\subsubsection[RIM\_\-load]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-load (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a4}


Loads the LAT with the configuration held in {\em imm\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate from the LAT \item[{\em param}]Pointer passed through to the {\em load\-Reg\-Fn\/} \item[{\em load\-Fn}]Type ordered array of pointers to functions that load the LAT registers\end{description}
\end{Desc}
\hypertarget{latp_8h_a5}{
\index{latp.h@{latp.h}!RIM_loadCFE@{RIM\_\-loadCFE}}
\index{RIM_loadCFE@{RIM\_\-loadCFE}!latp.h@{latp.h}}
\subsubsection[RIM\_\-loadCFE]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-load\-CFE (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, unsigned {\em val}, unsigned {\em mask}, unsigned {\em shift}, unsigned {\em reg\-Id}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a5}


Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the {\em val\/} suitably masked and shifted. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the cached in-memory model of the LAT registers \item[{\em val}]Value to use in place of some part of one of the CFE registers \item[{\em mask}]Bit mask of the fields of the register being replaced \item[{\em shift}]Offset into the register of the LSB of the value \item[{\em reg\-Id}]The register ID (from LEM/defs.h) of the register being manipulated \item[{\em param}]Parameter passed through to the load function \item[{\em load\-Fn}]Type ordered array of pointers to functions that load the LAT registers\end{description}
\end{Desc}
\hypertarget{latp_8h_a6}{
\index{latp.h@{latp.h}!RIM_loadCFEmask@{RIM\_\-loadCFEmask}}
\index{RIM_loadCFEmask@{RIM\_\-loadCFEmask}!latp.h@{latp.h}}
\subsubsection[RIM\_\-loadCFEmask]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-load\-CFEmask (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, unsigned {\em mask}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a6}


Load one of the CFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the {\em val\/} suitably masked and shifted. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the cached in-memory model of the LAT registers \item[{\em mask}]CFEs to enable for calibration \item[{\em param}]Parameter passed through to the load function \item[{\em load\-Fn}]Type ordered array of pointers to functions that load the LAT registers \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if all goes well\end{description}
\end{Desc}
\hypertarget{latp_8h_a8}{
\index{latp.h@{latp.h}!RIM_loadTDC@{RIM\_\-loadTDC}}
\index{RIM_loadTDC@{RIM\_\-loadTDC}!latp.h@{latp.h}}
\subsubsection[RIM\_\-loadTDC]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-load\-TDC (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, unsigned {\em val}, unsigned {\em mask}, unsigned {\em shift}, unsigned {\em reg\-Id}, void $\ast$ {\em param}, \hyperlink{latp_8h_a1}{RIM\_\-load\-Fn} $\ast$$\ast$ {\em load\-Fn})}}
\label{latp_8h_a8}


Load one of the TFE registers with a modified version of the value from the LAT configuration, with some portion of the register replaced by the {\em val\/} suitably masked and shifted. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the in-memory model holding the LAT registers \item[{\em val}]Value to use in place of some part of one of the TFE registers \item[{\em mask}]Bit mask of the fields of the register being replaced \item[{\em shift}]Offset into the register of the LSB of the value \item[{\em reg\-Id}]The register ID (from LEM/defs.h) of the register being manipulated \item[{\em load\-Fn}]Type ordered array of pointers to functions that load the LAT registers \item[{\em param}]Parameter passed through to the load function\end{description}
\end{Desc}
\hypertarget{latp_8h_a3}{
\index{latp.h@{latp.h}!RIM_read@{RIM\_\-read}}
\index{RIM_read@{RIM\_\-read}!latp.h@{latp.h}}
\subsubsection[RIM\_\-read]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-read (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, void $\ast$ {\em param}, \hyperlink{latp_8h_a2}{RIM\_\-read\-Fn} $\ast$$\ast$ {\em read\-Fn}, \hyperlink{latp_8h_a0}{RIM\_\-decode\-Fn} $\ast$$\ast$ {\em decode\-Fn}, const \hyperlink{structRIM__map__}{RIM\_\-map} $\ast$ {\em ign})}}
\label{latp_8h_a3}


Populate the RIM structure with the current state of the LAT. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate from the LAT \item[{\em param}]Pointer passed through to the {\em read\-Reg\-Fn\/} \item[{\em read\-Fn}]Type ordered array of pointers to functions that read the LAT registers \item[{\em decode\-Fn}]Type ordered array of pointers to functions that decode the register responses \item[{\em ign}]Map of the sections of the LAT known to be bad or not present so can be ignored.\end{description}
\end{Desc}
\hypertarget{latp_8h_a7}{
\index{latp.h@{latp.h}!RIM_setSPT@{RIM\_\-setSPT}}
\index{RIM_setSPT@{RIM\_\-setSPT}!latp.h@{latp.h}}
\subsubsection[RIM\_\-setSPT]{\setlength{\rightskip}{0pt plus 5cm}void RIM\_\-set\-SPT (void $\ast$ {\em ptr}, unsigned short {\em value}, unsigned {\em is\-High})}}
\label{latp_8h_a7}


Decode the result item use to populate a split. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr}]Pointer to memory location to put decoded value \item[{\em value}]One of the split fields \item[{\em is\-High}]Indicates which of the split fields this is\end{description}
\end{Desc}
