\section{aversive\_\-10-03-12/modules/hardware/pwm/pwm.h File Reference}
\label{pwm_8h}\index{aversive\_\-10-03-12/modules/hardware/pwm/pwm.h@{aversive\_\-10-03-12/modules/hardware/pwm/pwm.h}}
Interface for the PWM module. 

{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$aversive/timers.h$>$}\par
{\tt \#include $<$aversive/parts.h$>$}\par
{\tt \#include $<$pwm\_\-config.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf PWM\_\-NORMAL}~0x00
\item 
\#define {\bf PWM\_\-REVERSE}~0x01
\item 
\#define {\bf PWM\_\-SIGN\_\-INVERTED}~0x02
\item 
\#define {\bf PWM\_\-SIGNED}~0x04
\item 
\#define {\bf PWM\_\-SPECIAL\_\-SIGN\_\-MODE}~0x08
\item 
\#define {\bf PWM\_\-MAX}~((1$<$$<$ PWM\_\-SIGNIFICANT\_\-BITS)-1)
\item 
\#define {\bf PWM\_\-MIN}~(-PWM\_\-MAX)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf pwm\_\-init} (void)
\item 
void {\bf pwm\_\-set} (void $\ast$data, int32\_\-t value)
\end{CompactItemize}


\subsection{Detailed Description}
Interface for the PWM module. 

\begin{Desc}
\item[{\bf Todo}]Test the module.\end{Desc}
\begin{Desc}
\item[{\bf Test}]No tests for the moment.\end{Desc}
This module provides functions for using a pwm 

Definition in file {\bf pwm.h}.

\subsection{Define Documentation}
\index{pwm.h@{pwm.h}!PWM\_\-MAX@{PWM\_\-MAX}}
\index{PWM\_\-MAX@{PWM\_\-MAX}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-MAX]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-MAX~((1$<$$<$ PWM\_\-SIGNIFICANT\_\-BITS)-1)}\label{pwm_8h_391fa1e490bd712720989b58fa0d9904}


value to be used for limiting inputs 

Definition at line 54 of file pwm.h.

Referenced by pwm\_\-ng\_\-set(), and SIGNAL().\index{pwm.h@{pwm.h}!PWM\_\-MIN@{PWM\_\-MIN}}
\index{PWM\_\-MIN@{PWM\_\-MIN}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-MIN]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-MIN~(-PWM\_\-MAX)}\label{pwm_8h_6a06d5e0af804c23442d316bd0b873d6}




Definition at line 55 of file pwm.h.

Referenced by pwm\_\-ng\_\-set().\index{pwm.h@{pwm.h}!PWM\_\-NORMAL@{PWM\_\-NORMAL}}
\index{PWM\_\-NORMAL@{PWM\_\-NORMAL}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-NORMAL]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-NORMAL~0x00}\label{pwm_8h_b84cc71b550329a3f24f808344418613}


PWM signs \& sign ligne inversion 

Definition at line 47 of file pwm.h.\index{pwm.h@{pwm.h}!PWM\_\-REVERSE@{PWM\_\-REVERSE}}
\index{PWM\_\-REVERSE@{PWM\_\-REVERSE}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-REVERSE]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-REVERSE~0x01}\label{pwm_8h_3eca8f5d40635f6a1d1d3837a4cf082f}




Definition at line 48 of file pwm.h.\index{pwm.h@{pwm.h}!PWM\_\-SIGN\_\-INVERTED@{PWM\_\-SIGN\_\-INVERTED}}
\index{PWM\_\-SIGN\_\-INVERTED@{PWM\_\-SIGN\_\-INVERTED}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-SIGN\_\-INVERTED]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-SIGN\_\-INVERTED~0x02}\label{pwm_8h_c9a09a03af09486aaf10919a2a5f7b3d}




Definition at line 49 of file pwm.h.\index{pwm.h@{pwm.h}!PWM\_\-SIGNED@{PWM\_\-SIGNED}}
\index{PWM\_\-SIGNED@{PWM\_\-SIGNED}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-SIGNED]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-SIGNED~0x04}\label{pwm_8h_71263c7659ddf077cd2f92e5e3ffc352}




Definition at line 50 of file pwm.h.\index{pwm.h@{pwm.h}!PWM\_\-SPECIAL\_\-SIGN\_\-MODE@{PWM\_\-SPECIAL\_\-SIGN\_\-MODE}}
\index{PWM\_\-SPECIAL\_\-SIGN\_\-MODE@{PWM\_\-SPECIAL\_\-SIGN\_\-MODE}!pwm.h@{pwm.h}}
\subsubsection[PWM\_\-SPECIAL\_\-SIGN\_\-MODE]{\setlength{\rightskip}{0pt plus 5cm}\#define PWM\_\-SPECIAL\_\-SIGN\_\-MODE~0x08}\label{pwm_8h_3d652296c5cadb192d1b200ab43e262f}




Definition at line 51 of file pwm.h.

\subsection{Function Documentation}
\index{pwm.h@{pwm.h}!pwm\_\-init@{pwm\_\-init}}
\index{pwm\_\-init@{pwm\_\-init}!pwm.h@{pwm.h}}
\subsubsection[pwm\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void pwm\_\-init (void)}\label{pwm_8h_1e8fdae3fd7118582ffa427dad05b6e1}


global functions 

Definition at line 560 of file pwm.c.

Referenced by brushless\_\-init().\index{pwm.h@{pwm.h}!pwm\_\-set@{pwm\_\-set}}
\index{pwm\_\-set@{pwm\_\-set}!pwm.h@{pwm.h}}
\subsubsection[pwm\_\-set]{\setlength{\rightskip}{0pt plus 5cm}void pwm\_\-set (void $\ast$ {\em data}, \/  int32\_\-t {\em value})}\label{pwm_8h_caa6adfac88f0a5ba0dacd0a4b808de0}


apply a PWM. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]is a pointer that is casted in (uint8\_\-t) to specify the number of the PWM. \item[{\em value}]is the value of the pwm. \end{description}
\end{Desc}


Definition at line 605 of file pwm.c.

References PWM0\_\-NUM, PWM1A\_\-NUM, PWM1B\_\-NUM, PWM1C\_\-NUM, PWM2\_\-NUM, PWM3A\_\-NUM, PWM3B\_\-NUM, PWM3C\_\-NUM, and S\_\-MAX.