\hypertarget{latc_8c}{
\section{latc.c File Reference}
\label{latc_8c}\index{latc.c@{latc.c}}
}
Provides the functionality associated with the principal LAT configuration interface along with the additional functions required by LPA and LCI.  


{\tt \#include \char`\"{}LATC/LATC\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}latc\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}enums\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}consume.h\char`\"{}}\par
{\tt \#include \char`\"{}data.h\char`\"{}}\par
{\tt \#include \char`\"{}record.h\char`\"{}}\par
{\tt \#include \char`\"{}latp\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-regEnums\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}number.ic\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/WCT.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}LEM/list.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{structLATC__controller}{LATC\_\-controller} $\ast$ \hyperlink{latc_8c_2370780dcc66e1b378bcd9da723ff68f}{LATC\_\-new} (void)
\begin{CompactList}\small\item\em Allocate a new controller. \item\end{CompactList}\item 
void \hyperlink{latc_8c_78aa03af70723489d27306f484066d30}{LATC\_\-delete} (\hyperlink{structLATC__controller}{LATC\_\-controller} $\ast$cnt)
\begin{CompactList}\small\item\em Release the previously allocated resources. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_172e1a33aea96860d3f98e1ef90b041a}{LATC\_\-initialise} (void)
\begin{CompactList}\small\item\em Allocate the resources required for LATC. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_56dbc5db38a7cb8ba56d58d5935d93d3}{LATC\_\-teardown} (void)
\begin{CompactList}\small\item\em Release the resources acquired by LATC\_\-initialise. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_500b5a5fd3f2c8e354e46327a94eb686}{LATC\_\-cache} (unsigned fid)
\begin{CompactList}\small\item\em Read a LATC configuration. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_3dc56d0b91a3318290d34df8cccd7693}{LATC\_\-configure} (\hyperlink{structs_8h_667571b247b36bbb714b64889dcb0d22}{LATC\_\-source} source, unsigned runId)
\begin{CompactList}\small\item\em Configure the LAT using the currently cached configuration. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_342b169b2cc3426caab1e07774f33a7a}{LATC\_\-verify} (\hyperlink{structs_8h_667571b247b36bbb714b64889dcb0d22}{LATC\_\-source} source, unsigned runId)
\begin{CompactList}\small\item\em Verify the captured configuration of the LAT matches the in-memory cache. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_e1782de170e8cbed266c60776d892492}{LATC\_\-capture} (void)
\begin{CompactList}\small\item\em Read the registers of the LAT. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_0f69dfb5b31a12015fda30e6128edb75}{LATC\_\-consign} (unsigned dst)
\begin{CompactList}\small\item\em Write out the captured data to file/SSR. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_5f53aa88f3455cc80a6ce99e13ff1b39}{LATC\_\-ignore} (unsigned fid)
\begin{CompactList}\small\item\em Read the LATC ignore map file. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_7ce9f2e6e681373db20e15e1da6352f0}{LATC\_\-getCacheKey} (void)
\begin{CompactList}\small\item\em Return the file key identifying the last cached configuration. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_95d0adb0b45fe5d08983c5f49052cab3}{LATC\_\-getConfigureKey} (void)
\begin{CompactList}\small\item\em Return the file key identifying the last configuration loaded. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_62ffba7f714cd3452a6441fe549e2f4e}{LATC\_\-getIgnoreKey} (void)
\begin{CompactList}\small\item\em Return the file key identifying the ignore map. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_46756819fcd3481e0f796f2478cd2076}{LATC\_\-loadAfeConfig} (unsigned int mask, unsigned int value0, unsigned int value1, unsigned int rcMask, unsigned int feMask)
\begin{CompactList}\small\item\em Load the AFE configuration register. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_1baa318669eb98725688c607037c4353}{LATC\_\-loadCfeConfig0} (unsigned int mask, unsigned int value)
\begin{CompactList}\small\item\em Load CFE configuration register 0. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_b99fee8a1d7c0b61ac25c00165d847e3}{LATC\_\-loadCfeConfig1} (unsigned int mask, unsigned int value0, unsigned int value1, unsigned int cMask)
\begin{CompactList}\small\item\em Load CFE configuration register 1. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_341512643cc7340e1a81d3061bb17df0}{LATC\_\-loadTkrSplits} (int nLow, int nHigh)
\begin{CompactList}\small\item\em Load TKR splits values. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_c08362b13870e5849899656703e1e477}{LATC\_\-loadTfeDac} (unsigned int mask, unsigned int value, int nLow, int nHigh)
\begin{CompactList}\small\item\em Load the TFE DAC register. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_b8bdb2fdfd0f9f3b0bbbd90f3d67b3cf}{LATC\_\-enableTriggers} (int marker)
\begin{CompactList}\small\item\em Enable triggers. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_871e76a829d33897a3b6f3bb0291dbc8}{LATC\_\-disableTriggers} (int marker)
\begin{CompactList}\small\item\em Disable triggers. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_05007779fa799d85ff40fb7f3fc0804d}{LATC\_\-getHskInfo} (\hyperlink{struct__LATC__hsk}{LATC\_\-hsk} $\ast$info)
\begin{CompactList}\small\item\em Get LATC housekeeping information. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_6d86435a6f7759cf48d8c12c32ebe230}{LATC\_\-sizeofHskInfo} (void)
\begin{CompactList}\small\item\em Get the size of the LATC housekeeping information. \item\end{CompactList}\item 
unsigned \hyperlink{latc_8c_70296974dd61221e4287f3d956e3b893}{LATC\_\-setDirty} (void)
\begin{CompactList}\small\item\em Set the LATC \char`\"{}dirty\char`\"{} flag. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{latc_8c_8dd3970fd298e63ffed23303a420ac9e}{
static \hyperlink{structLATC__controller}{LATC\_\-controller} $\ast$ \hyperlink{latc_8c_8dd3970fd298e63ffed23303a420ac9e}{latc}}
\label{latc_8c_8dd3970fd298e63ffed23303a420ac9e}

\begin{CompactList}\small\item\em Pointer to the global \hyperlink{structLATC__controller}{LATC\_\-controller} structure. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Provides the functionality associated with the principal LAT configuration interface along with the additional functions required by LPA and LCI. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{latc_8c}{latc.c},v 1.47 2007/08/26 21:28:05 saxton Exp \end{Desc}


\subsection{Function Documentation}
\hypertarget{latc_8c_500b5a5fd3f2c8e354e46327a94eb686}{
\index{latc.c@{latc.c}!LATC\_\-cache@{LATC\_\-cache}}
\index{LATC\_\-cache@{LATC\_\-cache}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-cache}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-cache (unsigned {\em fid})}}
\label{latc_8c_500b5a5fd3f2c8e354e46327a94eb686}


Read a LATC configuration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fid}]The file ID of the master configuration file.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LATC\_\-BADFOPEN}]if the fid, or any of the names the configuration master file contains, does not match a valid file. \item[{\em LATC\_\-BADTYPE}]if the file contains a bad type identifier \item[{\em LATC\_\-BADREAD}]if an error occurs while the file is being read \end{description}
\end{Desc}


References LATC\_\-controller::cache, LATC\_\-controller::cacheFid, and LATC\_\-controller::cacheKey.\hypertarget{latc_8c_e1782de170e8cbed266c60776d892492}{
\index{latc.c@{latc.c}!LATC\_\-capture@{LATC\_\-capture}}
\index{LATC\_\-capture@{LATC\_\-capture}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-capture}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-capture (void)}}
\label{latc_8c_e1782de170e8cbed266c60776d892492}


Read the registers of the LAT. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \item[{\em LEM\_\-$\ast$}]if there was an error arising from one of the read commands \end{description}
\end{Desc}


References LATC\_\-controller::cache, LATC\_\-controller::capture, checkBit(), LATC\_\-controller::cr, LATC\_\-controller::decode, LATC\_\-controller::ignore, and LATC\_\-read().\hypertarget{latc_8c_3dc56d0b91a3318290d34df8cccd7693}{
\index{latc.c@{latc.c}!LATC\_\-configure@{LATC\_\-configure}}
\index{LATC\_\-configure@{LATC\_\-configure}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-configure}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-configure ({\bf LATC\_\-source} {\em source}, \/  unsigned {\em runId})}}
\label{latc_8c_3dc56d0b91a3318290d34df8cccd7693}


Configure the LAT using the currently cached configuration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em source}]The identity of the caller (LPA, LCI, command)\item[{\em runId}]The ID of the run associated with an LPA or LCI source\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 are errors arising from the register load commands \end{description}
\end{Desc}


References \_\-LATC\_\-hsk::appConfig, \_\-LATC\_\-hsk::appRunId, \_\-LATC\_\-hsk::appSource, \_\-LATC\_\-hsk::appStatus, \_\-LATC\_\-hsk::appTimeSec, \_\-LATC\_\-hsk::appTimeSub, LATC\_\-controller::cache, LATC\_\-controller::cacheFid, LATC\_\-controller::cacheKey, LATC\_\-controller::configKey, LATC\_\-controller::cr, \_\-LATC\_\-hsk::dirty, LATC\_\-controller::hsk, and LATC\_\-load().\hypertarget{latc_8c_0f69dfb5b31a12015fda30e6128edb75}{
\index{latc.c@{latc.c}!LATC\_\-consign@{LATC\_\-consign}}
\index{LATC\_\-consign@{LATC\_\-consign}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-consign}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-consign (unsigned {\em dst})}}
\label{latc_8c_0f69dfb5b31a12015fda30e6128edb75}


Write out the captured data to file/SSR. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]Ignored\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well. \item[{\em LATC\_\-BADFOPEN}]if the file cannot be created \item[{\em LATC\_\-BADWRITE}]if the final write of the buffer failed \item[{\em LATC\_\-BADCLOSE}]if the file close failed \item[{\em LATC\_\-BADWRITE}]if either the map or the configuration data write has an error \end{description}
\end{Desc}


References LATC\_\-controller::capture, LATC\_\-controller::fpa, and LATC\_\-record().\hypertarget{latc_8c_78aa03af70723489d27306f484066d30}{
\index{latc.c@{latc.c}!LATC\_\-delete@{LATC\_\-delete}}
\index{LATC\_\-delete@{LATC\_\-delete}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-delete}]{\setlength{\rightskip}{0pt plus 5cm}void LATC\_\-delete ({\bf LATC\_\-controller} $\ast$ {\em cnt})}}
\label{latc_8c_78aa03af70723489d27306f484066d30}


Release the previously allocated resources. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cnt}]Pointer to the controller structure \end{description}
\end{Desc}


References LATC\_\-controller::buf, LATC\_\-controller::cache, LATC\_\-controller::capture, LATC\_\-controller::cr, LATC\_\-controller::decode, LATC\_\-controller::fpa, LATC\_\-controller::hsk, and LATC\_\-controller::ignore.

Referenced by LATC\_\-new(), and LATC\_\-teardown().\hypertarget{latc_8c_871e76a829d33897a3b6f3bb0291dbc8}{
\index{latc.c@{latc.c}!LATC\_\-disableTriggers@{LATC\_\-disableTriggers}}
\index{LATC\_\-disableTriggers@{LATC\_\-disableTriggers}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-disableTriggers}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-disableTriggers (int {\em marker})}}
\label{latc_8c_871e76a829d33897a3b6f3bb0291dbc8}


Disable triggers. 

The window open mask is cleared. If the marker parameter is non-zero, the LAT is first configured to broadcast a trigger message to CPUs upon receipt of a solicited trigger, a solicited trigger is fired, and the configuration restored from the LATC cache.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em marker}]If non-zero, causes a solicited trigger with this value in the event data.\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}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and setTrigger().\hypertarget{latc_8c_b8bdb2fdfd0f9f3b0bbbd90f3d67b3cf}{
\index{latc.c@{latc.c}!LATC\_\-enableTriggers@{LATC\_\-enableTriggers}}
\index{LATC\_\-enableTriggers@{LATC\_\-enableTriggers}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-enableTriggers}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-enableTriggers (int {\em marker})}}
\label{latc_8c_b8bdb2fdfd0f9f3b0bbbd90f3d67b3cf}


Enable triggers. 

The window open mask is loaded with the value held in the cache. If the marker parameter is non-zero, the LAT is first configured to broadcast a trigger message to CPUs upon receipt of a solicited trigger, a solicited trigger is fired, and the configuration restored from the LATC cache.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em marker}]If non-zero, causes a solicited trigger with this value in the event data.\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}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and setTrigger().\hypertarget{latc_8c_7ce9f2e6e681373db20e15e1da6352f0}{
\index{latc.c@{latc.c}!LATC\_\-getCacheKey@{LATC\_\-getCacheKey}}
\index{LATC\_\-getCacheKey@{LATC\_\-getCacheKey}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-getCacheKey}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-getCacheKey (void)}}
\label{latc_8c_7ce9f2e6e681373db20e15e1da6352f0}


Return the file key identifying the last cached configuration. 

\begin{Desc}
\item[Returns:]The file key for the LATC master file of the last cached configuration \end{Desc}


References LATC\_\-controller::cacheKey.\hypertarget{latc_8c_95d0adb0b45fe5d08983c5f49052cab3}{
\index{latc.c@{latc.c}!LATC\_\-getConfigureKey@{LATC\_\-getConfigureKey}}
\index{LATC\_\-getConfigureKey@{LATC\_\-getConfigureKey}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-getConfigureKey}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-getConfigureKey (void)}}
\label{latc_8c_95d0adb0b45fe5d08983c5f49052cab3}


Return the file key identifying the last configuration loaded. 

\begin{Desc}
\item[Returns:]The file key for the LATC master file of the last configuration loaded \end{Desc}


References LATC\_\-controller::configKey.\hypertarget{latc_8c_05007779fa799d85ff40fb7f3fc0804d}{
\index{latc.c@{latc.c}!LATC\_\-getHskInfo@{LATC\_\-getHskInfo}}
\index{LATC\_\-getHskInfo@{LATC\_\-getHskInfo}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-getHskInfo}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-getHskInfo ({\bf LATC\_\-hsk} $\ast$ {\em info})}}
\label{latc_8c_05007779fa799d85ff40fb7f3fc0804d}


Get LATC housekeeping information. 

LATC housekeeping information is copied to the supplied area.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em info}]The address of the area to receive the housekeeping information.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]Always success \end{description}
\end{Desc}


References LATC\_\-controller::hsk.\hypertarget{latc_8c_62ffba7f714cd3452a6441fe549e2f4e}{
\index{latc.c@{latc.c}!LATC\_\-getIgnoreKey@{LATC\_\-getIgnoreKey}}
\index{LATC\_\-getIgnoreKey@{LATC\_\-getIgnoreKey}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-getIgnoreKey}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-getIgnoreKey (void)}}
\label{latc_8c_62ffba7f714cd3452a6441fe549e2f4e}


Return the file key identifying the ignore map. 

\begin{Desc}
\item[Returns:]The file key for the ignore file \end{Desc}


References LATC\_\-controller::ignoreKey.\hypertarget{latc_8c_5f53aa88f3455cc80a6ce99e13ff1b39}{
\index{latc.c@{latc.c}!LATC\_\-ignore@{LATC\_\-ignore}}
\index{LATC\_\-ignore@{LATC\_\-ignore}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-ignore}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-ignore (unsigned {\em fid})}}
\label{latc_8c_5f53aa88f3455cc80a6ce99e13ff1b39}


Read the LATC ignore map file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fid}]ID of the file containing the map data to use as the ignore map\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]if all goes well \end{description}
\end{Desc}


References LATC\_\-controller::ignore, LATC\_\-controller::ignoreFid, and LATC\_\-controller::ignoreKey.\hypertarget{latc_8c_172e1a33aea96860d3f98e1ef90b041a}{
\index{latc.c@{latc.c}!LATC\_\-initialise@{LATC\_\-initialise}}
\index{LATC\_\-initialise@{LATC\_\-initialise}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-initialise}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-initialise (void)}}
\label{latc_8c_172e1a33aea96860d3f98e1ef90b041a}


Allocate the resources required for LATC. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]Success \item[{\em LATC\_\-BADALLOC}]If there was an error allocating memory \end{description}
\end{Desc}


References LATC\_\-new().\hypertarget{latc_8c_46756819fcd3481e0f796f2478cd2076}{
\index{latc.c@{latc.c}!LATC\_\-loadAfeConfig@{LATC\_\-loadAfeConfig}}
\index{LATC\_\-loadAfeConfig@{LATC\_\-loadAfeConfig}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-loadAfeConfig}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-loadAfeConfig (unsigned int {\em mask}, \/  unsigned int {\em value0}, \/  unsigned int {\em value1}, \/  unsigned int {\em rcMask}, \/  unsigned int {\em feMask})}}
\label{latc_8c_46756819fcd3481e0f796f2478cd2076}


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 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 rcMask}]Mask of bits, one per RC, specifying which RCs are selected.\item[{\em feMask}]Mask of bits, one per FE, specifying which FEs within selected RCs are selected.\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}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and loadAfeConfig().\hypertarget{latc_8c_1baa318669eb98725688c607037c4353}{
\index{latc.c@{latc.c}!LATC\_\-loadCfeConfig0@{LATC\_\-loadCfeConfig0}}
\index{LATC\_\-loadCfeConfig0@{LATC\_\-loadCfeConfig0}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-loadCfeConfig0}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-loadCfeConfig0 (unsigned int {\em mask}, \/  unsigned int {\em value})}}
\label{latc_8c_1baa318669eb98725688c607037c4353}


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 mask}]Mask of bits to be changed from the configuration.\item[{\em value}]The value to be masked and merged with the configuration value.\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}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and loadCfeConfig0().\hypertarget{latc_8c_b99fee8a1d7c0b61ac25c00165d847e3}{
\index{latc.c@{latc.c}!LATC\_\-loadCfeConfig1@{LATC\_\-loadCfeConfig1}}
\index{LATC\_\-loadCfeConfig1@{LATC\_\-loadCfeConfig1}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-loadCfeConfig1}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-loadCfeConfig1 (unsigned int {\em mask}, \/  unsigned int {\em value0}, \/  unsigned int {\em value1}, \/  unsigned int {\em cMask})}}
\label{latc_8c_b99fee8a1d7c0b61ac25c00165d847e3}


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 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 cMask}]Mask of bits, one per column, specifying which value is to be used for loading the config register.\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}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and loadCfeConfig1().\hypertarget{latc_8c_c08362b13870e5849899656703e1e477}{
\index{latc.c@{latc.c}!LATC\_\-loadTfeDac@{LATC\_\-loadTfeDac}}
\index{LATC\_\-loadTfeDac@{LATC\_\-loadTfeDac}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-loadTfeDac}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-loadTfeDac (unsigned int {\em mask}, \/  unsigned int {\em value}, \/  int {\em nLow}, \/  int {\em nHigh})}}
\label{latc_8c_c08362b13870e5849899656703e1e477}


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 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 nLow}]Number of TFEs talking on the low side, or -1 if the configured values are being used.\item[{\em nHigh}]Number of TFEs talking on the high side, or -1 if the configured values are being used.\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}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and loadTfeDac().\hypertarget{latc_8c_341512643cc7340e1a81d3061bb17df0}{
\index{latc.c@{latc.c}!LATC\_\-loadTkrSplits@{LATC\_\-loadTkrSplits}}
\index{LATC\_\-loadTkrSplits@{LATC\_\-loadTkrSplits}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-loadTkrSplits}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-loadTkrSplits (int {\em nLow}, \/  int {\em nHigh})}}
\label{latc_8c_341512643cc7340e1a81d3061bb17df0}


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 nLow}]Number of TFEs to talk on the low side, or -1 if the configured values are to be used.\item[{\em nHigh}]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 all goes well \item[{\em LEM\_\-$\ast$}]if there is an error arising from one of the register load commands \end{description}
\end{Desc}


References LATC\_\-controller::cache, LATC\_\-controller::cr, and loadTkrSplits().\hypertarget{latc_8c_2370780dcc66e1b378bcd9da723ff68f}{
\index{latc.c@{latc.c}!LATC\_\-new@{LATC\_\-new}}
\index{LATC\_\-new@{LATC\_\-new}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf LATC\_\-controller}$\ast$ LATC\_\-new (void)}}
\label{latc_8c_2370780dcc66e1b378bcd9da723ff68f}


Allocate a new controller. 

Allocate the resources required for the \hyperlink{structLATC__controller}{LATC\_\-controller} structure and initialise it

\begin{Desc}
\item[Returns:]Pointer to an allocated and initialised \hyperlink{structLATC__controller}{LATC\_\-controller} structure \end{Desc}


References LATC\_\-controller::buf, LATC\_\-controller::cache, LATC\_\-controller::capture, LATC\_\-controller::cr, LATC\_\-controller::decode, DECODE\_\-SIZE, LATC\_\-controller::fpa, LATC\_\-controller::hsk, LATC\_\-controller::ignore, and LATC\_\-delete().

Referenced by LATC\_\-initialise().\hypertarget{latc_8c_70296974dd61221e4287f3d956e3b893}{
\index{latc.c@{latc.c}!LATC\_\-setDirty@{LATC\_\-setDirty}}
\index{LATC\_\-setDirty@{LATC\_\-setDirty}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-setDirty}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-setDirty (void)}}
\label{latc_8c_70296974dd61221e4287f3d956e3b893}


Set the LATC \char`\"{}dirty\char`\"{} flag. 

This routine is used to indicate that a register whose value is normally managed by LATC has had its value changed externally, e.g. by LRA.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]Always success. \end{description}
\end{Desc}


References \_\-LATC\_\-hsk::dirty, and LATC\_\-controller::hsk.\hypertarget{latc_8c_6d86435a6f7759cf48d8c12c32ebe230}{
\index{latc.c@{latc.c}!LATC\_\-sizeofHskInfo@{LATC\_\-sizeofHskInfo}}
\index{LATC\_\-sizeofHskInfo@{LATC\_\-sizeofHskInfo}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-sizeofHskInfo}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-sizeofHskInfo (void)}}
\label{latc_8c_6d86435a6f7759cf48d8c12c32ebe230}


Get the size of the LATC housekeeping information. 

The size of the LATC housekeeping information block is returned.

\begin{Desc}
\item[Returns:]The size (in bytes) of the LATC housekeeping information. \end{Desc}
\hypertarget{latc_8c_56dbc5db38a7cb8ba56d58d5935d93d3}{
\index{latc.c@{latc.c}!LATC\_\-teardown@{LATC\_\-teardown}}
\index{LATC\_\-teardown@{LATC\_\-teardown}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-teardown}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-teardown (void)}}
\label{latc_8c_56dbc5db38a7cb8ba56d58d5935d93d3}


Release the resources acquired by LATC\_\-initialise. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]Always \end{description}
\end{Desc}


References LATC\_\-delete().\hypertarget{latc_8c_342b169b2cc3426caab1e07774f33a7a}{
\index{latc.c@{latc.c}!LATC\_\-verify@{LATC\_\-verify}}
\index{LATC\_\-verify@{LATC\_\-verify}!latc.c@{latc.c}}
\subsubsection[{LATC\_\-verify}]{\setlength{\rightskip}{0pt plus 5cm}unsigned LATC\_\-verify ({\bf LATC\_\-source} {\em source}, \/  unsigned {\em runId})}}
\label{latc_8c_342b169b2cc3426caab1e07774f33a7a}


Verify the captured configuration of the LAT matches the in-memory cache. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em source}]The identity of the caller (LPA, LCI, command)\item[{\em runId}]The ID of the run associated with an LPA or LCI source\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LATC\_\-SUCCESS}]If the current LAT state matches the cached \item[{\em LATC\_\-DIFFER}]If the current LAT state differs from the cached \end{description}
\end{Desc}


References \_\-LATC\_\-hsk::appConfig, LATC\_\-controller::cache, LATC\_\-controller::capture, LATC\_\-controller::hsk, LATC\_\-controller::ignore, LATC\_\-controller::ignoreFid, \_\-LATC\_\-hsk::verConfig, \_\-LATC\_\-hsk::verIgnore, \_\-LATC\_\-hsk::verRunId, \_\-LATC\_\-hsk::verSource, \_\-LATC\_\-hsk::verStatus, \_\-LATC\_\-hsk::verTimeSec, and \_\-LATC\_\-hsk::verTimeSub.