\section{aversive\_\-10-03-12/modules/devices/brushless\_\-motors/brushless\_\-3phase\_\-digital\_\-hall/brushless.h File Reference}
\label{brushless_8h}\index{aversive\_\-10-03-12/modules/devices/brushless\_\-motors/brushless\_\-3phase\_\-digital\_\-hall/brushless.h@{aversive\_\-10-03-12/modules/devices/brushless\_\-motors/brushless\_\-3phase\_\-digital\_\-hall/brushless.h}}
{\tt \#include $<$utils.h$>$}\par
{\tt \#include $<$brushless\_\-3phase\_\-digital\_\-hall\_\-config.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf brushless}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf brushless\_\-init} (void)
\item 
void {\bf brushless\_\-0\_\-set\_\-parameters} (brushless\_\-speed speed, brushless\_\-torque torque)
\item 
{\bf brushless} {\bf brushless\_\-0\_\-get\_\-mesures} (void)
\item 
void {\bf brushless\_\-0\_\-set\_\-position} (brushless\_\-position p)
\item 
void {\bf brushless\_\-0\_\-register\_\-periodic\_\-event} (void($\ast$f)({\bf brushless}))
\item 
int32\_\-t {\bf brushless\_\-get\_\-speed} (void $\ast$)
\item 
int32\_\-t {\bf brushless\_\-get\_\-pos} (void $\ast$)
\item 
void {\bf brushless\_\-set\_\-torque} (void $\ast$, int32\_\-t torque)
\item 
void {\bf brushless\_\-set\_\-speed} (void $\ast$, int32\_\-t speed)
\end{CompactItemize}


\subsection{Function Documentation}
\index{brushless.h@{brushless.h}!brushless\_\-0\_\-get\_\-mesures@{brushless\_\-0\_\-get\_\-mesures}}
\index{brushless\_\-0\_\-get\_\-mesures@{brushless\_\-0\_\-get\_\-mesures}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-0\_\-get\_\-mesures]{\setlength{\rightskip}{0pt plus 5cm}{\bf brushless} brushless\_\-0\_\-get\_\-mesures (void)}\label{brushless_8h_6b7453842da7738f63bdf673fab877e7}


calculates the speed update info. To be called externally only if not internally, ie if the BRUSHLESS\_\-MANAGE\_\-EXTERNAL is set get current speed and position This function is very useful to get synchronous speed and torque info 

Definition at line 475 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-0\_\-register\_\-periodic\_\-event@{brushless\_\-0\_\-register\_\-periodic\_\-event}}
\index{brushless\_\-0\_\-register\_\-periodic\_\-event@{brushless\_\-0\_\-register\_\-periodic\_\-event}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-0\_\-register\_\-periodic\_\-event]{\setlength{\rightskip}{0pt plus 5cm}void brushless\_\-0\_\-register\_\-periodic\_\-event (void($\ast$)({\bf brushless}) {\em f})}\label{brushless_8h_6f17e78b390032ca77bcc1915dd737d0}


registers an event function that triggers periodically, and synchronously with the speed measurement 

Definition at line 500 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-0\_\-set\_\-parameters@{brushless\_\-0\_\-set\_\-parameters}}
\index{brushless\_\-0\_\-set\_\-parameters@{brushless\_\-0\_\-set\_\-parameters}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-0\_\-set\_\-parameters]{\setlength{\rightskip}{0pt plus 5cm}void brushless\_\-0\_\-set\_\-parameters (brushless\_\-speed {\em speed}, \/  brushless\_\-torque {\em torque})}\label{brushless_8h_cc7d58938deec5e61bf770ed626e56f5}


sets a consign speed and torque if you do not use the speed coarse limitation, please configure with BRUSHLESS\_\-MAX\_\-SPEED 

Definition at line 438 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-0\_\-set\_\-position@{brushless\_\-0\_\-set\_\-position}}
\index{brushless\_\-0\_\-set\_\-position@{brushless\_\-0\_\-set\_\-position}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-0\_\-set\_\-position]{\setlength{\rightskip}{0pt plus 5cm}void brushless\_\-0\_\-set\_\-position (brushless\_\-position {\em p})}\label{brushless_8h_acc1256e5c10a361cc7b4fafe89b3df3}


sets the position counter 

Definition at line 489 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-get\_\-pos@{brushless\_\-get\_\-pos}}
\index{brushless\_\-get\_\-pos@{brushless\_\-get\_\-pos}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-get\_\-pos]{\setlength{\rightskip}{0pt plus 5cm}int32\_\-t brushless\_\-get\_\-pos (void $\ast$ {\em motor\_\-num})}\label{brushless_8h_1139da9b279d32981019b469b2d18969}


get position function, compatible with control\_\-system. argument is unused but should be 0 for compatibility

get position function, compatible with control\_\-system. Argument not used. 

Definition at line 524 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-get\_\-speed@{brushless\_\-get\_\-speed}}
\index{brushless\_\-get\_\-speed@{brushless\_\-get\_\-speed}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-get\_\-speed]{\setlength{\rightskip}{0pt plus 5cm}int32\_\-t brushless\_\-get\_\-speed (void $\ast$ {\em motor\_\-num})}\label{brushless_8h_f75eb45fe7c46235ba795e797e661cc4}


acess functions for the control system interface get speed function, compatible with control\_\-system. argument is unused but should be 0 for compatibility

acess functions for the control system interface get speed function, compatible with control\_\-system. Argument not used. 

Definition at line 514 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-init@{brushless\_\-init}}
\index{brushless\_\-init@{brushless\_\-init}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void brushless\_\-init (void)}\label{brushless_8h_5bcb47056126e1f5d75692599eafdf1f}


initialisation, also executes pwm\_\-init 

Definition at line 417 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-set\_\-speed@{brushless\_\-set\_\-speed}}
\index{brushless\_\-set\_\-speed@{brushless\_\-set\_\-speed}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-set\_\-speed]{\setlength{\rightskip}{0pt plus 5cm}void brushless\_\-set\_\-speed (void $\ast$ {\em motor\_\-num}, \/  int32\_\-t {\em speed})}\label{brushless_8h_30909f3244dfa44e947d7be786b089bc}


set speed function, compatible with control\_\-system. argument is unused but should be 0 for compatibility

set speed function, compatible with control\_\-system. first argument not used. 

Definition at line 540 of file brushless.c.\index{brushless.h@{brushless.h}!brushless\_\-set\_\-torque@{brushless\_\-set\_\-torque}}
\index{brushless\_\-set\_\-torque@{brushless\_\-set\_\-torque}!brushless.h@{brushless.h}}
\subsubsection[brushless\_\-set\_\-torque]{\setlength{\rightskip}{0pt plus 5cm}void brushless\_\-set\_\-torque (void $\ast$ {\em motor\_\-num}, \/  int32\_\-t {\em torque})}\label{brushless_8h_8d02023af51879add6e1ba3ce110714c}


set torque function, compatible with control\_\-system. argument is unused but should be 0 for compatibility

set torque function, compatible with control\_\-system. first argument not used. 

Definition at line 534 of file brushless.c.