\hypertarget{latp_8c}{
\section{latp.c File Reference}
\label{latp_8c}\index{latp.c@{latp.c}}
}
LATp operations. 

{\tt \#include \char`\"{}LATC/LATC\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}latp\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}data.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-descriptions\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-lem\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-addr\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-fld\-Enums\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-reg\-Enums\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}number.ic\char`\"{}}\par
{\tt \#include \char`\"{}LEM/msg\_\-macros.h\char`\"{}}\par
{\tt \#include \char`\"{}LEM/list.h\char`\"{}}\par
{\tt \#include \char`\"{}LEM/decode.h\char`\"{}}\par


Include dependency graph for latp.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=249pt]{latp_8c__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{latp_8c_a0}{
\#define {\bf NELEM}(x)~(sizeof x / sizeof x\mbox{[}0\mbox{]})}
\label{latp_8c_a0}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned \hyperlink{latp_8c_a1}{traverse\-Read} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, unsigned $\ast$index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned depth, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Traverse the LAT reading the configuration for all nodes. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a2}{traverse\-Load} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type, unsigned $\ast$index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned depth)
\begin{CompactList}\small\item\em Traverse the LAT reading the configuration for all nodes. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a3}{load\-Reg} (\hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned reg, unsigned short $\ast$ptr)
\begin{CompactList}\small\item\em Load a single register. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a4}{read\-Reg} (\hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, unsigned reg, void $\ast$dst)
\begin{CompactList}\small\item\em Read a single register. \item\end{CompactList}\item 
static void \hyperlink{latp_8c_a5}{handle\-Read\-Errors} (unsigned error, unsigned index, void $\ast$ptr)
\begin{CompactList}\small\item\em Read error callback routine for LATC. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a6}{load\-Simple} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type)
\begin{CompactList}\small\item\em Load a generic LAT component. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a7}{load\-Split} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, int n\-Low, int n\-High)
\begin{CompactList}\small\item\em Load the layer splits. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a8}{load\-Layer\-Split} (\hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr, short low, short high)
\begin{CompactList}\small\item\em Load the splits for a single layer. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a9}{load\-Tracker} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type)
\begin{CompactList}\small\item\em Load the tracker front ends from the configuration tree. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a10}{load\-Cpt} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$lem\_\-l, LATC\_\-type type, unsigned index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr)
\begin{CompactList}\small\item\em Set all the registers of the target component. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a11}{read\-Simple} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current configuration for a register type. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a12}{read\-Split} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current layer splits from the TRC TFE\_\-CNT settings. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a13}{read\-Tracker} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current TFE settings. \item\end{CompactList}\item 
static unsigned \hyperlink{latp_8c_a14}{read\-Cpt} (LATC\_\-imm $\ast$imm, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$lem\_\-r, LATC\_\-type type, unsigned index, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$addr)
\begin{CompactList}\small\item\em Read all the registers of the current component. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a15}{LATC\_\-read} (LATC\_\-imm $\ast$imm, LEM\_\-micr $\ast$cr, \hyperlink{structLATC__di}{LATC\_\-di} $\ast$di, const LATC\_\-map $\ast$ign)
\begin{CompactList}\small\item\em Read the current configuration of the LAT. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a16}{LATC\_\-load} (LATC\_\-imm $\ast$imm, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load the LAT with the configuration held in {\em imm\/}. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a17}{load\-Afe\-Config} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value0, unsigned int value1, unsigned int rc\-Mask, unsigned int fe\-Mask, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load the AFE configuration register. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a18}{load\-Cfe\-Config0} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load CFE configuration register 0. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a19}{load\-Cfe\-Config1} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value0, unsigned int value1, unsigned int c\-Mask, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load CFE configuration register 1. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a20}{load\-Tkr\-Splits} (LATC\_\-imm $\ast$imm, int n\-Low, int n\-High, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load TKR splits values. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a21}{load\-Tfe\-Dac} (LATC\_\-imm $\ast$imm, unsigned int mask, unsigned int value, int n\-Low, int n\-High, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Load the TFE DAC register. \item\end{CompactList}\item 
unsigned \hyperlink{latp_8c_a22}{set\-Trigger} (LATC\_\-imm $\ast$imm, int enable, int marker, LEM\_\-micr $\ast$cr)
\begin{CompactList}\small\item\em Enable or disable triggers. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
LATp operations. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{latp_8c}{latp.c},v 1.40 2008/10/24 19:10:13 saxton Exp \end{Desc}


\subsection{Function Documentation}
\hypertarget{latp_8c_a5}{
\index{latp.c@{latp.c}!handleReadErrors@{handleReadErrors}}
\index{handleReadErrors@{handleReadErrors}!latp.c@{latp.c}}
\subsubsection[handleReadErrors]{\setlength{\rightskip}{0pt plus 5cm}void handle\-Read\-Errors (unsigned {\em error}, unsigned {\em index}, void $\ast$ {\em ptr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a5}


Read error callback routine for LATC. 

This routine clears the bit in the LATC\_\-map corresponding to the register that failed to read

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em error}]Error field from a result item\item[{\em index}]Index of the command the failed\item[{\em ptr}]Pointer to the array of \hyperlink{structLATC__di}{LATC\_\-di}\end{description}
\end{Desc}
\hypertarget{latp_8c_a16}{
\index{latp.c@{latp.c}!LATC_load@{LATC\_\-load}}
\index{LATC_load@{LATC\_\-load}!latp.c@{latp.c}}
\subsubsection[LATC\_\-load]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-load (LATC\_\-imm $\ast$ {\em imm}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a16}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]The IMM structure to use as the basis for the load commands sent to the LAT\item[{\em cr}]Pointer to structure holding multi-item command and response lists (plus some state information)\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a15}{
\index{latp.c@{latp.c}!LATC_read@{LATC\_\-read}}
\index{LATC_read@{LATC\_\-read}!latp.c@{latp.c}}
\subsubsection[LATC\_\-read]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-read (LATC\_\-imm $\ast$ {\em imm}, LEM\_\-micr $\ast$ {\em cr}, \hyperlink{structLATC__di}{LATC\_\-di} $\ast$ {\em di}, const LATC\_\-map $\ast$ {\em ign})}}
\label{latp_8c_a15}


Read the current configuration of the LAT. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the IMM structure to populate from the LAT\item[{\em cr}]Pointer to structure holding multi-item command and response lists (plus some state information)\item[{\em di}]Array of lem\_\-max\_\-ci latc\_\-di objects that capture read errors from the corresponding command items\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}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds. \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the c/r list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM.\end{itemize}
\end{description}
\end{Desc}
\hypertarget{latp_8c_a17}{
\index{latp.c@{latp.c}!loadAfeConfig@{loadAfeConfig}}
\index{loadAfeConfig@{loadAfeConfig}!latp.c@{latp.c}}
\subsubsection[loadAfeConfig]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Afe\-Config (LATC\_\-imm $\ast$ {\em imm}, unsigned int {\em mask}, unsigned int {\em value0}, unsigned int {\em value1}, unsigned int {\em rc\-Mask}, unsigned int {\em fe\-Mask}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a17}


Load the AFE configuration register. 

The AFE configuration register is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value0}]The value to be masked and merged with the configuration value for front-ends not selected by the RC and FE masks.\item[{\em value1}]The value to be masked and merged with the configuration value for front-ends selected by the RC and FE masks.\item[{\em rc\-Mask}]Mask of bits, one per RC, specifying which RCs are selected.\item[{\em fe\-Mask}]Mask of bits, one per FE, specifying which FEs within selected RCs are selected.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a18}{
\index{latp.c@{latp.c}!loadCfeConfig0@{loadCfeConfig0}}
\index{loadCfeConfig0@{loadCfeConfig0}!latp.c@{latp.c}}
\subsubsection[loadCfeConfig0]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Cfe\-Config0 (LATC\_\-imm $\ast$ {\em imm}, unsigned int {\em mask}, unsigned int {\em value}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a18}


Load CFE configuration register 0. 

CFE configuration register 0 is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value}]The value to be masked and merged with the configuration value.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a19}{
\index{latp.c@{latp.c}!loadCfeConfig1@{loadCfeConfig1}}
\index{loadCfeConfig1@{loadCfeConfig1}!latp.c@{latp.c}}
\subsubsection[loadCfeConfig1]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Cfe\-Config1 (LATC\_\-imm $\ast$ {\em imm}, unsigned int {\em mask}, unsigned int {\em value0}, unsigned int {\em value1}, unsigned int {\em c\-Mask}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a19}


Load CFE configuration register 1. 

CFE configuration register 1 is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value0}]The value to be masked and merged with the configuration value for front-ends whose bit is clear in the column mask.\item[{\em value1}]The value to be masked and merged with the configuration value for front-ends whose bit is set in the column mask.\item[{\em c\-Mask}]Mask of bits, one per column, specifying which value is to be used for loading the config register.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a10}{
\index{latp.c@{latp.c}!loadCpt@{loadCpt}}
\index{loadCpt@{loadCpt}!latp.c@{latp.c}}
\subsubsection[loadCpt]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Cpt (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, LATC\_\-type {\em type}, unsigned {\em index}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a10}


Set all the registers of the target component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command/response lists to use for loading the LAT\item[{\em type}]Component type\item[{\em index}]Componenet instance being loaded\item[{\em addr}]Hierarchical representation of the index (address of the instance)\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a8}{
\index{latp.c@{latp.c}!loadLayerSplit@{loadLayerSplit}}
\index{loadLayerSplit@{loadLayerSplit}!latp.c@{latp.c}}
\subsubsection[loadLayerSplit]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Layer\-Split (\hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr}, short {\em low}, short {\em high})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a8}


Load the splits for a single layer. 

This routine loads the mode registers on all the TFEs in the layer and sets the split values in the CSRs of the two TRCs in the layer.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lem\_\-l}]Pointer to the command and response lists used for loading the LAT\item[{\em addr}]Pointer to an address structure used for loading the TFEs and TRC\item[{\em low}]ID of the highest low talking TFE\item[{\em high}]ID of the lowest high talking TFE\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a3}{
\index{latp.c@{latp.c}!loadReg@{loadReg}}
\index{loadReg@{loadReg}!latp.c@{latp.c}}
\subsubsection[loadReg]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Reg (\hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr}, unsigned {\em reg}, unsigned short $\ast$ {\em ptr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a3}


Load a single register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lem\_\-l}]Pointer to the command/response lists to use for register loads\item[{\em addr}]Pointer to a \hyperlink{unionLATC__addr}{LATC\_\-addr} address structure\item[{\em reg}]Register index\item[{\em ptr}]Pointer to data to be loaded\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a6}{
\index{latp.c@{latp.c}!loadSimple@{loadSimple}}
\index{loadSimple@{loadSimple}!latp.c@{latp.c}}
\subsubsection[loadSimple]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Simple (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, LATC\_\-type {\em type})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a6}


Load a generic LAT component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to command and response lists used for loading the LAT\item[{\em type}]Type of LAT component to load\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a7}{
\index{latp.c@{latp.c}!loadSplit@{loadSplit}}
\index{loadSplit@{loadSplit}!latp.c@{latp.c}}
\subsubsection[loadSplit]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Split (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, int {\em n\-Low}, int {\em n\-High})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a7}


Load the layer splits. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command response lists used for loading the LAT\item[{\em n\-Low}]Number of TFEs to talk on the low side, or -1 if the configured values are to be used.\item[{\em n\-High}]Number of TFEs to talk on the high side, or -1 if the configured values are to be used.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a21}{
\index{latp.c@{latp.c}!loadTfeDac@{loadTfeDac}}
\index{loadTfeDac@{loadTfeDac}!latp.c@{latp.c}}
\subsubsection[loadTfeDac]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Tfe\-Dac (LATC\_\-imm $\ast$ {\em imm}, unsigned int {\em mask}, unsigned int {\em value}, int {\em n\-Low}, int {\em n\-High}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a21}


Load the TFE DAC register. 

The TFE DAC register is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em mask}]Mask of bits to be changed from the configuration.\item[{\em value}]The value to be masked and merged with the configuration value.\item[{\em n\-Low}]Number of TFEs talking on the low side, or -1 if the configured values are being used.\item[{\em n\-High}]Number of TFEs talking on the high side, or -1 if the configured values are being used.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a20}{
\index{latp.c@{latp.c}!loadTkrSplits@{loadTkrSplits}}
\index{loadTkrSplits@{loadTkrSplits}!latp.c@{latp.c}}
\subsubsection[loadTkrSplits]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Tkr\-Splits (LATC\_\-imm $\ast$ {\em imm}, int {\em n\-Low}, int {\em n\-High}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a20}


Load TKR splits values. 

The tracker RC and FE registers are loaded to reflect the given split values.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the cached in-memory model of the LATC registers\item[{\em n\-Low}]Number of TFEs to talk on the low side, or -1 if the configured values are to be used.\item[{\em n\-High}]Number of TFEs to talk on the high side, or -1 if the configured values are to be used.\item[{\em cr}]Multi-item command-response list used to load the modified registers\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a9}{
\index{latp.c@{latp.c}!loadTracker@{loadTracker}}
\index{loadTracker@{loadTracker}!latp.c@{latp.c}}
\subsubsection[loadTracker]{\setlength{\rightskip}{0pt plus 5cm}unsigned load\-Tracker (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, LATC\_\-type {\em type})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a9}


Load the tracker front ends from the configuration tree. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command/response lists used for loading the LAT\item[{\em type}]Type of component being loaded, either TFE or TDC\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a14}{
\index{latp.c@{latp.c}!readCpt@{readCpt}}
\index{readCpt@{readCpt}!latp.c@{latp.c}}
\subsubsection[readCpt]{\setlength{\rightskip}{0pt plus 5cm}unsigned read\-Cpt (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$ {\em lem\_\-r}, LATC\_\-type {\em type}, unsigned {\em index}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a14}


Read all the registers of the current component. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Command/response lists to use for the read\item[{\em type}]Cpt type being read\item[{\em index}]Instance of the component being read\item[{\em addr}]Hierarchical representation of the index (address of the instance to read).\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM.\end{itemize}
\end{description}
\end{Desc}
\hypertarget{latp_8c_a4}{
\index{latp.c@{latp.c}!readReg@{readReg}}
\index{readReg@{readReg}!latp.c@{latp.c}}
\subsubsection[readReg]{\setlength{\rightskip}{0pt plus 5cm}unsigned read\-Reg (\hyperlink{structLEM__read}{LEM\_\-read} $\ast$ {\em lem\_\-r}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr}, unsigned {\em reg}, void $\ast$ {\em dst})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a4}


Read a single register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lem\_\-r}]Pointer to command/response lists for reading the LAT registers\item[{\em addr}]Hierarchical identification of the instance to read\item[{\em reg}]Identification of the register to read\item[{\em dst}]Location to place value read from register\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM.\end{itemize}
\end{description}
\end{Desc}
\hypertarget{latp_8c_a11}{
\index{latp.c@{latp.c}!readSimple@{readSimple}}
\index{readSimple@{readSimple}!latp.c@{latp.c}}
\subsubsection[readSimple]{\setlength{\rightskip}{0pt plus 5cm}unsigned read\-Simple (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$ {\em lem\_\-r}, LATC\_\-type {\em type}, const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a11}


Read the current configuration for a register type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure being populated by the read operation\item[{\em lem\_\-r}]Pointer to the command/response lists and other structures used to read the LAT\item[{\em type}]Component type to read\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}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM\end{itemize}
\end{description}
\end{Desc}
\hypertarget{latp_8c_a12}{
\index{latp.c@{latp.c}!readSplit@{readSplit}}
\index{readSplit@{readSplit}!latp.c@{latp.c}}
\subsubsection[readSplit]{\setlength{\rightskip}{0pt plus 5cm}unsigned read\-Split (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$ {\em lem\_\-r}, const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a12}


Read the current layer splits from the TRC TFE\_\-CNT settings. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Pointer to the command response lists\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}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM.\end{itemize}
\end{description}
\end{Desc}
\hypertarget{latp_8c_a13}{
\index{latp.c@{latp.c}!readTracker@{readTracker}}
\index{readTracker@{readTracker}!latp.c@{latp.c}}
\subsubsection[readTracker]{\setlength{\rightskip}{0pt plus 5cm}unsigned read\-Tracker (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$ {\em lem\_\-r}, LATC\_\-type {\em type}, const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a13}


Read the current TFE settings. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Pointer to the command/response lists used for reading the LAT\item[{\em type}]Component type being read (either TFE or TDC)\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}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM.\end{itemize}
\end{description}
\end{Desc}
\hypertarget{latp_8c_a22}{
\index{latp.c@{latp.c}!setTrigger@{setTrigger}}
\index{setTrigger@{setTrigger}!latp.c@{latp.c}}
\subsubsection[setTrigger]{\setlength{\rightskip}{0pt plus 5cm}unsigned set\-Trigger (LATC\_\-imm $\ast$ {\em imm}, int {\em enable}, int {\em marker}, LEM\_\-micr $\ast$ {\em cr})}}
\label{latp_8c_a22}


Enable or disable triggers. 

This routine enables or disables LAT triggers. If the marker parameter is non-zero, the LAT is first configured to broadcast a trigger message to all CPUs upon receipt of a solicited trigger, a solicited trigger is issued, and the configuration restored from the IMM data.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing LAT configuration data\item[{\em enable}]If non-zero, triggers are anabled; otherwise disabled\item[{\em marker}]If non-zero, causes a solicited trigger with this value in the event data.\item[{\em cr}]Pointer to the multi-item command/response list.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a2}{
\index{latp.c@{latp.c}!traverseLoad@{traverseLoad}}
\index{traverseLoad@{traverseLoad}!latp.c@{latp.c}}
\subsubsection[traverseLoad]{\setlength{\rightskip}{0pt plus 5cm}unsigned traverse\-Load (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__load}{LEM\_\-load} $\ast$ {\em lem\_\-l}, LATC\_\-type {\em type}, unsigned $\ast$ {\em index}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr}, unsigned {\em depth})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a2}


Traverse the LAT reading the configuration for all nodes. 

This routine loads the configuration for any instances of the current component whose configuration differs from the default

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]IMM structure containing the values to load onto the LAT\item[{\em lem\_\-l}]Pointer to the command response lists used for loading the LAT\item[{\em type}]Type of component to load\item[{\em index}]Pointer to the index of the next instance to load\item[{\em addr}]Hierarchical representation of the index\item[{\em depth}]Number of recursive calls to traverse\_\-Load\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the LAT is loaded successfully \item[{\em LEM\_\-$\ast$}]If there is an error arising from one of the load commands\end{description}
\end{Desc}
\hypertarget{latp_8c_a1}{
\index{latp.c@{latp.c}!traverseRead@{traverseRead}}
\index{traverseRead@{traverseRead}!latp.c@{latp.c}}
\subsubsection[traverseRead]{\setlength{\rightskip}{0pt plus 5cm}unsigned traverse\-Read (LATC\_\-imm $\ast$ {\em imm}, \hyperlink{structLEM__read}{LEM\_\-read} $\ast$ {\em lem\_\-r}, LATC\_\-type {\em type}, unsigned $\ast$ {\em index}, \hyperlink{unionLATC__addr}{LATC\_\-addr} $\ast$ {\em addr}, unsigned {\em depth}, const LATC\_\-map $\ast$ {\em ign})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{latp_8c_a1}


Traverse the LAT reading the configuration for all nodes. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em imm}]Pointer to the structure to populate from the LAT register values\item[{\em lem\_\-r}]Pointer to the command/response lists used for reading the LAT\item[{\em type}]The type of component to read\item[{\em index}]Pointer to a variable tracking the current instance being read\item[{\em addr}]Pointer to an address structure containing the same information as index, but in heirarchical form\item[{\em depth}]Number of times this function has been recursively called.\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}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If all goes well - note that individual register reads may fail but the operation as a whole still succeeds \item[{\em LEM\_\-$\ast$}]An error concerning the queuing of the C/R list\begin{itemize}
\item individual read command failures are noted in the map associated with the IMM.\end{itemize}
\end{description}
\end{Desc}
