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

{\tt \#include $<$aversive.h$>$}\par
{\tt \#include \char`\"{}pwm.h\char`\"{}}\par
{\tt \#include $<$aversive/parts.h$>$}\par
{\tt \#include $<$aversive/timers.h$>$}\par
{\tt \#include $<$pwm\_\-config.h$>$}\par
{\tt \#include \char`\"{}timers\_\-synch.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf pwm0\_\-init\_\-ddr}()
\item 
\#define {\bf pwm0\_\-sign\_\-set}()
\item 
\#define {\bf pwm0\_\-sign\_\-reset}()
\item 
\#define {\bf pwm1A\_\-init\_\-ddr}()
\item 
\#define {\bf pwm1A\_\-sign\_\-set}()
\item 
\#define {\bf pwm1A\_\-sign\_\-reset}()
\item 
\#define {\bf pwm1B\_\-init\_\-ddr}()
\item 
\#define {\bf pwm1B\_\-sign\_\-set}()
\item 
\#define {\bf pwm1B\_\-sign\_\-reset}()
\item 
\#define {\bf pwm1C\_\-init\_\-ddr}()
\item 
\#define {\bf pwm1C\_\-sign\_\-set}()
\item 
\#define {\bf pwm1C\_\-sign\_\-reset}()
\item 
\#define {\bf pwm2\_\-init\_\-ddr}()
\item 
\#define {\bf pwm2\_\-sign\_\-set}()
\item 
\#define {\bf pwm2\_\-sign\_\-reset}()
\item 
\#define {\bf pwm3A\_\-init\_\-ddr}()
\item 
\#define {\bf pwm3A\_\-sign\_\-set}()
\item 
\#define {\bf pwm3A\_\-sign\_\-reset}()
\item 
\#define {\bf pwm3B\_\-init\_\-ddr}()
\item 
\#define {\bf pwm3B\_\-sign\_\-set}()
\item 
\#define {\bf pwm3B\_\-sign\_\-reset}()
\item 
\#define {\bf pwm3C\_\-init\_\-ddr}()
\item 
\#define {\bf pwm3C\_\-sign\_\-set}()
\item 
\#define {\bf pwm3C\_\-sign\_\-reset}()
\item 
\#define {\bf pwm\_\-invert\_\-value}(mode, value)
\item 
\#define {\bf pwm\_\-timer\_\-8bits\_\-init}(n, mode, prescale, timer\_\-mode)
\item 
\#define {\bf pwm\_\-timer\_\-16bits\_\-init}(n, m, mode, prescale, timer\_\-mode)
\item 
\#define {\bf pwm\_\-timer\_\-8bits\_\-set}(n, value, mode)
\item 
\#define {\bf pwm\_\-timer\_\-16bits\_\-set}(n, m, value, mode)
\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}
Implementation for the PWM module. 

\begin{Desc}
\item[{\bf Todo}]Test the module.\end{Desc}
\begin{Desc}
\item[{\bf Test}]The modul fonctions and had been tested by Lamygalle.\end{Desc}
This module provides functions for using a pwm 

Definition in file {\bf pwm.c}.

\subsection{Define Documentation}
\index{pwm.c@{pwm.c}!pwm0\_\-init\_\-ddr@{pwm0\_\-init\_\-ddr}}
\index{pwm0\_\-init\_\-ddr@{pwm0\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm0\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm0\_\-init\_\-ddr()}\label{pwm_8c_9d8a0935bb9e5e54ace0c0b82841ee48}




Definition at line 94 of file pwm.c.\index{pwm.c@{pwm.c}!pwm0\_\-sign\_\-reset@{pwm0\_\-sign\_\-reset}}
\index{pwm0\_\-sign\_\-reset@{pwm0\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm0\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm0\_\-sign\_\-reset()}\label{pwm_8c_0f39a82670b1e3b9ee577003de5aef70}




Definition at line 96 of file pwm.c.\index{pwm.c@{pwm.c}!pwm0\_\-sign\_\-set@{pwm0\_\-sign\_\-set}}
\index{pwm0\_\-sign\_\-set@{pwm0\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm0\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm0\_\-sign\_\-set()}\label{pwm_8c_3e9c3c1d8fe5c5d43f3ba3ac1ee0b8a3}




Definition at line 95 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1A\_\-init\_\-ddr@{pwm1A\_\-init\_\-ddr}}
\index{pwm1A\_\-init\_\-ddr@{pwm1A\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm1A\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1A\_\-init\_\-ddr()}\label{pwm_8c_38d7429b5ac6740c869dcdd3e8f1f5f4}




Definition at line 111 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1A\_\-sign\_\-reset@{pwm1A\_\-sign\_\-reset}}
\index{pwm1A\_\-sign\_\-reset@{pwm1A\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm1A\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1A\_\-sign\_\-reset()}\label{pwm_8c_8d23031ecf5ece4e49fcd994ca0b7aa5}




Definition at line 113 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1A\_\-sign\_\-set@{pwm1A\_\-sign\_\-set}}
\index{pwm1A\_\-sign\_\-set@{pwm1A\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm1A\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1A\_\-sign\_\-set()}\label{pwm_8c_9edca97c82b0a2a78bf60da1f93d0f4f}




Definition at line 112 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1B\_\-init\_\-ddr@{pwm1B\_\-init\_\-ddr}}
\index{pwm1B\_\-init\_\-ddr@{pwm1B\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm1B\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1B\_\-init\_\-ddr()}\label{pwm_8c_f68e4ab979cf2c268b348a13c128a0a0}




Definition at line 128 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1B\_\-sign\_\-reset@{pwm1B\_\-sign\_\-reset}}
\index{pwm1B\_\-sign\_\-reset@{pwm1B\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm1B\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1B\_\-sign\_\-reset()}\label{pwm_8c_9e1bcf8a9adf8af2dc5b9b8d0e407a35}




Definition at line 130 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1B\_\-sign\_\-set@{pwm1B\_\-sign\_\-set}}
\index{pwm1B\_\-sign\_\-set@{pwm1B\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm1B\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1B\_\-sign\_\-set()}\label{pwm_8c_b293b8925722827528b6dbe603e474f8}




Definition at line 129 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1C\_\-init\_\-ddr@{pwm1C\_\-init\_\-ddr}}
\index{pwm1C\_\-init\_\-ddr@{pwm1C\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm1C\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1C\_\-init\_\-ddr()}\label{pwm_8c_49262419aa8a93ca3df78c4e0ef0e7a2}




Definition at line 145 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1C\_\-sign\_\-reset@{pwm1C\_\-sign\_\-reset}}
\index{pwm1C\_\-sign\_\-reset@{pwm1C\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm1C\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1C\_\-sign\_\-reset()}\label{pwm_8c_8ac47966302c9c7fd90ad5794680e582}




Definition at line 147 of file pwm.c.\index{pwm.c@{pwm.c}!pwm1C\_\-sign\_\-set@{pwm1C\_\-sign\_\-set}}
\index{pwm1C\_\-sign\_\-set@{pwm1C\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm1C\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm1C\_\-sign\_\-set()}\label{pwm_8c_efd3e764a1ba76354d7dc9aaf8f5db72}




Definition at line 146 of file pwm.c.\index{pwm.c@{pwm.c}!pwm2\_\-init\_\-ddr@{pwm2\_\-init\_\-ddr}}
\index{pwm2\_\-init\_\-ddr@{pwm2\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm2\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm2\_\-init\_\-ddr()}\label{pwm_8c_70b21460ee366315a3e338728f6e7634}




Definition at line 162 of file pwm.c.\index{pwm.c@{pwm.c}!pwm2\_\-sign\_\-reset@{pwm2\_\-sign\_\-reset}}
\index{pwm2\_\-sign\_\-reset@{pwm2\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm2\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm2\_\-sign\_\-reset()}\label{pwm_8c_ab350591791aadfe79347f3ca70b7087}




Definition at line 164 of file pwm.c.\index{pwm.c@{pwm.c}!pwm2\_\-sign\_\-set@{pwm2\_\-sign\_\-set}}
\index{pwm2\_\-sign\_\-set@{pwm2\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm2\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm2\_\-sign\_\-set()}\label{pwm_8c_9b33fd247255345d07fdf8d94b47fd85}




Definition at line 163 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3A\_\-init\_\-ddr@{pwm3A\_\-init\_\-ddr}}
\index{pwm3A\_\-init\_\-ddr@{pwm3A\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm3A\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3A\_\-init\_\-ddr()}\label{pwm_8c_e84c4ae64a150ee6df0f91a3e32a2289}




Definition at line 179 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3A\_\-sign\_\-reset@{pwm3A\_\-sign\_\-reset}}
\index{pwm3A\_\-sign\_\-reset@{pwm3A\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm3A\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3A\_\-sign\_\-reset()}\label{pwm_8c_c121b3a63d8e1a2f7e24b5f639a80427}




Definition at line 181 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3A\_\-sign\_\-set@{pwm3A\_\-sign\_\-set}}
\index{pwm3A\_\-sign\_\-set@{pwm3A\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm3A\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3A\_\-sign\_\-set()}\label{pwm_8c_963400f2abdf088ebd1afe76966a2c7f}




Definition at line 180 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3B\_\-init\_\-ddr@{pwm3B\_\-init\_\-ddr}}
\index{pwm3B\_\-init\_\-ddr@{pwm3B\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm3B\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3B\_\-init\_\-ddr()}\label{pwm_8c_3566b47f8a5942496d741edc9f31e9a9}




Definition at line 196 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3B\_\-sign\_\-reset@{pwm3B\_\-sign\_\-reset}}
\index{pwm3B\_\-sign\_\-reset@{pwm3B\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm3B\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3B\_\-sign\_\-reset()}\label{pwm_8c_a8b4371576ebd1e79fc376e38bbebbb0}




Definition at line 198 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3B\_\-sign\_\-set@{pwm3B\_\-sign\_\-set}}
\index{pwm3B\_\-sign\_\-set@{pwm3B\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm3B\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3B\_\-sign\_\-set()}\label{pwm_8c_9d9dac2e5eec8b414ef4cb3179fe4797}




Definition at line 197 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3C\_\-init\_\-ddr@{pwm3C\_\-init\_\-ddr}}
\index{pwm3C\_\-init\_\-ddr@{pwm3C\_\-init\_\-ddr}!pwm.c@{pwm.c}}
\subsubsection[pwm3C\_\-init\_\-ddr]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3C\_\-init\_\-ddr()}\label{pwm_8c_da90fc9eaf91c825af27542beb318e15}




Definition at line 213 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3C\_\-sign\_\-reset@{pwm3C\_\-sign\_\-reset}}
\index{pwm3C\_\-sign\_\-reset@{pwm3C\_\-sign\_\-reset}!pwm.c@{pwm.c}}
\subsubsection[pwm3C\_\-sign\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3C\_\-sign\_\-reset()}\label{pwm_8c_8b2dcb3d273fdcc9596a85619f4c9a56}




Definition at line 215 of file pwm.c.\index{pwm.c@{pwm.c}!pwm3C\_\-sign\_\-set@{pwm3C\_\-sign\_\-set}}
\index{pwm3C\_\-sign\_\-set@{pwm3C\_\-sign\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm3C\_\-sign\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm3C\_\-sign\_\-set()}\label{pwm_8c_de3ed59ac13b4b77e1ec46edb8ad15bb}




Definition at line 214 of file pwm.c.\index{pwm.c@{pwm.c}!pwm\_\-invert\_\-value@{pwm\_\-invert\_\-value}}
\index{pwm\_\-invert\_\-value@{pwm\_\-invert\_\-value}!pwm.c@{pwm.c}}
\subsubsection[pwm\_\-invert\_\-value]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm\_\-invert\_\-value(mode, \/  value)}\label{pwm_8c_0ee842ef8f3f80057844cde431d01cdd}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                                                       \
        if ( mode & PWM_SPECIAL_SIGN_MODE ) {                              \
                value = value & PWM_MAX;                                   \
        }                                                                  \
        else {                                                             \
                value = -value;                                            \
        }                                                                  \
} while(0)
\end{verbatim}
\end{Code}


Definition at line 219 of file pwm.c.

Referenced by pwm\_\-ng\_\-set().\index{pwm.c@{pwm.c}!pwm\_\-timer\_\-16bits\_\-init@{pwm\_\-timer\_\-16bits\_\-init}}
\index{pwm\_\-timer\_\-16bits\_\-init@{pwm\_\-timer\_\-16bits\_\-init}!pwm.c@{pwm.c}}
\subsubsection[pwm\_\-timer\_\-16bits\_\-init]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm\_\-timer\_\-16bits\_\-init(n, \/  m, \/  mode, \/  prescale, \/  timer\_\-mode)}\label{pwm_8c_a2452ddf3d7694c468daed7c49b85fde}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                                                           \
        TCCR##n##A =   (TCCR##n##A |                                           \
                        ( ( timer_mode & 0x01 )?( 1 << WGM##n##0 ):0   )  |    \
                        ( ( timer_mode & 0x02 )?( 1 << WGM##n##1 ):0   )  )  ; \
                                                                               \
        TCCR##n##B =  ( ( ( timer_mode & 0x04 )?( 1 << WGM##n##2 ):0   )  |    \
                        ( ( timer_mode & 0x08 )?( 1 << WGM##n##3 ):0   )  |    \
                        ( ( prescale  << CS##n##0  )  )  );                    \
        if(mode & PWM_REVERSE) {                                               \
                TCCR##n##A = ( ( (TCCR##n##A) &                                \
                                 (~(0x03 << COM##n##m##0)) ) |                 \
                               (0x01  << COM##n##m##0) );                      \
        }                                                                      \
        else {                                                                 \
                TCCR##n##A = ( ( (TCCR##n##A) &                                \
                                 (~(0x03 << COM##n##m##0)) ) |                 \
                               (0x02  << COM##n##m##0) );                      \
        }                                                                      \
        OCR##n##m = 0;                                                         \
        sbi(OCR##n##m##_DDR,OCR##n##m##_BIT);                                  \
        pwm##n##m##_init_ddr();                                                \
} while(0)
\end{verbatim}
\end{Code}


Definition at line 251 of file pwm.c.\index{pwm.c@{pwm.c}!pwm\_\-timer\_\-16bits\_\-set@{pwm\_\-timer\_\-16bits\_\-set}}
\index{pwm\_\-timer\_\-16bits\_\-set@{pwm\_\-timer\_\-16bits\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm\_\-timer\_\-16bits\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm\_\-timer\_\-16bits\_\-set(n, \/  m, \/  value, \/  mode)}\label{pwm_8c_42e8d8e5db2c2b210cbea292d7ac2652}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                                                           \
        MAX(value, PWM_MAX);                                                   \
        if ( mode & PWM_SIGNED ) {                                             \
                MIN(value, PWM_MIN);                                           \
                if (value < 0) {                                               \
                        pwm##n##m##_sign_set();                                \
                        pwm_invert_value(mode, value);                         \
                }                                                              \
                else {                                                         \
                        pwm##n##m##_sign_reset();                              \
                }                                                              \
        }                                                                      \
        else {                                                                 \
                MIN(value, 0);                                                 \
        }                                                                      \
        OCR##n##m = ( value >> ( PWM_SIGNIFICANT_BITS                          \
                                 -  TIMER##n##_PWM_BITS )) ;                   \
} while(0)
\end{verbatim}
\end{Code}


Definition at line 300 of file pwm.c.\index{pwm.c@{pwm.c}!pwm\_\-timer\_\-8bits\_\-init@{pwm\_\-timer\_\-8bits\_\-init}}
\index{pwm\_\-timer\_\-8bits\_\-init@{pwm\_\-timer\_\-8bits\_\-init}!pwm.c@{pwm.c}}
\subsubsection[pwm\_\-timer\_\-8bits\_\-init]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm\_\-timer\_\-8bits\_\-init(n, \/  mode, \/  prescale, \/  timer\_\-mode)}\label{pwm_8c_6e8fb9c6edd6b5af922a3a9ef433d08b}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                                                           \
        TCCR##n  =  ( ( ( timer_mode & 0x01 )?( 1 << WGM##n##0 ):0   )  |      \
              ( ( timer_mode & 0x02 )?( 1 << WGM##n##1 ):0   )  |              \
                      ( ( prescale  << CS##n##0  ) ) );                        \
        if(mode & PWM_REVERSE) {                                               \
                TCCR##n = ( ( (TCCR##n) & (~(0x03 << COM##n##0)) ) |           \
                            (0x01  << COM##n##0) );                            \
        }                                                                      \
        else {                                                                 \
        TCCR##n = ( ( (TCCR##n) & (~(0x03 << COM##n##0)) ) |                   \
                    (0x02  << COM##n##0) );                                    \
        }                                                                      \
        OCR##n = 0x00;                                                         \
        sbi(OCR##n##_DDR,OCR##n##_BIT);                                        \
        pwm##n##_init_ddr();                                                   \
} while(0)
\end{verbatim}
\end{Code}


Definition at line 230 of file pwm.c.\index{pwm.c@{pwm.c}!pwm\_\-timer\_\-8bits\_\-set@{pwm\_\-timer\_\-8bits\_\-set}}
\index{pwm\_\-timer\_\-8bits\_\-set@{pwm\_\-timer\_\-8bits\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm\_\-timer\_\-8bits\_\-set]{\setlength{\rightskip}{0pt plus 5cm}\#define pwm\_\-timer\_\-8bits\_\-set(n, \/  value, \/  mode)}\label{pwm_8c_fb01b9eae76feb76e2f2eb19a122e401}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                                                           \
        MAX(value, PWM_MAX);                                                   \
        if ( mode & PWM_SIGNED ) {                                             \
                MIN(value, PWM_MIN);                                           \
                if (value < 0) {                                               \
                        pwm##n##_sign_set();                                   \
                        pwm_invert_value(mode, value);                         \
                }                                                              \
                else {                                                         \
                        pwm##n##_sign_reset();                                 \
                }                                                              \
        }                                                                      \
        else {                                                                 \
                MIN(value, 0);                                                 \
        }                                                                      \
        OCR##n =(uint8_t) ( value >> ( PWM_SIGNIFICANT_BITS - 8 ));            \
} while(0)
\end{verbatim}
\end{Code}


Definition at line 278 of file pwm.c.

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


global functions 

Definition at line 560 of file pwm.c.

Referenced by brushless\_\-init().\index{pwm.c@{pwm.c}!pwm\_\-set@{pwm\_\-set}}
\index{pwm\_\-set@{pwm\_\-set}!pwm.c@{pwm.c}}
\subsubsection[pwm\_\-set]{\setlength{\rightskip}{0pt plus 5cm}void pwm\_\-set (void $\ast$ {\em data}, \/  int32\_\-t {\em value})}\label{pwm_8c_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.