\section{motion.c File Reference}
\label{motion_8c}\index{motion.c@{motion.c}}
{\tt \#include \char`\"{}motion.h\char`\"{}}\par
{\tt \#include \char`\"{}bppio.h\char`\"{}}\par
{\tt \#include \char`\"{}bppimpl.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf DBUGMESS}(N, PRINTARGS)
\item 
\#define {\bf DBUGPERR}(ERR, MESS)\ if (ERR) perror(MESS)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf showreg} (int {\bf fd})
\item 
int {\bf openstage} ({\bf ptraject} stage, const char $\ast$path)
\item 
int {\bf closestage} ({\bf ptraject} stage)
\item 
void {\bf disposestage} ({\bf ptraject} stage)
\item 
int {\bf movestage} ({\bf ptraject} stage, {\bf pmotion} motn)
\item 
int {\bf findstage} ({\bf ptraject} stage, {\bf pmotion} motn)
\item 
{\bf ptraject} {\bf newxystage} (void)
\item 
int {\bf moveto} ({\bf ptranslation} state, {\bf pmotion} goal)
\item 
int {\bf where} ({\bf ptranslation} state, {\bf pmotion} here)
\item 
int {\bf start} (int {\bf fd}, {\bf ptranslation} state, pthread\_\-attr\_\-t $\ast$ptattr)
\item 
int {\bf stop} ({\bf ptranslation} state)
\end{CompactItemize}


\subsection{Define Documentation}
\index{motion.c@{motion.c}!DBUGMESS@{DBUGMESS}}
\index{DBUGMESS@{DBUGMESS}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DBUGMESS(N, PRINTARGS)}\label{motion_8c_a0}




Definition at line 15 of file motion.c.

Referenced by closestage, findstage, movestage, moveto, openstage, start, stop, and where.\index{motion.c@{motion.c}!DBUGPERR@{DBUGPERR}}
\index{DBUGPERR@{DBUGPERR}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DBUGPERR(ERR, MESS)\ if (ERR) perror(MESS)}\label{motion_8c_a1}




Definition at line 16 of file motion.c.

\subsection{Function Documentation}
\index{motion.c@{motion.c}!closestage@{closestage}}
\index{closestage@{closestage}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int closestage ({\bf ptraject} {\em stage})}\label{motion_8c_a17}




Definition at line 84 of file motion.c.

References Traject::axis, DBUGMESS, err, Traject::filedescr, Traject::naxes, and stop.\index{motion.c@{motion.c}!disposestage@{disposestage}}
\index{disposestage@{disposestage}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void disposestage ({\bf ptraject} {\em stage})}\label{motion_8c_a18}




Definition at line 106 of file motion.c.

References Traject::axis, and Traject::tattr.\index{motion.c@{motion.c}!findstage@{findstage}}
\index{findstage@{findstage}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int findstage ({\bf ptraject} {\em stage}, {\bf pmotion} {\em motn})}\label{motion_8c_a20}




Definition at line 136 of file motion.c.

References Traject::axis, DBUGMESS, err, Translation::label, Traject::naxes, and where.\index{motion.c@{motion.c}!movestage@{movestage}}
\index{movestage@{movestage}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int movestage ({\bf ptraject} {\em stage}, {\bf pmotion} {\em motn})}\label{motion_8c_a19}




Definition at line 113 of file motion.c.

References Traject::axis, DBUGMESS, err, Translation::label, moveto, and Traject::naxes.\index{motion.c@{motion.c}!moveto@{moveto}}
\index{moveto@{moveto}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int moveto ({\bf ptranslation} {\em state}, {\bf pmotion} {\em goal})}\label{motion_8c_a22}




Definition at line 294 of file motion.c.

References Translation::attract, DBUGMESS, err, Translation::goalpos, Translation::goalvel, Translation::label, Translation::modlock, Translation::offtrack, Translation::ontrack, Translation::pos, Motion::pos, Motion::relative, Translation::scale, Translation::vel, and Motion::vel.\index{motion.c@{motion.c}!newxystage@{newxystage}}
\index{newxystage@{newxystage}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf ptraject} newxystage (void)}\label{motion_8c_a21}




Definition at line 159 of file motion.c.

References Traject::axis, Translation::backlash, err, Translation::goalpos, Translation::goalvel, Translation::label, malloc, Translation::maxlash, Traject::naxes, Translation::pos, Translation::step, Traject::tattr, and Translation::vel.

Referenced by Stage\-Motion\_\-Open\_\-Cmd.\index{motion.c@{motion.c}!openstage@{openstage}}
\index{openstage@{openstage}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int openstage ({\bf ptraject} {\em stage}, const char $\ast$ {\em path})}\label{motion_8c_a16}




Definition at line 61 of file motion.c.

References Traject::axis, DBUGMESS, err, Traject::filedescr, Traject::naxes, start, and Traject::tattr.\index{motion.c@{motion.c}!showreg@{showreg}}
\index{showreg@{showreg}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void showreg (int {\em fd})}\label{motion_8c_a15}




Definition at line 41 of file motion.c.

References BPPIOC\_\-GETREGS, bpp\_\-reg::data, bpp\_\-reg::dma\_\-addr, bpp\_\-reg::dma\_\-bcnt, bpp\_\-reg::dma\_\-csr, bpp\_\-reg::dma\_\-tst\_\-csr, err, fd, bpp\_\-reg::hw\_\-config, bpp\_\-reg::in\_\-pins, bpp\_\-reg::int\_\-cntl, bpp\_\-reg::op\_\-config, bpp\_\-reg::out\_\-pins, and bpp\_\-reg::trans\_\-cntl.\index{motion.c@{motion.c}!start@{start}}
\index{start@{start}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int start (int {\em fd}, {\bf ptranslation} {\em state}, pthread\_\-attr\_\-t $\ast$ {\em ptattr})}\label{motion_8c_a24}




Definition at line 441 of file motion.c.

References DBUGMESS, Translation::device, err, fd, Translation::label, Translation::modlock, Translation::offtrack, Translation::ontrack, and Translation::tid.\index{motion.c@{motion.c}!stop@{stop}}
\index{stop@{stop}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int stop ({\bf ptranslation} {\em state})}\label{motion_8c_a25}




Definition at line 475 of file motion.c.

References DBUGMESS, err, Translation::goalpos, Translation::goalvel, Translation::label, Translation::modlock, Translation::offtrack, Translation::ontrack, Translation::pos, Translation::tid, and Translation::vel.\index{motion.c@{motion.c}!where@{where}}
\index{where@{where}!motion.c@{motion.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int where ({\bf ptranslation} {\em state}, {\bf pmotion} {\em here})}\label{motion_8c_a23}




Definition at line 335 of file motion.c.

References DBUGMESS, err, Translation::goalpos, Translation::goalvel, Translation::label, Translation::modlock, Translation::ontrack, Motion::pos, Translation::pos, Motion::vel, and Translation::vel.