\hypertarget{VME_8h}{
\section{VME.h File Reference}
\label{VME_8h}\index{VME.h@{VME.h}}
}
VME Utilities, Interface. 


\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{VME_8h_a0}{VME\_\-probe} (volatile unsigned int $\ast$lcl\-Adr)
\begin{CompactList}\small\item\em Does a read probe of {\em lcl\-Adr}.\item\end{CompactList}\item 
int \hyperlink{VME_8h_a1}{VME\_\-vme\-Probe} (unsigned int vme\-Adr)
\begin{CompactList}\small\item\em Does a read probe of {\em vme\-Adr}.\item\end{CompactList}\item 
volatile unsigned int $\ast$ \hyperlink{VME_8h_a2}{VME\_\-vme\-To\-Local} (unsigned int vme\-Adr)
\begin{CompactList}\small\item\em Translates a vme address to its local address equivalent.\item\end{CompactList}\item 
unsigned int \hyperlink{VME_8h_a3}{VME\_\-vme\-Read} (unsigned int vme\-Adr)
\begin{CompactList}\small\item\em Reads the value at the specified VME location.\item\end{CompactList}\item 
unsigned int \hyperlink{VME_8h_a4}{VME\_\-vme\-Write} (unsigned int vme\-Adr, unsigned int val)
\begin{CompactList}\small\item\em Reads the value at the specified VME location.\item\end{CompactList}\item 
unsigned int \hyperlink{VME_8h_a5}{VME\_\-vme\-Set} (unsigned int vme\-Adr, unsigned int set)
\begin{CompactList}\small\item\em Sets the bits in {\em set}.\item\end{CompactList}\item 
unsigned int \hyperlink{VME_8h_a6}{VME\_\-vme\-Clr} (unsigned int vme\-Adr, unsigned int clr)
\begin{CompactList}\small\item\em Clears the bits in {\em clr}.\item\end{CompactList}\item 
unsigned int \hyperlink{VME_8h_a7}{VME\_\-vme\-Set\-And\-Clr} (unsigned int vme\-Adr, unsigned int set, unsigned int clr)
\begin{CompactList}\small\item\em Does a selective set and clear.\item\end{CompactList}\item 
unsigned int \hyperlink{VME_8h_a8}{VME\_\-vme\-RMW} (unsigned int vme\-Adr, unsigned int mask, unsigned int val)
\begin{CompactList}\small\item\em Performs a read/modify/write on the specified VME location.\item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
VME Utilities, Interface.



\begin{Desc}
\item[Author: ]\par
JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}
Very basic set of VME utilities. There is nothing fancy here, but using these routines provides at least the ability to link on the host, and in very simple cases, to run on the host.



\subsection{Function Documentation}
\hypertarget{VME_8h_a0}{
\index{VME.h@{VME.h}!VME_probe@{VME\_\-probe}}
\index{VME_probe@{VME\_\-probe}!VME.h@{VME.h}}
\subsubsection[VME\_\-probe]{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ VME\_\-probe (volatile unsigned int $\ast$ {\em lcl\-Adr})}}
\label{VME_8h_a0}


Does a read probe of {\em lcl\-Adr}.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
lcl\-Adr}]The local address representation of the VME address  to probe. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
0 if the address is valid, 1 if it is not.\end{Desc}
Does a read probe of the specified address on the VME bus. This function can be used as a map function of the VME crate. This routine works only on addresses with are 32 bit readable. \hypertarget{VME_8h_a6}{
\index{VME.h@{VME.h}!VME_vmeClr@{VME\_\-vmeClr}}
\index{VME_vmeClr@{VME\_\-vmeClr}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeClr]{\setlength{\rightskip}{0pt plus 5cm}unsigned int VME\_\-vme\-Clr (unsigned int {\em vme\-Adr}, unsigned int {\em clr})}}
\label{VME_8h_a6}


Clears the bits in {\em clr}.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to modify to.  \item[{\em 
set}]The bits to clear (the bits to be cleareed are set to 1). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The original value before it was modified.\end{Desc}
Clears the bits in the clears parameter. This, by its nature, involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion. \hypertarget{VME_8h_a1}{
\index{VME.h@{VME.h}!VME_vmeProbe@{VME\_\-vmeProbe}}
\index{VME_vmeProbe@{VME\_\-vmeProbe}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeProbe]{\setlength{\rightskip}{0pt plus 5cm}int VME\_\-vme\-Probe (unsigned int {\em vme\-Adr})}}
\label{VME_8h_a1}


Does a read probe of {\em vme\-Adr}.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to probe. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
0 if the address is valid, 1 if it is not.\end{Desc}
Does a read probe of the specified address on the VME bus. This function can be used as a map function of the VME crate. This routine works only on addresses with are 32 bit readable. \hypertarget{VME_8h_a3}{
\index{VME.h@{VME.h}!VME_vmeRead@{VME\_\-vmeRead}}
\index{VME_vmeRead@{VME\_\-vmeRead}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeRead]{\setlength{\rightskip}{0pt plus 5cm}unsigned int VME\_\-vme\-Read (unsigned int {\em vme\-Adr})}}
\label{VME_8h_a3}


Reads the value at the specified VME location.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to read. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The result of the read\end{Desc}
Reads the value at the specified VME location. The address is first translated to its local equivalent before the read is performed. \hypertarget{VME_8h_a8}{
\index{VME.h@{VME.h}!VME_vmeRMW@{VME\_\-vmeRMW}}
\index{VME_vmeRMW@{VME\_\-vmeRMW}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeRMW]{\setlength{\rightskip}{0pt plus 5cm}unsigned int VME\_\-vme\-RMW (unsigned int {\em vme\-Adr}, unsigned int {\em mask}, unsigned int {\em value})}}
\label{VME_8h_a8}


Performs a read/modify/write on the specified VME location.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to modify. \item[{\em 
mask}]A bit mask indicating which bits should be modified. \item[{\em 
clr}]Each bit that is set to a 1 will be set to a 0 in the output location. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The original value.\end{Desc}
Performs a read/modify/write on the specified VME location. This is one of the two common ways of specifying such an interface. See VME\_\-set\-And\-Clr for the other. Bits specified by 'mask' parameter are modified to those in the 'value' parameter.

By definition this involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion. \hypertarget{VME_8h_a5}{
\index{VME.h@{VME.h}!VME_vmeSet@{VME\_\-vmeSet}}
\index{VME_vmeSet@{VME\_\-vmeSet}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeSet]{\setlength{\rightskip}{0pt plus 5cm}unsigned int VME\_\-vme\-Set (unsigned int {\em vme\-Adr}, unsigned int {\em set})}}
\label{VME_8h_a5}


Sets the bits in {\em set}.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to modify to.  \item[{\em 
set}]The bits to set.  \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The original value before it was modified.\end{Desc}
Sets the bits in the set parameter. This, by its nature, involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion. \hypertarget{VME_8h_a7}{
\index{VME.h@{VME.h}!VME_vmeSetAndClr@{VME\_\-vmeSetAndClr}}
\index{VME_vmeSetAndClr@{VME\_\-vmeSetAndClr}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeSetAndClr]{\setlength{\rightskip}{0pt plus 5cm}unsigned int VME\_\-vme\-Set\-And\-Clr (unsigned int {\em vme\-Adr}, unsigned int {\em set}, unsigned int {\em clr})}}
\label{VME_8h_a7}


Does a selective set and clear.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to modify to.  \item[{\em 
set}]Each bit that is set to a 1 will be set to a 1 in the output location. \item[{\em 
clr}]Each bit that is set to a 1 will be set to a 0 in the output location. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The original value before it was modified.\end{Desc}
Does a selective set and clear. This is one of the two common ways of specifying such an interface. See VME\_\-rmw for the other. While more intuitive in some cases, this routine does suffer from an ambiguity when corresponding bits in both the the set and clear masks are selected.

The routine, by definition first sets the bits in the specified in the 'set' parameter, then clears the bits in the 'clr' parameter. This means that the when both are specified, the clear bit wins.

By definition this involves a read/modify/write operation. This routine does not perform this operation in an interlocked fashion. \hypertarget{VME_8h_a2}{
\index{VME.h@{VME.h}!VME_vmeToLocal@{VME\_\-vmeToLocal}}
\index{VME_vmeToLocal@{VME\_\-vmeToLocal}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeToLocal]{\setlength{\rightskip}{0pt plus 5cm}volatile unsigned int $\ast$ VME\_\-vme\-To\-Local (unsigned int {\em vme\-Adr})}}
\label{VME_8h_a2}


Translates a vme address to its local address equivalent.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to translate. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The translated address.\end{Desc}
If the translation fails, the routine bugchecks. \hypertarget{VME_8h_a4}{
\index{VME.h@{VME.h}!VME_vmeWrite@{VME\_\-vmeWrite}}
\index{VME_vmeWrite@{VME\_\-vmeWrite}!VME.h@{VME.h}}
\subsubsection[VME\_\-vmeWrite]{\setlength{\rightskip}{0pt plus 5cm}unsigned int VME\_\-vme\-Write (unsigned int {\em vme\-Adr}, unsigned int {\em value})}}
\label{VME_8h_a4}


Reads the value at the specified VME location.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
vme\-Adr}]The VME address to write to.  \item[{\em 
value}]The value to write. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The value which was written.\end{Desc}
Reads the value at the specified VME location. The address is first translated to its local equivalent before the read is performed. 