\section{aversive\_\-10-03-12/modules/devices/servo/multiservo/multiservo.c File Reference}
\label{multiservo_8c}\index{aversive\_\-10-03-12/modules/devices/servo/multiservo/multiservo.c@{aversive\_\-10-03-12/modules/devices/servo/multiservo/multiservo.c}}
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$aversive/error.h$>$}\par
{\tt \#include $<$multiservo.h$>$}\par
{\tt \#include $<$multiservo\_\-archs.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf MULTISERVO\_\-DEBUG}(args...)~do \{ \} while(0)
\item 
\#define {\bf TIME\_\-1MS}~(CONFIG\_\-QUARTZ/((1000UL)$\ast$MULTISERVO\_\-TIMER\_\-PRESCALER))
\item 
\#define {\bf TIME\_\-1\_\-5MS}~((TIME\_\-1MS$\ast$3)/2)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf SIGNAL} (MULTISERVO\_\-SIG\_\-OUTPUT\_\-COMPARE)
\item 
void {\bf multiservo\_\-init} (void)
\item 
int8\_\-t {\bf multiservo\_\-add} (volatile uint8\_\-t $\ast$port, uint8\_\-t bitnum)
\item 
void {\bf multiservo\_\-del} (int8\_\-t id)
\item 
void {\bf multiservo\_\-set} (int8\_\-t id, uint16\_\-t val\_\-us)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
struct {\bf multiservo} {\bf g\_\-multiservo}
\end{CompactItemize}


\subsection{Define Documentation}
\index{multiservo.c@{multiservo.c}!MULTISERVO\_\-DEBUG@{MULTISERVO\_\-DEBUG}}
\index{MULTISERVO\_\-DEBUG@{MULTISERVO\_\-DEBUG}!multiservo.c@{multiservo.c}}
\subsubsection[MULTISERVO\_\-DEBUG]{\setlength{\rightskip}{0pt plus 5cm}\#define MULTISERVO\_\-DEBUG(args...)~do \{ \} while(0)}\label{multiservo_8c_a124527d63d4919203eae6756d56ea65}




Definition at line 36 of file multiservo.c.

Referenced by SIGNAL().\index{multiservo.c@{multiservo.c}!TIME\_\-1\_\-5MS@{TIME\_\-1\_\-5MS}}
\index{TIME\_\-1\_\-5MS@{TIME\_\-1\_\-5MS}!multiservo.c@{multiservo.c}}
\subsubsection[TIME\_\-1\_\-5MS]{\setlength{\rightskip}{0pt plus 5cm}\#define TIME\_\-1\_\-5MS~((TIME\_\-1MS$\ast$3)/2)}\label{multiservo_8c_d5d328d8eeacb024f2f52099a2ebf6ee}




Definition at line 41 of file multiservo.c.

Referenced by multiservo\_\-add().\index{multiservo.c@{multiservo.c}!TIME\_\-1MS@{TIME\_\-1MS}}
\index{TIME\_\-1MS@{TIME\_\-1MS}!multiservo.c@{multiservo.c}}
\subsubsection[TIME\_\-1MS]{\setlength{\rightskip}{0pt plus 5cm}\#define TIME\_\-1MS~(CONFIG\_\-QUARTZ/((1000UL)$\ast$MULTISERVO\_\-TIMER\_\-PRESCALER))}\label{multiservo_8c_d6445469b3084b0c8a8ea272e8a40a17}




Definition at line 40 of file multiservo.c.

Referenced by multiservo\_\-init(), multiservo\_\-set(), and SIGNAL().

\subsection{Function Documentation}
\index{multiservo.c@{multiservo.c}!multiservo\_\-add@{multiservo\_\-add}}
\index{multiservo\_\-add@{multiservo\_\-add}!multiservo.c@{multiservo.c}}
\subsubsection[multiservo\_\-add]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t multiservo\_\-add (volatile uint8\_\-t $\ast$ {\em port}, \/  uint8\_\-t {\em bitnum})}\label{multiservo_8c_a8985574b2cf6377a21e505d1e178e10}




Definition at line 127 of file multiservo.c.

References multiservo\_\-element::bitnum, DDR, multiservo::elts, g\_\-multiservo, i, IRQ\_\-LOCK, IRQ\_\-UNLOCK, multiservo\_\-element::port, sbi, TIME\_\-1\_\-5MS, and multiservo\_\-element::value.\index{multiservo.c@{multiservo.c}!multiservo\_\-del@{multiservo\_\-del}}
\index{multiservo\_\-del@{multiservo\_\-del}!multiservo.c@{multiservo.c}}
\subsubsection[multiservo\_\-del]{\setlength{\rightskip}{0pt plus 5cm}void multiservo\_\-del (int8\_\-t {\em id})}\label{multiservo_8c_932982054f7e0691216e1cee7d611fb8}




Definition at line 155 of file multiservo.c.

References multiservo\_\-element::bitnum, cbi, DDR, multiservo::elts, g\_\-multiservo, IRQ\_\-LOCK, IRQ\_\-UNLOCK, and multiservo\_\-element::port.\index{multiservo.c@{multiservo.c}!multiservo\_\-init@{multiservo\_\-init}}
\index{multiservo\_\-init@{multiservo\_\-init}!multiservo.c@{multiservo.c}}
\subsubsection[multiservo\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void multiservo\_\-init (void)}\label{multiservo_8c_8dced8e5cf529880c1b59875b54dcafd}




Definition at line 104 of file multiservo.c.

References cbi, g\_\-multiservo, multiservo::id\_\-prev, IRQ\_\-LOCK, IRQ\_\-UNLOCK, sbi, and TIME\_\-1MS.\index{multiservo.c@{multiservo.c}!multiservo\_\-set@{multiservo\_\-set}}
\index{multiservo\_\-set@{multiservo\_\-set}!multiservo.c@{multiservo.c}}
\subsubsection[multiservo\_\-set]{\setlength{\rightskip}{0pt plus 5cm}void multiservo\_\-set (int8\_\-t {\em id}, \/  uint16\_\-t {\em val\_\-us})}\label{multiservo_8c_649d90011b855c0c07ce055944eb0b66}


Set \doxyref{multiservo}{p.}{structmultiservo} angle. Specify value in us. WARNING : should be (much) bigger than 0 

Definition at line 170 of file multiservo.c.

References multiservo::elts, g\_\-multiservo, IRQ\_\-LOCK, IRQ\_\-UNLOCK, TIME\_\-1MS, and multiservo\_\-element::value.\index{multiservo.c@{multiservo.c}!SIGNAL@{SIGNAL}}
\index{SIGNAL@{SIGNAL}!multiservo.c@{multiservo.c}}
\subsubsection[SIGNAL]{\setlength{\rightskip}{0pt plus 5cm}SIGNAL (MULTISERVO\_\-SIG\_\-OUTPUT\_\-COMPARE)}\label{multiservo_8c_370fa19a6d49091c993012652da5585e}




Definition at line 55 of file multiservo.c.

References multiservo\_\-element::bitnum, cbi, multiservo::current\_\-multiservo, E\_\-MULTISERVO, multiservo::elts, g\_\-multiservo, multiservo::id\_\-prev, MULTISERVO\_\-DEBUG, multiservo\_\-element::port, sbi, TIME\_\-1MS, multiservo::time\_\-sum, and multiservo\_\-element::value.

\subsection{Variable Documentation}
\index{multiservo.c@{multiservo.c}!g\_\-multiservo@{g\_\-multiservo}}
\index{g\_\-multiservo@{g\_\-multiservo}!multiservo.c@{multiservo.c}}
\subsubsection[g\_\-multiservo]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf multiservo} {\bf g\_\-multiservo}}\label{multiservo_8c_a7adacfe07d0e5a0af2e4764c8eaad95}




Definition at line 29 of file multiservo.c.

Referenced by multiservo\_\-add(), multiservo\_\-del(), multiservo\_\-init(), multiservo\_\-set(), and SIGNAL().