import ChibiOS 2.0.8

This commit is contained in:
NIIBE Yutaka
2010-11-30 13:54:43 +09:00
parent 27543cfeca
commit c560d0ad0c
1982 changed files with 5318 additions and 4046 deletions

View File

@@ -1,5 +1,20 @@
2010-11-30 NIIBE Yutaka <gniibe@fsij.org>
Import changes of ChibiOS_2.0.8.
* ChibiOS_2.0.8/os/hal/include/pwm.h
* ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.c
* ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.h
* ChibiOS_2.0.8/os/hal/src/pwm.c
* ChibiOS_2.0.8/os/hal/templates/pwm_lld.c
* ChibiOS_2.0.8/os/hal/templates/pwm_lld.h
* ChibiOS_2.0.8/os/kernel/include/ch.h
* ChibiOS_2.0.8/os/kernel/src/chevents.c
* ChibiOS_2.0.8/os/kernel/src/chthreads.c
* ChibiOS_2.0.8/boards/OLIMEX_LPC_P2148/board.h
* ChibiOS_2.0.8/readme.txt
* ChibiOS_2.0.8/test/testdyn.c
* ChibiOS_2.0.8/docs/*
New private key management.
* src/ac.c (ac_reset_pso_cds, ac_reset_pso_other): Call
gpg_do_clear_prvkey.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,452 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: PWM Driver</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>PWM Driver<br/>
<small>
[<a class="el" href="group___i_o.html">HAL</a>]</small>
</h1> </div>
</div>
<div class="contents">
<p>Generic PWM Driver.
<a href="#_details">More...</a></p>
<p><div class="dynheader">
Collaboration diagram for PWM Driver:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group___p_w_m.png" border="0" alt="" usemap="#group______p__w__m"/>
<map name="group______p__w__m" id="group______p__w__m">
<area shape="rect" id="node1" href="group___i_o.html" title="Hardware Abstraction Layer." alt="" coords="5,5,48,32"/>
<area shape="rect" id="node3" href="group___p_w_m___l_l_d.html" title="PWM Driver low level driver template." alt="" coords="225,5,356,32"/>
</map>
</td></tr></table></center>
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<p>Generic PWM Driver. </p>
<p>This module implements a generic PWM driver. The driver implements a state machine internally: </p>
<div align="center">
<img src="inline_dotgraph_18.dot.png" alt="inline_dotgraph_18.dot" border="0" usemap="#inline_dotgraph_18.dot.map">
<map name="inline_dotgraph_18.dot.map" id="inline_dotgraph_18.dot.map"></map>
</div>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m___l_l_d.html">PWM Low Level Driver</a></td></tr>
<p><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p><a class="el" href="group___p_w_m.html">PWM Driver</a> low level driver template. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#gabcc836c83fc710d8caa9d61f79f69962">pwmcallback_t</a> )(void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM notification callback type. <a href="#gabcc836c83fc710d8caa9d61f79f69962"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5">pwmstate_t</a> { <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5abff5b42e5ab002433b66a8910548b48c">PWM_UNINIT</a> = 0,
<a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a4da638211112ff017325e9472592a151">PWM_STOP</a> = 1,
<a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086">PWM_READY</a> = 2
}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>Driver state machine possible states. </p>
<a href="group___p_w_m.html#ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#gaaa2db6a7be396595dcf16da3f94634a0">pwmmode_t</a> { <a class="el" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0a36ed95007c3ef01cab4254f099e57b4d">PWM_OUTPUT_DISABLED</a> = 0,
<a class="el" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1">PWM_OUTPUT_ACTIVE_HIGH</a> = 1,
<a class="el" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba">PWM_OUTPUT_ACTIVE_LOW</a> = 2
}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>PWM logic mode. </p>
<a href="group___p_w_m.html#gaaa2db6a7be396595dcf16da3f94634a0">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#ga1c8ae46921c4ae7d57bd44dd994e10bd">pwmInit</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM Driver initialization. <a href="#ga1c8ae46921c4ae7d57bd44dd994e10bd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#ga4dbf1fded2984ff6dc240afd2e1fcd74">pwmObjectInit</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes the standard part of a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> structure. <a href="#ga4dbf1fded2984ff6dc240afd2e1fcd74"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#ga9c14dc1b026c78809440281786aceda3">pwmStart</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp, const <a class="el" href="struct_p_w_m_config.html">PWMConfig</a> *config)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configures and activates the PWM peripheral. <a href="#ga9c14dc1b026c78809440281786aceda3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#ga8a4d0d8a47883efe286a332cade14080">pwmStop</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deactivates the PWM peripheral. <a href="#ga8a4d0d8a47883efe286a332cade14080"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#gafd6c45693467da77ab13edca8420620d">pwmEnableChannel</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp, <a class="el" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a> channel, <a class="el" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61">pwmcnt_t</a> width)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables a PWM channel. <a href="#gafd6c45693467da77ab13edca8420620d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m.html#gac2679d11833a4ea9df5a9ed2e4a2c2e7">pwmDisableChannel</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp, <a class="el" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a> channel)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disables a PWM channel. <a href="#gac2679d11833a4ea9df5a9ed2e4a2c2e7"></a><br/></td></tr>
</table>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gabcc836c83fc710d8caa9d61f79f69962"></a><!-- doxytag: member="pwm.h::pwmcallback_t" ref="gabcc836c83fc710d8caa9d61f79f69962" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group___p_w_m.html#gabcc836c83fc710d8caa9d61f79f69962">pwmcallback_t</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PWM notification callback type. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>active</em>&nbsp;</td><td>current channel output state </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8h_source.html#l00080">80</a> of file <a class="el" href="pwm_8h_source.html">pwm.h</a>.</p>
</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5"></a><!-- doxytag: member="pwm.h::pwmstate_t" ref="ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group___p_w_m.html#ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5">pwmstate_t</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Driver state machine possible states. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5abff5b42e5ab002433b66a8910548b48c"></a><!-- doxytag: member="PWM_UNINIT" ref="gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5abff5b42e5ab002433b66a8910548b48c" args="" -->PWM_UNINIT</em>&nbsp;</td><td>
<p>Not initialized. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a4da638211112ff017325e9472592a151"></a><!-- doxytag: member="PWM_STOP" ref="gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a4da638211112ff017325e9472592a151" args="" -->PWM_STOP</em>&nbsp;</td><td>
<p>Stopped. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086"></a><!-- doxytag: member="PWM_READY" ref="gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086" args="" -->PWM_READY</em>&nbsp;</td><td>
<p>Ready. </p>
</td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8h_source.html#l00059">59</a> of file <a class="el" href="pwm_8h_source.html">pwm.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaaa2db6a7be396595dcf16da3f94634a0"></a><!-- doxytag: member="pwm.h::pwmmode_t" ref="gaaa2db6a7be396595dcf16da3f94634a0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group___p_w_m.html#gaaa2db6a7be396595dcf16da3f94634a0">pwmmode_t</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PWM logic mode. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="ggaaa2db6a7be396595dcf16da3f94634a0a36ed95007c3ef01cab4254f099e57b4d"></a><!-- doxytag: member="PWM_OUTPUT_DISABLED" ref="ggaaa2db6a7be396595dcf16da3f94634a0a36ed95007c3ef01cab4254f099e57b4d" args="" -->PWM_OUTPUT_DISABLED</em>&nbsp;</td><td>
<p>Output not driven, callback only. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1"></a><!-- doxytag: member="PWM_OUTPUT_ACTIVE_HIGH" ref="ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1" args="" -->PWM_OUTPUT_ACTIVE_HIGH</em>&nbsp;</td><td>
<p>Idle is logic level 0. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba"></a><!-- doxytag: member="PWM_OUTPUT_ACTIVE_LOW" ref="ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba" args="" -->PWM_OUTPUT_ACTIVE_LOW</em>&nbsp;</td><td>
<p>Idle is logic level 1. </p>
</td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8h_source.html#l00068">68</a> of file <a class="el" href="pwm_8h_source.html">pwm.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga1c8ae46921c4ae7d57bd44dd994e10bd"></a><!-- doxytag: member="pwm.h::pwmInit" ref="ga1c8ae46921c4ae7d57bd44dd994e10bd" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void pwmInit </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PWM Driver initialization. </p>
<p>Definition at line <a class="el" href="pwm_8c_source.html#l00058">58</a> of file <a class="el" href="pwm_8c_source.html">pwm.c</a>.</p>
<p>References <a class="el" href="group___p_w_m___l_l_d.html#ga7cb5729a65c0996584808e4f93b28a0d">pwm_lld_init()</a>.</p>
<p>Referenced by <a class="el" href="group___h_a_l.html#gafd89c1650df524d95aef39b8bc38170d">halInit()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___p_w_m_ga1c8ae46921c4ae7d57bd44dd994e10bd_cgraph.png" border="0" usemap="#group___p_w_m_ga1c8ae46921c4ae7d57bd44dd994e10bd_cgraph" alt=""/></div>
<map name="group___p_w_m_ga1c8ae46921c4ae7d57bd44dd994e10bd_cgraph" id="group___p_w_m_ga1c8ae46921c4ae7d57bd44dd994e10bd_cgraph">
<area shape="rect" id="node3" href="group___p_w_m___l_l_d.html#ga7cb5729a65c0996584808e4f93b28a0d" title="Low level PWM driver initialization." alt="" coords="113,5,193,32"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga4dbf1fded2984ff6dc240afd2e1fcd74"></a><!-- doxytag: member="pwm.h::pwmObjectInit" ref="ga4dbf1fded2984ff6dc240afd2e1fcd74" args="(PWMDriver *pwmp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void pwmObjectInit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *&nbsp;</td>
<td class="paramname"> <em>pwmp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes the standard part of a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> structure. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pwmp</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8c_source.html#l00068">68</a> of file <a class="el" href="pwm_8c_source.html">pwm.c</a>.</p>
<p>References <a class="el" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8">PWMDriver::pd_config</a>, and <a class="el" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea">PWMDriver::pd_state</a>.</p>
</div>
</div>
<a class="anchor" id="ga9c14dc1b026c78809440281786aceda3"></a><!-- doxytag: member="pwm.h::pwmStart" ref="ga9c14dc1b026c78809440281786aceda3" args="(PWMDriver *pwmp, const PWMConfig *config)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void pwmStart </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *&nbsp;</td>
<td class="paramname"> <em>pwmp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="struct_p_w_m_config.html">PWMConfig</a> *&nbsp;</td>
<td class="paramname"> <em>config</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Configures and activates the PWM peripheral. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pwmp</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>config</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_p_w_m_config.html" title="Driver configuration structure.">PWMConfig</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8c_source.html#l00080">80</a> of file <a class="el" href="pwm_8c_source.html">pwm.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8">PWMDriver::pd_config</a>, <a class="el" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea">PWMDriver::pd_state</a>, <a class="el" href="group___p_w_m___l_l_d.html#ga8a4d803d25a5326b48b3713ffd5fce53">pwm_lld_start()</a>, <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086">PWM_READY</a>, and <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a4da638211112ff017325e9472592a151">PWM_STOP</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___p_w_m_ga9c14dc1b026c78809440281786aceda3_cgraph.png" border="0" usemap="#group___p_w_m_ga9c14dc1b026c78809440281786aceda3_cgraph" alt=""/></div>
<map name="group___p_w_m_ga9c14dc1b026c78809440281786aceda3_cgraph" id="group___p_w_m_ga9c14dc1b026c78809440281786aceda3_cgraph">
<area shape="rect" id="node3" href="group___p_w_m___l_l_d.html#ga8a4d803d25a5326b48b3713ffd5fce53" title="Configures and activates the PWM peripheral." alt="" coords="123,5,213,32"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga8a4d0d8a47883efe286a332cade14080"></a><!-- doxytag: member="pwm.h::pwmStop" ref="ga8a4d0d8a47883efe286a332cade14080" args="(PWMDriver *pwmp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void pwmStop </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *&nbsp;</td>
<td class="paramname"> <em>pwmp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deactivates the PWM peripheral. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pwmp</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8c_source.html#l00099">99</a> of file <a class="el" href="pwm_8c_source.html">pwm.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea">PWMDriver::pd_state</a>, <a class="el" href="group___p_w_m___l_l_d.html#ga48b759363af69a6aaee37a362ed5bfd2">pwm_lld_stop()</a>, <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086">PWM_READY</a>, and <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a4da638211112ff017325e9472592a151">PWM_STOP</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___p_w_m_ga8a4d0d8a47883efe286a332cade14080_cgraph.png" border="0" usemap="#group___p_w_m_ga8a4d0d8a47883efe286a332cade14080_cgraph" alt=""/></div>
<map name="group___p_w_m_ga8a4d0d8a47883efe286a332cade14080_cgraph" id="group___p_w_m_ga8a4d0d8a47883efe286a332cade14080_cgraph">
<area shape="rect" id="node3" href="group___p_w_m___l_l_d.html#ga48b759363af69a6aaee37a362ed5bfd2" title="Deactivates the PWM peripheral." alt="" coords="124,5,212,32"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gafd6c45693467da77ab13edca8420620d"></a><!-- doxytag: member="pwm.h::pwmEnableChannel" ref="gafd6c45693467da77ab13edca8420620d" args="(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void pwmEnableChannel </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *&nbsp;</td>
<td class="paramname"> <em>pwmp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a>&nbsp;</td>
<td class="paramname"> <em>channel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61">pwmcnt_t</a>&nbsp;</td>
<td class="paramname"> <em>width</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enables a PWM channel. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pwmp</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>channel</em>&nbsp;</td><td>PWM channel identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>width</em>&nbsp;</td><td>PWM pulse width as clock pulses number </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8c_source.html#l00119">119</a> of file <a class="el" href="pwm_8c_source.html">pwm.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea">PWMDriver::pd_state</a>, <a class="el" href="group___p_w_m___l_l_d.html#ga312588cf680d50931666643dea45bb13">PWM_CHANNELS</a>, <a class="el" href="group___p_w_m___l_l_d.html#ga8c6320208680a823925d2816856437cc">pwm_lld_enable_channel()</a>, and <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086">PWM_READY</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___p_w_m_gafd6c45693467da77ab13edca8420620d_cgraph.png" border="0" usemap="#group___p_w_m_gafd6c45693467da77ab13edca8420620d_cgraph" alt=""/></div>
<map name="group___p_w_m_gafd6c45693467da77ab13edca8420620d_cgraph" id="group___p_w_m_gafd6c45693467da77ab13edca8420620d_cgraph">
<area shape="rect" id="node3" href="group___p_w_m___l_l_d.html#ga8c6320208680a823925d2816856437cc" title="Enables a PWM channel." alt="" coords="171,5,315,32"/>
</map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gac2679d11833a4ea9df5a9ed2e4a2c2e7"></a><!-- doxytag: member="pwm.h::pwmDisableChannel" ref="gac2679d11833a4ea9df5a9ed2e4a2c2e7" args="(PWMDriver *pwmp, pwmchannel_t channel)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void pwmDisableChannel </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *&nbsp;</td>
<td class="paramname"> <em>pwmp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a>&nbsp;</td>
<td class="paramname"> <em>channel</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disables a PWM channel. </p>
<p>The channel is disabled and its output line returned to the idle state.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pwmp</em>&nbsp;</td><td>pointer to a <code><a class="el" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>channel</em>&nbsp;</td><td>PWM channel identifier </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pwm_8c_source.html#l00141">141</a> of file <a class="el" href="pwm_8c_source.html">pwm.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea">PWMDriver::pd_state</a>, <a class="el" href="group___p_w_m___l_l_d.html#ga312588cf680d50931666643dea45bb13">PWM_CHANNELS</a>, <a class="el" href="group___p_w_m___l_l_d.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8">pwm_lld_disable_channel()</a>, and <a class="el" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086">PWM_READY</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___p_w_m_gac2679d11833a4ea9df5a9ed2e4a2c2e7_cgraph.png" border="0" usemap="#group___p_w_m_gac2679d11833a4ea9df5a9ed2e4a2c2e7_cgraph" alt=""/></div>
<map name="group___p_w_m_gac2679d11833a4ea9df5a9ed2e4a2c2e7_cgraph" id="group___p_w_m_gac2679d11833a4ea9df5a9ed2e4a2c2e7_cgraph">
<area shape="rect" id="node3" href="group___p_w_m___l_l_d.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8" title="Disables a PWM channel." alt="" coords="173,5,320,32"/>
</map>
</div>
</p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

View File

@@ -1,559 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: pwm_lld.c Source File</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>pwm_lld.c</h1> </div>
</div>
<div class="contents">
<a href="platforms_2_s_t_m32_2pwm__lld_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment"> This file is part of ChibiOS/RT.</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment"> ChibiOS/RT is free software; you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> the Free Software Foundation; either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment"> ChibiOS/RT is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00014"></a>00014 <span class="comment"> GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment"> ---</span>
<a name="l00020"></a>00020 <span class="comment"></span>
<a name="l00021"></a>00021 <span class="comment"> A special exception to the GPL can be applied should you wish to distribute</span>
<a name="l00022"></a>00022 <span class="comment"> a combined work that includes ChibiOS/RT, without being obliged to provide</span>
<a name="l00023"></a>00023 <span class="comment"> the source code for any proprietary components. See the file exception.txt</span>
<a name="l00024"></a>00024 <span class="comment"> for full details of how and when the exception can be applied.</span>
<a name="l00025"></a>00025 <span class="comment">*/</span>
<a name="l00026"></a>00026 <span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">/**</span>
<a name="l00028"></a>00028 <span class="comment"> * @file STM32/pwm_lld.c</span>
<a name="l00029"></a>00029 <span class="comment"> * @brief STM32 PWM subsystem low level driver header.</span>
<a name="l00030"></a>00030 <span class="comment"> * @addtogroup STM32_PWM</span>
<a name="l00031"></a>00031 <span class="comment"> * @{</span>
<a name="l00032"></a>00032 <span class="comment"> */</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="ch_8h.html" title="ChibiOS/RT main include file.">ch.h</a>&quot;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="hal_8h.html" title="HAL subsystem header.">hal.h</a>&quot;</span>
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="preprocessor">#if CH_HAL_USE_PWM || defined(__DOXYGEN__)</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="comment">/*===========================================================================*/</span>
<a name="l00040"></a>00040 <span class="comment">/* Driver exported variables. */</span>
<a name="l00041"></a>00041 <span class="comment">/*===========================================================================*/</span>
<a name="l00042"></a>00042 <span class="comment"></span>
<a name="l00043"></a>00043 <span class="comment">/**</span>
<a name="l00044"></a>00044 <span class="comment"> * @brief PWM1 driver identifier.</span>
<a name="l00045"></a>00045 <span class="comment"> * @note The driver PWM1 allocates the complex timer TIM1 when enabled.</span>
<a name="l00046"></a>00046 <span class="comment"> */</span>
<a name="l00047"></a>00047 <span class="preprocessor">#if defined(USE_STM32_PWM1) || defined(__DOXYGEN__)</span>
<a name="l00048"></a><a class="code" href="group___s_t_m32___p_w_m.html#gae02b0df41215cc132838d08307fedbfe">00048</a> <span class="preprocessor"></span><a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#gae02b0df41215cc132838d08307fedbfe" title="PWM1 driver identifier.">PWMD1</a>;
<a name="l00049"></a>00049 <span class="preprocessor">#endif</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00051"></a>00051 <span class="comment">/**</span>
<a name="l00052"></a>00052 <span class="comment"> * @brief PWM2 driver identifier.</span>
<a name="l00053"></a>00053 <span class="comment"> * @note The driver PWM2 allocates the timer TIM2 when enabled.</span>
<a name="l00054"></a>00054 <span class="comment"> */</span>
<a name="l00055"></a>00055 <span class="preprocessor">#if defined(USE_STM32_PWM2) || defined(__DOXYGEN__)</span>
<a name="l00056"></a><a class="code" href="group___s_t_m32___p_w_m.html#ga2a966bea47c26c120a2f7d8a69f9801c">00056</a> <span class="preprocessor"></span><a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#ga2a966bea47c26c120a2f7d8a69f9801c" title="PWM2 driver identifier.">PWMD2</a>;
<a name="l00057"></a>00057 <span class="preprocessor">#endif</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">/**</span>
<a name="l00060"></a>00060 <span class="comment"> * @brief PWM3 driver identifier.</span>
<a name="l00061"></a>00061 <span class="comment"> * @note The driver PWM3 allocates the timer TIM3 when enabled.</span>
<a name="l00062"></a>00062 <span class="comment"> */</span>
<a name="l00063"></a>00063 <span class="preprocessor">#if defined(USE_STM32_PWM3) || defined(__DOXYGEN__)</span>
<a name="l00064"></a><a class="code" href="group___s_t_m32___p_w_m.html#gafcc6572a26270e438dfc7d32b733e823">00064</a> <span class="preprocessor"></span><a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#gafcc6572a26270e438dfc7d32b733e823" title="PWM3 driver identifier.">PWMD3</a>;
<a name="l00065"></a>00065 <span class="preprocessor">#endif</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00067"></a>00067 <span class="comment">/**</span>
<a name="l00068"></a>00068 <span class="comment"> * @brief PWM4 driver identifier.</span>
<a name="l00069"></a>00069 <span class="comment"> * @note The driver PWM4 allocates the timer TIM4 when enabled.</span>
<a name="l00070"></a>00070 <span class="comment"> */</span>
<a name="l00071"></a>00071 <span class="preprocessor">#if defined(USE_STM32_PWM4) || defined(__DOXYGEN__)</span>
<a name="l00072"></a><a class="code" href="group___s_t_m32___p_w_m.html#gaef655f5c7a1c70e3cec051d0b5a0556c">00072</a> <span class="preprocessor"></span><a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#gaef655f5c7a1c70e3cec051d0b5a0556c" title="PWM4 driver identifier.">PWMD4</a>;
<a name="l00073"></a>00073 <span class="preprocessor">#endif</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span>
<a name="l00075"></a>00075 <span class="comment">/*===========================================================================*/</span>
<a name="l00076"></a>00076 <span class="comment">/* Driver local variables. */</span>
<a name="l00077"></a>00077 <span class="comment">/*===========================================================================*/</span>
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="comment">/*===========================================================================*/</span>
<a name="l00080"></a>00080 <span class="comment">/* Driver local functions. */</span>
<a name="l00081"></a>00081 <span class="comment">/*===========================================================================*/</span>
<a name="l00082"></a>00082 <span class="comment"></span>
<a name="l00083"></a>00083 <span class="comment">/**</span>
<a name="l00084"></a>00084 <span class="comment"> * @brief Stops all channels.</span>
<a name="l00085"></a>00085 <span class="comment"> *</span>
<a name="l00086"></a>00086 <span class="comment"> * @param[in] pwmp pointer to a @p PWMDriver object</span>
<a name="l00087"></a>00087 <span class="comment"> */</span>
<a name="l00088"></a>00088 <span class="keyword">static</span> <span class="keywordtype">void</span> stop_channels(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp) {
<a name="l00089"></a>00089
<a name="l00090"></a>00090 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> = 0; <span class="comment">/* All channels disabled. */</span>
<a name="l00091"></a>00091 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCER = 0; <span class="comment">/* Outputs disabled. */</span>
<a name="l00092"></a>00092 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR1 = 0; <span class="comment">/* Comparator 1 disabled. */</span>
<a name="l00093"></a>00093 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR2 = 0; <span class="comment">/* Comparator 2 disabled. */</span>
<a name="l00094"></a>00094 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR3 = 0; <span class="comment">/* Comparator 3 disabled. */</span>
<a name="l00095"></a>00095 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR4 = 0; <span class="comment">/* Comparator 4 disabled. */</span>
<a name="l00096"></a>00096 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 = 0; <span class="comment">/* Channels 1 and 2 frozen. */</span>
<a name="l00097"></a>00097 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 = 0; <span class="comment">/* Channels 3 and 4 frozen. */</span>
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099
<a name="l00100"></a>00100 <span class="preprocessor">#if USE_STM32_PWM2 || USE_STM32_PWM3 || USE_STM32_PWM4 || defined(__DOXYGEN__)</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00102"></a>00102 <span class="comment"> * @brief Common TIM2...TIM4 IRQ handler.</span>
<a name="l00103"></a>00103 <span class="comment"> * @note It is assumed that the various sources are only activated if the</span>
<a name="l00104"></a>00104 <span class="comment"> * associated callback pointer is not equal to @p NULL in order to not</span>
<a name="l00105"></a>00105 <span class="comment"> * perform an extra check in a potentially critical interrupt handler.</span>
<a name="l00106"></a>00106 <span class="comment"> */</span>
<a name="l00107"></a>00107 <span class="keyword">static</span> <span class="keywordtype">void</span> serve_interrupt(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp) {
<a name="l00108"></a>00108 <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> sr;
<a name="l00109"></a>00109
<a name="l00110"></a>00110 sr = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR &amp; pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER;
<a name="l00111"></a>00111 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF |
<a name="l00112"></a>00112 TIM_SR_CC4IF | TIM_SR_UIF);
<a name="l00113"></a>00113 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC1IF) != 0)
<a name="l00114"></a>00114 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[0].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00115"></a>00115 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC2IF) != 0)
<a name="l00116"></a>00116 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[1].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00117"></a>00117 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC3IF) != 0)
<a name="l00118"></a>00118 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[2].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00119"></a>00119 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC4IF) != 0)
<a name="l00120"></a>00120 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[3].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00121"></a>00121 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_UIF) != 0)
<a name="l00122"></a>00122 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a5543b74e75ec8598f0bc5878fdcfacf2" title="Periodic callback pointer.">pc_callback</a>();
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="preprocessor">#endif </span><span class="comment">/* USE_STM32_PWM2 || USE_STM32_PWM3 || USE_STM32_PWM4 */</span>
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="comment">/*===========================================================================*/</span>
<a name="l00127"></a>00127 <span class="comment">/* Driver interrupt handlers. */</span>
<a name="l00128"></a>00128 <span class="comment">/*===========================================================================*/</span>
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <span class="preprocessor">#if USE_STM32_PWM1</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00132"></a>00132 <span class="comment"> * @brief TIM1 update interrupt handler.</span>
<a name="l00133"></a>00133 <span class="comment"> * @note It is assumed that this interrupt is only activated if the callback</span>
<a name="l00134"></a>00134 <span class="comment"> * pointer is not equal to @p NULL in order to not perform an extra</span>
<a name="l00135"></a>00135 <span class="comment"> * check in a potentially critical interrupt handler.</span>
<a name="l00136"></a>00136 <span class="comment"> */</span>
<a name="l00137"></a>00137 <a class="code" href="group__system.html#ga52426c607fac82b1e0ad975b367f95e9" title="Standard normal IRQ handler declaration.">CH_IRQ_HANDLER</a>(VectorA4) {
<a name="l00138"></a>00138
<a name="l00139"></a>00139 <a class="code" href="group__system.html#ga0d78c6e90e5f0a4eb52aaab37e45a494" title="IRQ handler enter code.">CH_IRQ_PROLOGUE</a>();
<a name="l00140"></a>00140
<a name="l00141"></a>00141 TIM1-&gt;SR = ~TIM_SR_UIF;
<a name="l00142"></a>00142 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a5543b74e75ec8598f0bc5878fdcfacf2" title="Periodic callback pointer.">pc_callback</a>();
<a name="l00143"></a>00143
<a name="l00144"></a>00144 <a class="code" href="group__system.html#ga864d6b8056d7d8f56322bbfcc8515d77" title="IRQ handler exit code.">CH_IRQ_EPILOGUE</a>();
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146 <span class="comment"></span>
<a name="l00147"></a>00147 <span class="comment">/**</span>
<a name="l00148"></a>00148 <span class="comment"> * @brief TIM1 compare interrupt handler.</span>
<a name="l00149"></a>00149 <span class="comment"> * @note It is assumed that the various sources are only activated if the</span>
<a name="l00150"></a>00150 <span class="comment"> * associated callback pointer is not equal to @p NULL in order to not</span>
<a name="l00151"></a>00151 <span class="comment"> * perform an extra check in a potentially critical interrupt handler.</span>
<a name="l00152"></a>00152 <span class="comment"> */</span>
<a name="l00153"></a>00153 <a class="code" href="group__system.html#ga52426c607fac82b1e0ad975b367f95e9" title="Standard normal IRQ handler declaration.">CH_IRQ_HANDLER</a>(VectorAC) {
<a name="l00154"></a>00154 <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> sr;
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <a class="code" href="group__system.html#ga0d78c6e90e5f0a4eb52aaab37e45a494" title="IRQ handler enter code.">CH_IRQ_PROLOGUE</a>();
<a name="l00157"></a>00157
<a name="l00158"></a>00158 sr = TIM1-&gt;SR &amp; TIM1-&gt;DIER;
<a name="l00159"></a>00159 TIM1-&gt;SR = ~(TIM_SR_CC1IF | TIM_SR_CC2IF | TIM_SR_CC3IF | TIM_SR_CC4IF);
<a name="l00160"></a>00160 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC1IF) != 0)
<a name="l00161"></a>00161 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[0].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00162"></a>00162 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC2IF) != 0)
<a name="l00163"></a>00163 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[1].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00164"></a>00164 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC3IF) != 0)
<a name="l00165"></a>00165 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[2].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00166"></a>00166 <span class="keywordflow">if</span> ((sr &amp; TIM_SR_CC4IF) != 0)
<a name="l00167"></a>00167 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[3].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a>();
<a name="l00168"></a>00168
<a name="l00169"></a>00169 <a class="code" href="group__system.html#ga864d6b8056d7d8f56322bbfcc8515d77" title="IRQ handler exit code.">CH_IRQ_EPILOGUE</a>();
<a name="l00170"></a>00170 }
<a name="l00171"></a>00171 <span class="preprocessor">#endif </span><span class="comment">/* USE_STM32_PWM1 */</span>
<a name="l00172"></a>00172
<a name="l00173"></a>00173 <span class="preprocessor">#if USE_STM32_PWM2</span>
<a name="l00174"></a>00174 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00175"></a>00175 <span class="comment"> * @brief TIM2 interrupt handler.</span>
<a name="l00176"></a>00176 <span class="comment"> */</span>
<a name="l00177"></a>00177 <a class="code" href="group__system.html#ga52426c607fac82b1e0ad975b367f95e9" title="Standard normal IRQ handler declaration.">CH_IRQ_HANDLER</a>(VectorB0) {
<a name="l00178"></a>00178
<a name="l00179"></a>00179 <a class="code" href="group__system.html#ga0d78c6e90e5f0a4eb52aaab37e45a494" title="IRQ handler enter code.">CH_IRQ_PROLOGUE</a>();
<a name="l00180"></a>00180
<a name="l00181"></a>00181 serve_interrupt(&amp;PWMD2);
<a name="l00182"></a>00182
<a name="l00183"></a>00183 <a class="code" href="group__system.html#ga864d6b8056d7d8f56322bbfcc8515d77" title="IRQ handler exit code.">CH_IRQ_EPILOGUE</a>();
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185 <span class="preprocessor">#endif </span><span class="comment">/* USE_STM32_PWM2 */</span>
<a name="l00186"></a>00186
<a name="l00187"></a>00187 <span class="preprocessor">#if USE_STM32_PWM3</span>
<a name="l00188"></a>00188 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00189"></a>00189 <span class="comment"> * @brief TIM3 interrupt handler.</span>
<a name="l00190"></a>00190 <span class="comment"> */</span>
<a name="l00191"></a>00191 <a class="code" href="group__system.html#ga52426c607fac82b1e0ad975b367f95e9" title="Standard normal IRQ handler declaration.">CH_IRQ_HANDLER</a>(VectorB4) {
<a name="l00192"></a>00192
<a name="l00193"></a>00193 <a class="code" href="group__system.html#ga0d78c6e90e5f0a4eb52aaab37e45a494" title="IRQ handler enter code.">CH_IRQ_PROLOGUE</a>();
<a name="l00194"></a>00194
<a name="l00195"></a>00195 serve_interrupt(&amp;PWMD3);
<a name="l00196"></a>00196
<a name="l00197"></a>00197 <a class="code" href="group__system.html#ga864d6b8056d7d8f56322bbfcc8515d77" title="IRQ handler exit code.">CH_IRQ_EPILOGUE</a>();
<a name="l00198"></a>00198 }
<a name="l00199"></a>00199 <span class="preprocessor">#endif </span><span class="comment">/* USE_STM32_PWM3 */</span>
<a name="l00200"></a>00200
<a name="l00201"></a>00201 <span class="preprocessor">#if USE_STM32_PWM4</span>
<a name="l00202"></a>00202 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00203"></a>00203 <span class="comment"> * @brief TIM4 interrupt handler.</span>
<a name="l00204"></a>00204 <span class="comment"> */</span>
<a name="l00205"></a>00205 <a class="code" href="group__system.html#ga52426c607fac82b1e0ad975b367f95e9" title="Standard normal IRQ handler declaration.">CH_IRQ_HANDLER</a>(VectorB8) {
<a name="l00206"></a>00206
<a name="l00207"></a>00207 <a class="code" href="group__system.html#ga0d78c6e90e5f0a4eb52aaab37e45a494" title="IRQ handler enter code.">CH_IRQ_PROLOGUE</a>();
<a name="l00208"></a>00208
<a name="l00209"></a>00209 serve_interrupt(&amp;PWMD4);
<a name="l00210"></a>00210
<a name="l00211"></a>00211 <a class="code" href="group__system.html#ga864d6b8056d7d8f56322bbfcc8515d77" title="IRQ handler exit code.">CH_IRQ_EPILOGUE</a>();
<a name="l00212"></a>00212 }
<a name="l00213"></a>00213 <span class="preprocessor">#endif </span><span class="comment">/* USE_STM32_PWM4 */</span>
<a name="l00214"></a>00214
<a name="l00215"></a>00215 <span class="comment">/*===========================================================================*/</span>
<a name="l00216"></a>00216 <span class="comment">/* Driver exported functions. */</span>
<a name="l00217"></a>00217 <span class="comment">/*===========================================================================*/</span>
<a name="l00218"></a>00218 <span class="comment"></span>
<a name="l00219"></a>00219 <span class="comment">/**</span>
<a name="l00220"></a>00220 <span class="comment"> * @brief Low level PWM driver initialization.</span>
<a name="l00221"></a>00221 <span class="comment"> */</span>
<a name="l00222"></a>00222 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga7cb5729a65c0996584808e4f93b28a0d" title="Low level PWM driver initialization.">pwm_lld_init</a>(<span class="keywordtype">void</span>) {
<a name="l00223"></a>00223
<a name="l00224"></a>00224 <span class="preprocessor">#if USE_STM32_PWM1</span>
<a name="l00225"></a>00225 <span class="preprocessor"></span> <span class="comment">/* TIM1 reset, ensures reset state in order to avoid trouble with JTAGs.*/</span>
<a name="l00226"></a>00226 RCC-&gt;APB2RSTR = RCC_APB2RSTR_TIM1RST;
<a name="l00227"></a>00227 RCC-&gt;APB2RSTR = 0;
<a name="l00228"></a>00228
<a name="l00229"></a>00229 <span class="comment">/* Driver initialization.*/</span>
<a name="l00230"></a>00230 <a class="code" href="group___p_w_m.html#ga4dbf1fded2984ff6dc240afd2e1fcd74" title="Initializes the standard part of a PWMDriver structure.">pwmObjectInit</a>(&amp;PWMD1);
<a name="l00231"></a>00231 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> = 0;
<a name="l00232"></a>00232 PWMD1.<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a> = TIM1;
<a name="l00233"></a>00233 <span class="preprocessor">#endif</span>
<a name="l00234"></a>00234 <span class="preprocessor"></span>
<a name="l00235"></a>00235 <span class="preprocessor">#if USE_STM32_PWM2</span>
<a name="l00236"></a>00236 <span class="preprocessor"></span> <span class="comment">/* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/</span>
<a name="l00237"></a>00237 RCC-&gt;APB1RSTR = RCC_APB1RSTR_TIM2RST;
<a name="l00238"></a>00238 RCC-&gt;APB1RSTR = 0;
<a name="l00239"></a>00239
<a name="l00240"></a>00240 <span class="comment">/* Driver initialization.*/</span>
<a name="l00241"></a>00241 <a class="code" href="group___p_w_m.html#ga4dbf1fded2984ff6dc240afd2e1fcd74" title="Initializes the standard part of a PWMDriver structure.">pwmObjectInit</a>(&amp;PWMD2);
<a name="l00242"></a>00242 PWMD2.<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> = 0;
<a name="l00243"></a>00243 PWMD2.<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a> = TIM2;
<a name="l00244"></a>00244 <span class="preprocessor">#endif</span>
<a name="l00245"></a>00245 <span class="preprocessor"></span>
<a name="l00246"></a>00246 <span class="preprocessor">#if USE_STM32_PWM3</span>
<a name="l00247"></a>00247 <span class="preprocessor"></span> <span class="comment">/* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/</span>
<a name="l00248"></a>00248 RCC-&gt;APB1RSTR = RCC_APB1RSTR_TIM3RST;
<a name="l00249"></a>00249 RCC-&gt;APB1RSTR = 0;
<a name="l00250"></a>00250
<a name="l00251"></a>00251 <span class="comment">/* Driver initialization.*/</span>
<a name="l00252"></a>00252 <a class="code" href="group___p_w_m.html#ga4dbf1fded2984ff6dc240afd2e1fcd74" title="Initializes the standard part of a PWMDriver structure.">pwmObjectInit</a>(&amp;PWMD3);
<a name="l00253"></a>00253 PWMD3.<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> = 0;
<a name="l00254"></a>00254 PWMD3.<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a> = TIM3;
<a name="l00255"></a>00255 <span class="preprocessor">#endif</span>
<a name="l00256"></a>00256 <span class="preprocessor"></span>
<a name="l00257"></a>00257 <span class="preprocessor">#if USE_STM32_PWM4</span>
<a name="l00258"></a>00258 <span class="preprocessor"></span> <span class="comment">/* TIM2 reset, ensures reset state in order to avoid trouble with JTAGs.*/</span>
<a name="l00259"></a>00259 RCC-&gt;APB1RSTR = RCC_APB1RSTR_TIM4RST;
<a name="l00260"></a>00260 RCC-&gt;APB1RSTR = 0;
<a name="l00261"></a>00261
<a name="l00262"></a>00262 <span class="comment">/* Driver initialization.*/</span>
<a name="l00263"></a>00263 <a class="code" href="group___p_w_m.html#ga4dbf1fded2984ff6dc240afd2e1fcd74" title="Initializes the standard part of a PWMDriver structure.">pwmObjectInit</a>(&amp;PWMD4);
<a name="l00264"></a>00264 PWMD4.<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> = 0;
<a name="l00265"></a>00265 PWMD4.<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a> = TIM4;
<a name="l00266"></a>00266 <span class="preprocessor">#endif</span>
<a name="l00267"></a>00267 <span class="preprocessor"></span>}
<a name="l00268"></a>00268 <span class="comment"></span>
<a name="l00269"></a>00269 <span class="comment">/**</span>
<a name="l00270"></a>00270 <span class="comment"> * @brief Configures and activates the PWM peripheral.</span>
<a name="l00271"></a>00271 <span class="comment"> *</span>
<a name="l00272"></a>00272 <span class="comment"> * @param[in] pwmp pointer to a @p PWMDriver object</span>
<a name="l00273"></a>00273 <span class="comment"> */</span>
<a name="l00274"></a>00274 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga8a4d803d25a5326b48b3713ffd5fce53" title="Configures and activates the PWM peripheral.">pwm_lld_start</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp) {
<a name="l00275"></a>00275 <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> ccer;
<a name="l00276"></a>00276
<a name="l00277"></a>00277 <span class="keywordflow">if</span> (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea" title="Driver state.">pd_state</a> == <a class="code" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a4da638211112ff017325e9472592a151" title="Stopped.">PWM_STOP</a>) {
<a name="l00278"></a>00278 <span class="comment">/* Clock activation.*/</span>
<a name="l00279"></a>00279 <span class="preprocessor">#if USE_STM32_PWM1</span>
<a name="l00280"></a>00280 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD1 == pwmp) {
<a name="l00281"></a>00281 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga607470c0f5d4bd0ee0f7208a9def4986" title="Sets the priority of an interrupt handler and enables it.">NVICEnableVector</a>(TIM1_UP_IRQn,
<a name="l00282"></a>00282 <a class="code" href="group___a_r_m_c_mx___c_o_r_e.html#gabf50672d926743f012521dad719f3a0f" title="Priority level to priority mask conversion macro.">CORTEX_PRIORITY_MASK</a>(<a class="code" href="group___s_t_m32___p_w_m.html#gac800997848ce5e6c707372390d945c7c" title="PWM1 interrupt priority level setting.">STM32_PWM1_IRQ_PRIORITY</a>));
<a name="l00283"></a>00283 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga607470c0f5d4bd0ee0f7208a9def4986" title="Sets the priority of an interrupt handler and enables it.">NVICEnableVector</a>(TIM1_CC_IRQn,
<a name="l00284"></a>00284 <a class="code" href="group___a_r_m_c_mx___c_o_r_e.html#gabf50672d926743f012521dad719f3a0f" title="Priority level to priority mask conversion macro.">CORTEX_PRIORITY_MASK</a>(<a class="code" href="group___s_t_m32___p_w_m.html#gac800997848ce5e6c707372390d945c7c" title="PWM1 interrupt priority level setting.">STM32_PWM1_IRQ_PRIORITY</a>));
<a name="l00285"></a>00285 RCC-&gt;APB2ENR |= RCC_APB2ENR_TIM1EN;
<a name="l00286"></a>00286 }
<a name="l00287"></a>00287 <span class="preprocessor">#endif</span>
<a name="l00288"></a>00288 <span class="preprocessor"></span><span class="preprocessor">#if USE_STM32_PWM2</span>
<a name="l00289"></a>00289 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD2 == pwmp) {
<a name="l00290"></a>00290 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga607470c0f5d4bd0ee0f7208a9def4986" title="Sets the priority of an interrupt handler and enables it.">NVICEnableVector</a>(TIM2_IRQn,
<a name="l00291"></a>00291 <a class="code" href="group___a_r_m_c_mx___c_o_r_e.html#gabf50672d926743f012521dad719f3a0f" title="Priority level to priority mask conversion macro.">CORTEX_PRIORITY_MASK</a>(<a class="code" href="group___s_t_m32___p_w_m.html#ga0215547b5c9692aa9d6af10e46639f29" title="PWM2 interrupt priority level setting.">STM32_PWM2_IRQ_PRIORITY</a>));
<a name="l00292"></a>00292 RCC-&gt;APB1ENR |= RCC_APB1ENR_TIM2EN;
<a name="l00293"></a>00293 }
<a name="l00294"></a>00294 <span class="preprocessor">#endif</span>
<a name="l00295"></a>00295 <span class="preprocessor"></span><span class="preprocessor">#if USE_STM32_PWM3</span>
<a name="l00296"></a>00296 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD3 == pwmp) {
<a name="l00297"></a>00297 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga607470c0f5d4bd0ee0f7208a9def4986" title="Sets the priority of an interrupt handler and enables it.">NVICEnableVector</a>(TIM3_IRQn,
<a name="l00298"></a>00298 <a class="code" href="group___a_r_m_c_mx___c_o_r_e.html#gabf50672d926743f012521dad719f3a0f" title="Priority level to priority mask conversion macro.">CORTEX_PRIORITY_MASK</a>(<a class="code" href="group___s_t_m32___p_w_m.html#ga5dc025c64957640f0bd42460648c835a" title="PWM3 interrupt priority level setting.">STM32_PWM3_IRQ_PRIORITY</a>));
<a name="l00299"></a>00299 RCC-&gt;APB1ENR |= RCC_APB1ENR_TIM3EN;
<a name="l00300"></a>00300 }
<a name="l00301"></a>00301 <span class="preprocessor">#endif</span>
<a name="l00302"></a>00302 <span class="preprocessor"></span><span class="preprocessor">#if USE_STM32_PWM4</span>
<a name="l00303"></a>00303 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD4 == pwmp) {
<a name="l00304"></a>00304 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga607470c0f5d4bd0ee0f7208a9def4986" title="Sets the priority of an interrupt handler and enables it.">NVICEnableVector</a>(TIM4_IRQn,
<a name="l00305"></a>00305 <a class="code" href="group___a_r_m_c_mx___c_o_r_e.html#gabf50672d926743f012521dad719f3a0f" title="Priority level to priority mask conversion macro.">CORTEX_PRIORITY_MASK</a>(<a class="code" href="group___s_t_m32___p_w_m.html#gafacc8948371fb7804b5c6cbb2a0aacd8" title="PWM4 interrupt priority level setting.">STM32_PWM4_IRQ_PRIORITY</a>));
<a name="l00306"></a>00306 RCC-&gt;APB1ENR |= RCC_APB1ENR_TIM4EN;
<a name="l00307"></a>00307 }
<a name="l00308"></a>00308 <span class="preprocessor">#endif</span>
<a name="l00309"></a>00309 <span class="preprocessor"></span> }
<a name="l00310"></a>00310 <span class="comment">/* Reset channels.*/</span>
<a name="l00311"></a>00311 stop_channels(pwmp);
<a name="l00312"></a>00312
<a name="l00313"></a>00313 <span class="comment">/* Configuration or reconfiguration.*/</span>
<a name="l00314"></a>00314 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CR1 = 0; <span class="comment">/* Timer stopped. */</span>
<a name="l00315"></a>00315 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SMCR = 0; <span class="comment">/* Slave mode disabled. */</span>
<a name="l00316"></a>00316 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CR2 = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#ad505b6cbea937cc878584f50875437d7" title="TIM CR2 register initialization data.">pc_cr2</a>;
<a name="l00317"></a>00317 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;PSC = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#ac393e708ea08dc7d5c9714be8fef35db" title="TIM PSC (pre-scaler) register initialization data.">pc_psc</a>;
<a name="l00318"></a>00318 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CNT = 0;
<a name="l00319"></a>00319 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;ARR = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a883f1938e1e6af6759a7a7e9f459a8ca" title="TIM ARR (auto-reload) register initialization data.">pc_arr</a>;
<a name="l00320"></a>00320 <span class="comment">/* Output enables and polarities setup.*/</span>
<a name="l00321"></a>00321 ccer = 0;
<a name="l00322"></a>00322 <span class="keywordflow">switch</span> (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[0].<a class="code" href="struct_p_w_m_channel_config.html#ae11e4f30de426d95a22c22a65ab0408c" title="Channel active logic level.">pcc_mode</a>) {
<a name="l00323"></a>00323 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba" title="Idle is logic level 1.">PWM_OUTPUT_ACTIVE_LOW</a>:
<a name="l00324"></a>00324 ccer |= TIM_CCER_CC1P;
<a name="l00325"></a>00325 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1" title="Idle is logic level 0.">PWM_OUTPUT_ACTIVE_HIGH</a>:
<a name="l00326"></a>00326 ccer |= TIM_CCER_CC1E;
<a name="l00327"></a>00327 <span class="keywordflow">default</span>:
<a name="l00328"></a>00328 ;
<a name="l00329"></a>00329 }
<a name="l00330"></a>00330 <span class="keywordflow">switch</span> (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[1].<a class="code" href="struct_p_w_m_channel_config.html#ae11e4f30de426d95a22c22a65ab0408c" title="Channel active logic level.">pcc_mode</a>) {
<a name="l00331"></a>00331 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba" title="Idle is logic level 1.">PWM_OUTPUT_ACTIVE_LOW</a>:
<a name="l00332"></a>00332 ccer |= TIM_CCER_CC2P;
<a name="l00333"></a>00333 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1" title="Idle is logic level 0.">PWM_OUTPUT_ACTIVE_HIGH</a>:
<a name="l00334"></a>00334 ccer |= TIM_CCER_CC2E;
<a name="l00335"></a>00335 <span class="keywordflow">default</span>:
<a name="l00336"></a>00336 ;
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 <span class="keywordflow">switch</span> (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[2].<a class="code" href="struct_p_w_m_channel_config.html#ae11e4f30de426d95a22c22a65ab0408c" title="Channel active logic level.">pcc_mode</a>) {
<a name="l00339"></a>00339 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba" title="Idle is logic level 1.">PWM_OUTPUT_ACTIVE_LOW</a>:
<a name="l00340"></a>00340 ccer |= TIM_CCER_CC3P;
<a name="l00341"></a>00341 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1" title="Idle is logic level 0.">PWM_OUTPUT_ACTIVE_HIGH</a>:
<a name="l00342"></a>00342 ccer |= TIM_CCER_CC3E;
<a name="l00343"></a>00343 <span class="keywordflow">default</span>:
<a name="l00344"></a>00344 ;
<a name="l00345"></a>00345 }
<a name="l00346"></a>00346 <span class="keywordflow">switch</span> (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[3].<a class="code" href="struct_p_w_m_channel_config.html#ae11e4f30de426d95a22c22a65ab0408c" title="Channel active logic level.">pcc_mode</a>) {
<a name="l00347"></a>00347 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0a7a1e4472427e3a352e4837ba5146fcba" title="Idle is logic level 1.">PWM_OUTPUT_ACTIVE_LOW</a>:
<a name="l00348"></a>00348 ccer |= TIM_CCER_CC4P;
<a name="l00349"></a>00349 <span class="keywordflow">case</span> <a class="code" href="group___p_w_m.html#ggaaa2db6a7be396595dcf16da3f94634a0aebf0e802a4bab8825b697f2f7e8346f1" title="Idle is logic level 0.">PWM_OUTPUT_ACTIVE_HIGH</a>:
<a name="l00350"></a>00350 ccer |= TIM_CCER_CC4E;
<a name="l00351"></a>00351 <span class="keywordflow">default</span>:
<a name="l00352"></a>00352 ;
<a name="l00353"></a>00353 }
<a name="l00354"></a>00354 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCER = ccer;
<a name="l00355"></a>00355 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;EGR = TIM_EGR_UG; <span class="comment">/* Update event. */</span>
<a name="l00356"></a>00356 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR = 0; <span class="comment">/* Clear pending IRQs. */</span>
<a name="l00357"></a>00357 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a5543b74e75ec8598f0bc5878fdcfacf2" title="Periodic callback pointer.">pc_callback</a> == NULL ? 0 : TIM_DIER_UIE;
<a name="l00358"></a>00358 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;BDTR = TIM_BDTR_MOE;
<a name="l00359"></a>00359 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CR1 = TIM_CR1_ARPE | TIM_CR1_URS |
<a name="l00360"></a>00360 TIM_CR1_CEN; <span class="comment">/* Timer configured and started.*/</span>
<a name="l00361"></a>00361 }
<a name="l00362"></a>00362 <span class="comment"></span>
<a name="l00363"></a>00363 <span class="comment">/**</span>
<a name="l00364"></a>00364 <span class="comment"> * @brief Deactivates the PWM peripheral.</span>
<a name="l00365"></a>00365 <span class="comment"> *</span>
<a name="l00366"></a>00366 <span class="comment"> * @param[in] pwmp pointer to a @p PWMDriver object</span>
<a name="l00367"></a>00367 <span class="comment"> */</span>
<a name="l00368"></a>00368 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga48b759363af69a6aaee37a362ed5bfd2" title="Deactivates the PWM peripheral.">pwm_lld_stop</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp) {
<a name="l00369"></a>00369 <span class="comment">/* If in ready state then disables the PWM clock.*/</span>
<a name="l00370"></a>00370 <span class="keywordflow">if</span> (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea" title="Driver state.">pd_state</a> == <a class="code" href="group___p_w_m.html#gga9b63d6f4d51e8ca9ee1fce2a1bc86bc5a1bb17b80878c81e8a0e4671a44bc7086" title="Ready.">PWM_READY</a>) {
<a name="l00371"></a>00371 stop_channels(pwmp);
<a name="l00372"></a>00372 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CR1 = 0;
<a name="l00373"></a>00373 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;BDTR = 0;
<a name="l00374"></a>00374 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER = 0;
<a name="l00375"></a>00375
<a name="l00376"></a>00376 <span class="preprocessor">#if USE_STM32_PWM1</span>
<a name="l00377"></a>00377 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD1 == pwmp) {
<a name="l00378"></a>00378 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga66f3c540c80ac9d9ea7878671b0bd59e" title="Disables an interrupt handler.">NVICDisableVector</a>(TIM1_UP_IRQn);
<a name="l00379"></a>00379 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga66f3c540c80ac9d9ea7878671b0bd59e" title="Disables an interrupt handler.">NVICDisableVector</a>(TIM1_CC_IRQn);
<a name="l00380"></a>00380 RCC-&gt;APB2ENR &amp;= ~RCC_APB2ENR_TIM1EN;
<a name="l00381"></a>00381 }
<a name="l00382"></a>00382 <span class="preprocessor">#endif</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span><span class="preprocessor">#if USE_STM32_PWM2</span>
<a name="l00384"></a>00384 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD2 == pwmp) {
<a name="l00385"></a>00385 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga66f3c540c80ac9d9ea7878671b0bd59e" title="Disables an interrupt handler.">NVICDisableVector</a>(TIM2_IRQn);
<a name="l00386"></a>00386 RCC-&gt;APB1ENR &amp;= ~RCC_APB1ENR_TIM2EN;
<a name="l00387"></a>00387 }
<a name="l00388"></a>00388 <span class="preprocessor">#endif</span>
<a name="l00389"></a>00389 <span class="preprocessor"></span><span class="preprocessor">#if USE_STM32_PWM3</span>
<a name="l00390"></a>00390 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD3 == pwmp) {
<a name="l00391"></a>00391 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga66f3c540c80ac9d9ea7878671b0bd59e" title="Disables an interrupt handler.">NVICDisableVector</a>(TIM3_IRQn);
<a name="l00392"></a>00392 RCC-&gt;APB1ENR &amp;= ~RCC_APB1ENR_TIM3EN;
<a name="l00393"></a>00393 }
<a name="l00394"></a>00394 <span class="preprocessor">#endif</span>
<a name="l00395"></a>00395 <span class="preprocessor"></span><span class="preprocessor">#if USE_STM32_PWM4</span>
<a name="l00396"></a>00396 <span class="preprocessor"></span> <span class="keywordflow">if</span> (&amp;PWMD4 == pwmp) {
<a name="l00397"></a>00397 <a class="code" href="group___a_r_m_c_mx___n_v_i_c.html#ga66f3c540c80ac9d9ea7878671b0bd59e" title="Disables an interrupt handler.">NVICDisableVector</a>(TIM4_IRQn);
<a name="l00398"></a>00398 RCC-&gt;APB1ENR &amp;= ~RCC_APB1ENR_TIM4EN;
<a name="l00399"></a>00399 }
<a name="l00400"></a>00400 <span class="preprocessor">#endif</span>
<a name="l00401"></a>00401 <span class="preprocessor"></span> }
<a name="l00402"></a>00402 }
<a name="l00403"></a>00403 <span class="comment"></span>
<a name="l00404"></a>00404 <span class="comment">/**</span>
<a name="l00405"></a>00405 <span class="comment"> * @brief Enables a PWM channel.</span>
<a name="l00406"></a>00406 <span class="comment"> *</span>
<a name="l00407"></a>00407 <span class="comment"> * @param[in] pwmp pointer to a @p PWMDriver object</span>
<a name="l00408"></a>00408 <span class="comment"> * @param[in] channel PWM channel identifier</span>
<a name="l00409"></a>00409 <span class="comment"> * @param[in] width PWM pulse width as clock pulses number</span>
<a name="l00410"></a>00410 <span class="comment"> */</span>
<a name="l00411"></a>00411 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga8c6320208680a823925d2816856437cc" title="Enables a PWM channel.">pwm_lld_enable_channel</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp,
<a name="l00412"></a>00412 <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel,
<a name="l00413"></a>00413 <a class="code" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61" title="PWM counter type.">pwmcnt_t</a> width) {
<a name="l00414"></a>00414
<a name="l00415"></a>00415 <span class="comment">/*</span>
<a name="l00416"></a>00416 <span class="comment"> * Changes the pulse width.</span>
<a name="l00417"></a>00417 <span class="comment"> */</span>
<a name="l00418"></a>00418 <span class="keywordflow">switch</span> (channel) {
<a name="l00419"></a>00419 <span class="keywordflow">case</span> 0:
<a name="l00420"></a>00420 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR1 = width;
<a name="l00421"></a>00421 <span class="keywordflow">break</span>;
<a name="l00422"></a>00422 <span class="keywordflow">case</span> 1:
<a name="l00423"></a>00423 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR2 = width;
<a name="l00424"></a>00424 <span class="keywordflow">break</span>;
<a name="l00425"></a>00425 <span class="keywordflow">case</span> 2:
<a name="l00426"></a>00426 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR3 = width;
<a name="l00427"></a>00427 <span class="keywordflow">break</span>;
<a name="l00428"></a>00428 <span class="keywordflow">case</span> 3:
<a name="l00429"></a>00429 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR4 = width;
<a name="l00430"></a>00430 <span class="keywordflow">break</span>;
<a name="l00431"></a>00431 }
<a name="l00432"></a>00432 <span class="keywordflow">if</span> ((pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> &amp; (1 &lt;&lt; channel)) == 0) {
<a name="l00433"></a>00433 <span class="comment">/*</span>
<a name="l00434"></a>00434 <span class="comment"> * The channel is not enabled yet.</span>
<a name="l00435"></a>00435 <span class="comment"> */</span>
<a name="l00436"></a>00436 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> |= (1 &lt;&lt; channel);
<a name="l00437"></a>00437 <span class="comment">/*</span>
<a name="l00438"></a>00438 <span class="comment"> * Setup the comparator, the channel is configured as PWM mode 1 with</span>
<a name="l00439"></a>00439 <span class="comment"> * preload enabled.</span>
<a name="l00440"></a>00440 <span class="comment"> */</span>
<a name="l00441"></a>00441 <span class="keywordflow">switch</span> (channel) {
<a name="l00442"></a>00442 <span class="keywordflow">case</span> 0:
<a name="l00443"></a>00443 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 = (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 &amp; 0xFF00) |
<a name="l00444"></a>00444 TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 |
<a name="l00445"></a>00445 TIM_CCMR1_OC1PE;
<a name="l00446"></a>00446 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR = ~TIM_SR_CC1IF;
<a name="l00447"></a>00447 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER |= pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[0].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a> == NULL
<a name="l00448"></a>00448 ? 0 : TIM_DIER_CC1IE;
<a name="l00449"></a>00449 <span class="keywordflow">break</span>;
<a name="l00450"></a>00450 <span class="keywordflow">case</span> 1:
<a name="l00451"></a>00451 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 = (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 &amp; 0x00FF) |
<a name="l00452"></a>00452 TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2 |
<a name="l00453"></a>00453 TIM_CCMR1_OC2PE;
<a name="l00454"></a>00454 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR = ~TIM_SR_CC2IF;
<a name="l00455"></a>00455 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER |= pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[1].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a> == NULL
<a name="l00456"></a>00456 ? 0 : TIM_DIER_CC2IE;
<a name="l00457"></a>00457 <span class="keywordflow">break</span>;
<a name="l00458"></a>00458 <span class="keywordflow">case</span> 2:
<a name="l00459"></a>00459 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 = (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 &amp; 0xFF00) |
<a name="l00460"></a>00460 TIM_CCMR2_OC3M_1 | TIM_CCMR2_OC3M_2 |
<a name="l00461"></a>00461 TIM_CCMR2_OC3PE;
<a name="l00462"></a>00462 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR = ~TIM_SR_CC3IF;
<a name="l00463"></a>00463 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER |= pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[2].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a> == NULL
<a name="l00464"></a>00464 ? 0 : TIM_DIER_CC3IE;
<a name="l00465"></a>00465 <span class="keywordflow">break</span>;
<a name="l00466"></a>00466 <span class="keywordflow">case</span> 3:
<a name="l00467"></a>00467 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 = (pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 &amp; 0x00FF) |
<a name="l00468"></a>00468 TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4M_2 |
<a name="l00469"></a>00469 TIM_CCMR2_OC4PE;
<a name="l00470"></a>00470 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;SR = ~TIM_SR_CC4IF;
<a name="l00471"></a>00471 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER |= pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8" title="Current configuration data.">pd_config</a>-&gt;<a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef" title="Channels configurations.">pc_channels</a>[3].<a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a" title="Channel callback pointer.">pcc_callback</a> == NULL
<a name="l00472"></a>00472 ? 0 : TIM_DIER_CC4IE;
<a name="l00473"></a>00473 <span class="keywordflow">break</span>;
<a name="l00474"></a>00474 }
<a name="l00475"></a>00475 }
<a name="l00476"></a>00476 }
<a name="l00477"></a>00477 <span class="comment"></span>
<a name="l00478"></a>00478 <span class="comment">/**</span>
<a name="l00479"></a>00479 <span class="comment"> * @brief Disables a PWM channel.</span>
<a name="l00480"></a>00480 <span class="comment"> * @details The channel is disabled and its output line returned to the</span>
<a name="l00481"></a>00481 <span class="comment"> * idle state.</span>
<a name="l00482"></a>00482 <span class="comment"> *</span>
<a name="l00483"></a>00483 <span class="comment"> * @param[in] pwmp pointer to a @p PWMDriver object</span>
<a name="l00484"></a>00484 <span class="comment"> * @param[in] channel PWM channel identifier</span>
<a name="l00485"></a>00485 <span class="comment"> */</span>
<a name="l00486"></a>00486 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8" title="Disables a PWM channel.">pwm_lld_disable_channel</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp, <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel) {
<a name="l00487"></a>00487
<a name="l00488"></a>00488 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b" title="Bit mask of the enabled channels.">pd_enabled_channels</a> &amp;= ~(1 &lt;&lt; channel);
<a name="l00489"></a>00489 <span class="keywordflow">switch</span> (channel) {
<a name="l00490"></a>00490 <span class="keywordflow">case</span> 0:
<a name="l00491"></a>00491 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR1 = 0;
<a name="l00492"></a>00492 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 &amp; 0xFF00;
<a name="l00493"></a>00493 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER &amp;= ~TIM_DIER_CC1IE;
<a name="l00494"></a>00494 <span class="keywordflow">break</span>;
<a name="l00495"></a>00495 <span class="keywordflow">case</span> 1:
<a name="l00496"></a>00496 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR2 = 0;
<a name="l00497"></a>00497 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR1 &amp; 0x00FF;
<a name="l00498"></a>00498 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER &amp;= ~TIM_DIER_CC2IE;
<a name="l00499"></a>00499 <span class="keywordflow">break</span>;
<a name="l00500"></a>00500 <span class="keywordflow">case</span> 2:
<a name="l00501"></a>00501 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR3 = 0;
<a name="l00502"></a>00502 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 &amp; 0xFF00;
<a name="l00503"></a>00503 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER &amp;= ~TIM_DIER_CC3IE;
<a name="l00504"></a>00504 <span class="keywordflow">break</span>;
<a name="l00505"></a>00505 <span class="keywordflow">case</span> 3:
<a name="l00506"></a>00506 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCR4 = 0;
<a name="l00507"></a>00507 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 = pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;CCMR2 &amp; 0x00FF;
<a name="l00508"></a>00508 pwmp-&gt;<a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7" title="Pointer to the TIMx registers block.">pd_tim</a>-&gt;DIER &amp;= ~TIM_DIER_CC4IE;
<a name="l00509"></a>00509 <span class="keywordflow">break</span>;
<a name="l00510"></a>00510 }
<a name="l00511"></a>00511 }
<a name="l00512"></a>00512
<a name="l00513"></a>00513 <span class="preprocessor">#endif </span><span class="comment">/* CH_HAL_USE_PWM */</span>
<a name="l00514"></a>00514 <span class="comment"></span>
<a name="l00515"></a>00515 <span class="comment">/** @} */</span>
</pre></div></div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Oct 24 2010 09:40:37 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.1</small></address>
</body>
</html>

View File

@@ -1,106 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: pwm_lld.h File Reference</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>pwm_lld.h File Reference</h1> </div>
</div>
<div class="contents">
<p>STM32 PWM subsystem low level driver header.
<a href="#_details">More...</a></p>
<p><a href="platforms_2_s_t_m32_2pwm__lld_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_w_m_channel_config.html">PWMChannelConfig</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM driver channel configuration structure. <a href="struct_p_w_m_channel_config.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_w_m_config.html">PWMConfig</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Driver configuration structure. <a href="struct_p_w_m_config.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_w_m_driver.html">PWMDriver</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Structure representing an PWM driver. <a href="struct_p_w_m_driver.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga312588cf680d50931666643dea45bb13">PWM_CHANNELS</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of PWM channels per PWM driver. <a href="group___s_t_m32___p_w_m.html#ga312588cf680d50931666643dea45bb13"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga0fe5257a5ba79302dce9df6d50de9364">USE_STM32_PWM1</a>&nbsp;&nbsp;&nbsp;TRUE</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM1 driver enable switch. <a href="group___s_t_m32___p_w_m.html#ga0fe5257a5ba79302dce9df6d50de9364"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#gac7e757e9d0af908f7e06ab5221f30aa2">USE_STM32_PWM2</a>&nbsp;&nbsp;&nbsp;TRUE</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM2 driver enable switch. <a href="group___s_t_m32___p_w_m.html#gac7e757e9d0af908f7e06ab5221f30aa2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#gaf1306b9ade0a6771eaa967feeeb075f3">USE_STM32_PWM3</a>&nbsp;&nbsp;&nbsp;TRUE</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM3 driver enable switch. <a href="group___s_t_m32___p_w_m.html#gaf1306b9ade0a6771eaa967feeeb075f3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#gae2f2fa3291ecf36f8f270efa25d4e044">USE_STM32_PWM4</a>&nbsp;&nbsp;&nbsp;TRUE</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM4 driver enable switch. <a href="group___s_t_m32___p_w_m.html#gae2f2fa3291ecf36f8f270efa25d4e044"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#gac800997848ce5e6c707372390d945c7c">STM32_PWM1_IRQ_PRIORITY</a>&nbsp;&nbsp;&nbsp;7</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM1 interrupt priority level setting. <a href="group___s_t_m32___p_w_m.html#gac800997848ce5e6c707372390d945c7c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga0215547b5c9692aa9d6af10e46639f29">STM32_PWM2_IRQ_PRIORITY</a>&nbsp;&nbsp;&nbsp;7</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM2 interrupt priority level setting. <a href="group___s_t_m32___p_w_m.html#ga0215547b5c9692aa9d6af10e46639f29"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga5dc025c64957640f0bd42460648c835a">STM32_PWM3_IRQ_PRIORITY</a>&nbsp;&nbsp;&nbsp;7</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM3 interrupt priority level setting. <a href="group___s_t_m32___p_w_m.html#ga5dc025c64957640f0bd42460648c835a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#gafacc8948371fb7804b5c6cbb2a0aacd8">STM32_PWM4_IRQ_PRIORITY</a>&nbsp;&nbsp;&nbsp;7</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM4 interrupt priority level setting. <a href="group___s_t_m32___p_w_m.html#gafacc8948371fb7804b5c6cbb2a0aacd8"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM channel type. <a href="group___s_t_m32___p_w_m.html#ga605a8a67c0f1cf38cecfcfada45b28b5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#gaef1826611f5a65369e9e02d04e81ed61">pwmcnt_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PWM counter type. <a href="group___s_t_m32___p_w_m.html#gaef1826611f5a65369e9e02d04e81ed61"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga7cb5729a65c0996584808e4f93b28a0d">pwm_lld_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Low level PWM driver initialization. <a href="group___s_t_m32___p_w_m.html#ga7cb5729a65c0996584808e4f93b28a0d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga8a4d803d25a5326b48b3713ffd5fce53">pwm_lld_start</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configures and activates the PWM peripheral. <a href="group___s_t_m32___p_w_m.html#ga8a4d803d25a5326b48b3713ffd5fce53"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga48b759363af69a6aaee37a362ed5bfd2">pwm_lld_stop</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deactivates the PWM peripheral. <a href="group___s_t_m32___p_w_m.html#ga48b759363af69a6aaee37a362ed5bfd2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga8c6320208680a823925d2816856437cc">pwm_lld_enable_channel</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp, <a class="el" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a> channel, <a class="el" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61">pwmcnt_t</a> width)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables a PWM channel. <a href="group___s_t_m32___p_w_m.html#ga8c6320208680a823925d2816856437cc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_t_m32___p_w_m.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8">pwm_lld_disable_channel</a> (<a class="el" href="struct_p_w_m_driver.html">PWMDriver</a> *pwmp, <a class="el" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">pwmchannel_t</a> channel)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disables a PWM channel. <a href="group___s_t_m32___p_w_m.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>STM32 PWM subsystem low level driver header. </p>
<p>Definition in file <a class="el" href="platforms_2_s_t_m32_2pwm__lld_8h_source.html">platforms/STM32/pwm_lld.h</a>.</p>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Oct 24 2010 09:40:38 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.1</small></address>
</body>
</html>

View File

@@ -1,296 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: pwm_lld.h Source File</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>pwm_lld.h</h1> </div>
</div>
<div class="contents">
<a href="platforms_2_s_t_m32_2pwm__lld_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment"> This file is part of ChibiOS/RT.</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment"> ChibiOS/RT is free software; you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> the Free Software Foundation; either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment"> ChibiOS/RT is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00014"></a>00014 <span class="comment"> GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment"> ---</span>
<a name="l00020"></a>00020 <span class="comment"></span>
<a name="l00021"></a>00021 <span class="comment"> A special exception to the GPL can be applied should you wish to distribute</span>
<a name="l00022"></a>00022 <span class="comment"> a combined work that includes ChibiOS/RT, without being obliged to provide</span>
<a name="l00023"></a>00023 <span class="comment"> the source code for any proprietary components. See the file exception.txt</span>
<a name="l00024"></a>00024 <span class="comment"> for full details of how and when the exception can be applied.</span>
<a name="l00025"></a>00025 <span class="comment">*/</span>
<a name="l00026"></a>00026 <span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">/**</span>
<a name="l00028"></a>00028 <span class="comment"> * @file STM32/pwm_lld.h</span>
<a name="l00029"></a>00029 <span class="comment"> * @brief STM32 PWM subsystem low level driver header.</span>
<a name="l00030"></a>00030 <span class="comment"> * @addtogroup STM32_PWM</span>
<a name="l00031"></a>00031 <span class="comment"> * @{</span>
<a name="l00032"></a>00032 <span class="comment"> */</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="preprocessor">#ifndef _PWM_LLD_H_</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define _PWM_LLD_H_</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#if CH_HAL_USE_PWM || defined(__DOXYGEN__)</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="comment">/*===========================================================================*/</span>
<a name="l00040"></a>00040 <span class="comment">/* Driver constants. */</span>
<a name="l00041"></a>00041 <span class="comment">/*===========================================================================*/</span>
<a name="l00042"></a>00042 <span class="comment"></span>
<a name="l00043"></a>00043 <span class="comment">/**</span>
<a name="l00044"></a>00044 <span class="comment"> * @brief Number of PWM channels per PWM driver.</span>
<a name="l00045"></a>00045 <span class="comment"> */</span>
<a name="l00046"></a><a class="code" href="group___s_t_m32___p_w_m.html#ga312588cf680d50931666643dea45bb13">00046</a> <span class="preprocessor">#define PWM_CHANNELS 4</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="comment">/*===========================================================================*/</span>
<a name="l00049"></a>00049 <span class="comment">/* Driver pre-compile time settings. */</span>
<a name="l00050"></a>00050 <span class="comment">/*===========================================================================*/</span>
<a name="l00051"></a>00051 <span class="comment"></span>
<a name="l00052"></a>00052 <span class="comment">/**</span>
<a name="l00053"></a>00053 <span class="comment"> * @brief PWM1 driver enable switch.</span>
<a name="l00054"></a>00054 <span class="comment"> * @details If set to @p TRUE the support for PWM1 is included.</span>
<a name="l00055"></a>00055 <span class="comment"> * @note The default is @p TRUE.</span>
<a name="l00056"></a>00056 <span class="comment"> */</span>
<a name="l00057"></a>00057 <span class="preprocessor">#if !defined(USE_STM32_PWM1) || defined(__DOXYGEN__)</span>
<a name="l00058"></a><a class="code" href="group___s_t_m32___p_w_m.html#ga0fe5257a5ba79302dce9df6d50de9364">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define USE_STM32_PWM1 TRUE</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">/**</span>
<a name="l00062"></a>00062 <span class="comment"> * @brief PWM2 driver enable switch.</span>
<a name="l00063"></a>00063 <span class="comment"> * @details If set to @p TRUE the support for PWM2 is included.</span>
<a name="l00064"></a>00064 <span class="comment"> * @note The default is @p TRUE.</span>
<a name="l00065"></a>00065 <span class="comment"> */</span>
<a name="l00066"></a>00066 <span class="preprocessor">#if !defined(USE_STM32_PWM2) || defined(__DOXYGEN__)</span>
<a name="l00067"></a><a class="code" href="group___s_t_m32___p_w_m.html#gac7e757e9d0af908f7e06ab5221f30aa2">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define USE_STM32_PWM2 TRUE</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00070"></a>00070 <span class="comment">/**</span>
<a name="l00071"></a>00071 <span class="comment"> * @brief PWM3 driver enable switch.</span>
<a name="l00072"></a>00072 <span class="comment"> * @details If set to @p TRUE the support for PWM3 is included.</span>
<a name="l00073"></a>00073 <span class="comment"> * @note The default is @p TRUE.</span>
<a name="l00074"></a>00074 <span class="comment"> */</span>
<a name="l00075"></a>00075 <span class="preprocessor">#if !defined(USE_STM32_PWM3) || defined(__DOXYGEN__)</span>
<a name="l00076"></a><a class="code" href="group___s_t_m32___p_w_m.html#gaf1306b9ade0a6771eaa967feeeb075f3">00076</a> <span class="preprocessor"></span><span class="preprocessor">#define USE_STM32_PWM3 TRUE</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">/**</span>
<a name="l00080"></a>00080 <span class="comment"> * @brief PWM4 driver enable switch.</span>
<a name="l00081"></a>00081 <span class="comment"> * @details If set to @p TRUE the support for PWM4 is included.</span>
<a name="l00082"></a>00082 <span class="comment"> * @note The default is @p TRUE.</span>
<a name="l00083"></a>00083 <span class="comment"> */</span>
<a name="l00084"></a>00084 <span class="preprocessor">#if !defined(USE_STM32_PWM4) || defined(__DOXYGEN__)</span>
<a name="l00085"></a><a class="code" href="group___s_t_m32___p_w_m.html#gae2f2fa3291ecf36f8f270efa25d4e044">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define USE_STM32_PWM4 TRUE</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00088"></a>00088 <span class="comment">/**</span>
<a name="l00089"></a>00089 <span class="comment"> * @brief PWM1 interrupt priority level setting.</span>
<a name="l00090"></a>00090 <span class="comment"> */</span>
<a name="l00091"></a>00091 <span class="preprocessor">#if !defined(STM32_PWM1_IRQ_PRIORITY) || defined(__DOXYGEN__)</span>
<a name="l00092"></a><a class="code" href="group___s_t_m32___p_w_m.html#gac800997848ce5e6c707372390d945c7c">00092</a> <span class="preprocessor"></span><span class="preprocessor">#define STM32_PWM1_IRQ_PRIORITY 7</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00095"></a>00095 <span class="comment">/**</span>
<a name="l00096"></a>00096 <span class="comment"> * @brief PWM2 interrupt priority level setting.</span>
<a name="l00097"></a>00097 <span class="comment"> */</span>
<a name="l00098"></a>00098 <span class="preprocessor">#if !defined(STM32_PWM2_IRQ_PRIORITY) || defined(__DOXYGEN__)</span>
<a name="l00099"></a><a class="code" href="group___s_t_m32___p_w_m.html#ga0215547b5c9692aa9d6af10e46639f29">00099</a> <span class="preprocessor"></span><span class="preprocessor">#define STM32_PWM2_IRQ_PRIORITY 7</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00102"></a>00102 <span class="comment">/**</span>
<a name="l00103"></a>00103 <span class="comment"> * @brief PWM3 interrupt priority level setting.</span>
<a name="l00104"></a>00104 <span class="comment"> */</span>
<a name="l00105"></a>00105 <span class="preprocessor">#if !defined(STM32_PWM3_IRQ_PRIORITY) || defined(__DOXYGEN__)</span>
<a name="l00106"></a><a class="code" href="group___s_t_m32___p_w_m.html#ga5dc025c64957640f0bd42460648c835a">00106</a> <span class="preprocessor"></span><span class="preprocessor">#define STM32_PWM3_IRQ_PRIORITY 7</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00109"></a>00109 <span class="comment">/**</span>
<a name="l00110"></a>00110 <span class="comment"> * @brief PWM4 interrupt priority level setting.</span>
<a name="l00111"></a>00111 <span class="comment"> */</span>
<a name="l00112"></a>00112 <span class="preprocessor">#if !defined(STM32_PWM4_IRQ_PRIORITY) || defined(__DOXYGEN__)</span>
<a name="l00113"></a><a class="code" href="group___s_t_m32___p_w_m.html#gafacc8948371fb7804b5c6cbb2a0aacd8">00113</a> <span class="preprocessor"></span><span class="preprocessor">#define STM32_PWM4_IRQ_PRIORITY 7</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>
<a name="l00116"></a>00116 <span class="comment">/*===========================================================================*/</span>
<a name="l00117"></a>00117 <span class="comment">/* Configuration checks. */</span>
<a name="l00118"></a>00118 <span class="comment">/*===========================================================================*/</span>
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="preprocessor">#if USE_STM32_PWM4 &amp;&amp; defined(STM32F10X_LD)</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="preprocessor">#error &quot;TIM4 not present in low density STM32 devices&quot;</span>
<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00123"></a>00123 <span class="preprocessor"></span>
<a name="l00124"></a>00124 <span class="comment">/*===========================================================================*/</span>
<a name="l00125"></a>00125 <span class="comment">/* Driver data structures and types. */</span>
<a name="l00126"></a>00126 <span class="comment">/*===========================================================================*/</span>
<a name="l00127"></a>00127 <span class="comment"></span>
<a name="l00128"></a>00128 <span class="comment">/**</span>
<a name="l00129"></a>00129 <span class="comment"> * @brief PWM channel type.</span>
<a name="l00130"></a>00130 <span class="comment"> */</span>
<a name="l00131"></a><a class="code" href="group___s_t_m32___p_w_m.html#ga605a8a67c0f1cf38cecfcfada45b28b5">00131</a> <span class="keyword">typedef</span> <a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> pwmchannel_t;
<a name="l00132"></a>00132 <span class="comment"></span>
<a name="l00133"></a>00133 <span class="comment">/**</span>
<a name="l00134"></a>00134 <span class="comment"> * @brief PWM counter type.</span>
<a name="l00135"></a>00135 <span class="comment"> */</span>
<a name="l00136"></a><a class="code" href="group___s_t_m32___p_w_m.html#gaef1826611f5a65369e9e02d04e81ed61">00136</a> <span class="keyword">typedef</span> <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> pwmcnt_t;
<a name="l00137"></a>00137 <span class="comment"></span>
<a name="l00138"></a>00138 <span class="comment">/**</span>
<a name="l00139"></a>00139 <span class="comment"> * @brief PWM driver channel configuration structure.</span>
<a name="l00140"></a>00140 <span class="comment"> * @note It could be empty on some architectures.</span>
<a name="l00141"></a>00141 <span class="comment"> */</span>
<a name="l00142"></a><a class="code" href="struct_p_w_m_channel_config.html">00142</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span>
<a name="l00143"></a>00143 <span class="comment"> /**</span>
<a name="l00144"></a>00144 <span class="comment"> * @brief Channel active logic level.</span>
<a name="l00145"></a>00145 <span class="comment"> */</span>
<a name="l00146"></a><a class="code" href="struct_p_w_m_channel_config.html#ae11e4f30de426d95a22c22a65ab0408c">00146</a> <a class="code" href="group___p_w_m.html#gaaa2db6a7be396595dcf16da3f94634a0" title="PWM logic mode.">pwmmode_t</a> pcc_mode;<span class="comment"></span>
<a name="l00147"></a>00147 <span class="comment"> /**</span>
<a name="l00148"></a>00148 <span class="comment"> * @brief Channel callback pointer.</span>
<a name="l00149"></a>00149 <span class="comment"> * @details This callback is invoked on the channel compare event. If set to</span>
<a name="l00150"></a>00150 <span class="comment"> * @p NULL then the callback is disabled.</span>
<a name="l00151"></a>00151 <span class="comment"> */</span>
<a name="l00152"></a><a class="code" href="struct_p_w_m_channel_config.html#a092221365865144cb12fa7e2c2e55c3a">00152</a> <a class="code" href="group___p_w_m.html#gabcc836c83fc710d8caa9d61f79f69962" title="PWM notification callback type.">pwmcallback_t</a> pcc_callback;
<a name="l00153"></a>00153 <span class="comment">/* End of the mandatory fields.*/</span>
<a name="l00154"></a>00154 } <a class="code" href="struct_p_w_m_channel_config.html" title="PWM driver channel configuration structure.">PWMChannelConfig</a>;
<a name="l00155"></a>00155 <span class="comment"></span>
<a name="l00156"></a>00156 <span class="comment">/**</span>
<a name="l00157"></a>00157 <span class="comment"> * @brief PWM driver configuration structure.</span>
<a name="l00158"></a>00158 <span class="comment"> * @note It could be empty on some architectures.</span>
<a name="l00159"></a>00159 <span class="comment"> */</span>
<a name="l00160"></a>00160 <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span>
<a name="l00161"></a>00161 <span class="comment"> /**</span>
<a name="l00162"></a>00162 <span class="comment"> * @brief Periodic callback pointer.</span>
<a name="l00163"></a>00163 <span class="comment"> * @details This callback is invoked on PWM counter reset. If set to</span>
<a name="l00164"></a>00164 <span class="comment"> * @p NULL then the callback is disabled.</span>
<a name="l00165"></a>00165 <span class="comment"> */</span>
<a name="l00166"></a><a class="code" href="struct_p_w_m_config.html#a5543b74e75ec8598f0bc5878fdcfacf2">00166</a> <a class="code" href="group___p_w_m.html#gabcc836c83fc710d8caa9d61f79f69962" title="PWM notification callback type.">pwmcallback_t</a> pc_callback;<span class="comment"></span>
<a name="l00167"></a>00167 <span class="comment"> /**</span>
<a name="l00168"></a>00168 <span class="comment"> * @brief Channels configurations.</span>
<a name="l00169"></a>00169 <span class="comment"> */</span>
<a name="l00170"></a><a class="code" href="struct_p_w_m_config.html#a575942659d79d32c8f78e75e135458ef">00170</a> <a class="code" href="struct_p_w_m_channel_config.html" title="PWM driver channel configuration structure.">PWMChannelConfig</a> pc_channels[PWM_CHANNELS];
<a name="l00171"></a>00171 <span class="comment">/* End of the mandatory fields.*/</span><span class="comment"></span>
<a name="l00172"></a>00172 <span class="comment"> /**</span>
<a name="l00173"></a>00173 <span class="comment"> * @brief TIM PSC (pre-scaler) register initialization data.</span>
<a name="l00174"></a>00174 <span class="comment"> */</span>
<a name="l00175"></a><a class="code" href="struct_p_w_m_config.html#ac393e708ea08dc7d5c9714be8fef35db">00175</a> <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> pc_psc;<span class="comment"></span>
<a name="l00176"></a>00176 <span class="comment"> /**</span>
<a name="l00177"></a>00177 <span class="comment"> * @brief TIM ARR (auto-reload) register initialization data.</span>
<a name="l00178"></a>00178 <span class="comment"> */</span>
<a name="l00179"></a><a class="code" href="struct_p_w_m_config.html#a883f1938e1e6af6759a7a7e9f459a8ca">00179</a> <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> pc_arr;<span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment"> /**</span>
<a name="l00181"></a>00181 <span class="comment"> * @brief TIM CR2 register initialization data.</span>
<a name="l00182"></a>00182 <span class="comment"> * @note The value of this field should normally be equal to zero.</span>
<a name="l00183"></a>00183 <span class="comment"> */</span>
<a name="l00184"></a><a class="code" href="struct_p_w_m_config.html#ad505b6cbea937cc878584f50875437d7">00184</a> <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> pc_cr2;
<a name="l00185"></a>00185 } <a class="code" href="struct_p_w_m_config.html" title="Driver configuration structure.">PWMConfig</a>;
<a name="l00186"></a>00186 <span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">/**</span>
<a name="l00188"></a>00188 <span class="comment"> * @brief Structure representing a PWM driver.</span>
<a name="l00189"></a>00189 <span class="comment"> */</span>
<a name="l00190"></a>00190 <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span>
<a name="l00191"></a>00191 <span class="comment"> /**</span>
<a name="l00192"></a>00192 <span class="comment"> * @brief Driver state.</span>
<a name="l00193"></a>00193 <span class="comment"> */</span>
<a name="l00194"></a>00194 <a class="code" href="group___p_w_m.html#ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5" title="Driver state machine possible states.">pwmstate_t</a> pd_state;<span class="comment"></span>
<a name="l00195"></a>00195 <span class="comment"> /**</span>
<a name="l00196"></a>00196 <span class="comment"> * @brief Current driver configuration data.</span>
<a name="l00197"></a>00197 <span class="comment"> */</span>
<a name="l00198"></a>00198 <span class="keyword">const</span> <a class="code" href="struct_p_w_m_config.html" title="Driver configuration structure.">PWMConfig</a> *pd_config;
<a name="l00199"></a>00199 <span class="comment">/* End of the mandatory fields.*/</span><span class="comment"></span>
<a name="l00200"></a>00200 <span class="comment"> /**</span>
<a name="l00201"></a>00201 <span class="comment"> * @brief Bit mask of the enabled channels.</span>
<a name="l00202"></a>00202 <span class="comment"> */</span>
<a name="l00203"></a><a class="code" href="struct_p_w_m_driver.html#a2301452c1ee3ef218ff2d3cd8305913b">00203</a> <a class="code" href="group___s_t_m8___c_o_r_e.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> pd_enabled_channels;<span class="comment"></span>
<a name="l00204"></a>00204 <span class="comment"> /**</span>
<a name="l00205"></a>00205 <span class="comment"> * @brief Pointer to the TIMx registers block.</span>
<a name="l00206"></a>00206 <span class="comment"> */</span>
<a name="l00207"></a><a class="code" href="struct_p_w_m_driver.html#a166b96927bbe9f85015a7ca390c668a7">00207</a> TIM_TypeDef *pd_tim;
<a name="l00208"></a>00208 } <a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a>;
<a name="l00209"></a>00209
<a name="l00210"></a>00210 <span class="comment">/*===========================================================================*/</span>
<a name="l00211"></a>00211 <span class="comment">/* Driver macros. */</span>
<a name="l00212"></a>00212 <span class="comment">/*===========================================================================*/</span>
<a name="l00213"></a>00213
<a name="l00214"></a>00214 <span class="comment">/*===========================================================================*/</span>
<a name="l00215"></a>00215 <span class="comment">/* External declarations. */</span>
<a name="l00216"></a>00216 <span class="comment">/*===========================================================================*/</span>
<a name="l00217"></a>00217
<a name="l00218"></a>00218 <span class="preprocessor">#if defined(USE_STM32_PWM1) &amp;&amp; !defined(__DOXYGEN__)</span>
<a name="l00219"></a>00219 <span class="preprocessor"></span><span class="keyword">extern</span> <a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#gae02b0df41215cc132838d08307fedbfe" title="PWM1 driver identifier.">PWMD1</a>;
<a name="l00220"></a>00220 <span class="preprocessor">#endif</span>
<a name="l00221"></a>00221 <span class="preprocessor"></span>
<a name="l00222"></a>00222 <span class="preprocessor">#if defined(USE_STM32_PWM2) &amp;&amp; !defined(__DOXYGEN__)</span>
<a name="l00223"></a>00223 <span class="preprocessor"></span><span class="keyword">extern</span> <a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#ga2a966bea47c26c120a2f7d8a69f9801c" title="PWM2 driver identifier.">PWMD2</a>;
<a name="l00224"></a>00224 <span class="preprocessor">#endif</span>
<a name="l00225"></a>00225 <span class="preprocessor"></span>
<a name="l00226"></a>00226 <span class="preprocessor">#if defined(USE_STM32_PWM3) &amp;&amp; !defined(__DOXYGEN__)</span>
<a name="l00227"></a>00227 <span class="preprocessor"></span><span class="keyword">extern</span> <a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#gafcc6572a26270e438dfc7d32b733e823" title="PWM3 driver identifier.">PWMD3</a>;
<a name="l00228"></a>00228 <span class="preprocessor">#endif</span>
<a name="l00229"></a>00229 <span class="preprocessor"></span>
<a name="l00230"></a>00230 <span class="preprocessor">#if defined(USE_STM32_PWM4) &amp;&amp; !defined(__DOXYGEN__)</span>
<a name="l00231"></a>00231 <span class="preprocessor"></span><span class="keyword">extern</span> <a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> <a class="code" href="group___s_t_m32___p_w_m.html#gaef655f5c7a1c70e3cec051d0b5a0556c" title="PWM4 driver identifier.">PWMD4</a>;
<a name="l00232"></a>00232 <span class="preprocessor">#endif</span>
<a name="l00233"></a>00233 <span class="preprocessor"></span>
<a name="l00234"></a>00234 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00235"></a>00235 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00236"></a>00236 <span class="preprocessor">#endif</span>
<a name="l00237"></a>00237 <span class="preprocessor"></span> <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga7cb5729a65c0996584808e4f93b28a0d" title="Low level PWM driver initialization.">pwm_lld_init</a>(<span class="keywordtype">void</span>);
<a name="l00238"></a>00238 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga8a4d803d25a5326b48b3713ffd5fce53" title="Configures and activates the PWM peripheral.">pwm_lld_start</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp);
<a name="l00239"></a>00239 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga48b759363af69a6aaee37a362ed5bfd2" title="Deactivates the PWM peripheral.">pwm_lld_stop</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp);
<a name="l00240"></a>00240 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga8c6320208680a823925d2816856437cc" title="Enables a PWM channel.">pwm_lld_enable_channel</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp,
<a name="l00241"></a>00241 <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel,
<a name="l00242"></a>00242 <a class="code" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61" title="PWM counter type.">pwmcnt_t</a> width);
<a name="l00243"></a>00243 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8" title="Disables a PWM channel.">pwm_lld_disable_channel</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp, <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel);
<a name="l00244"></a>00244 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00245"></a>00245 <span class="preprocessor"></span>}
<a name="l00246"></a>00246 <span class="preprocessor">#endif</span>
<a name="l00247"></a>00247 <span class="preprocessor"></span>
<a name="l00248"></a>00248 <span class="preprocessor">#endif </span><span class="comment">/* CH_HAL_USE_PWM */</span>
<a name="l00249"></a>00249
<a name="l00250"></a>00250 <span class="preprocessor">#endif </span><span class="comment">/* _PWM_LLD_H_ */</span>
<a name="l00251"></a>00251 <span class="comment"></span>
<a name="l00252"></a>00252 <span class="comment">/** @} */</span>
</pre></div></div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Oct 24 2010 09:40:37 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.1</small></address>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,165 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: pwm_lld.h Source File</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>pwm_lld.h</h1> </div>
</div>
<div class="contents">
<a href="templates_2pwm__lld_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment"> This file is part of ChibiOS/RT.</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment"> ChibiOS/RT is free software; you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> the Free Software Foundation; either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment"> ChibiOS/RT is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00014"></a>00014 <span class="comment"> GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment"> ---</span>
<a name="l00020"></a>00020 <span class="comment"></span>
<a name="l00021"></a>00021 <span class="comment"> A special exception to the GPL can be applied should you wish to distribute</span>
<a name="l00022"></a>00022 <span class="comment"> a combined work that includes ChibiOS/RT, without being obliged to provide</span>
<a name="l00023"></a>00023 <span class="comment"> the source code for any proprietary components. See the file exception.txt</span>
<a name="l00024"></a>00024 <span class="comment"> for full details of how and when the exception can be applied.</span>
<a name="l00025"></a>00025 <span class="comment">*/</span>
<a name="l00026"></a>00026 <span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">/**</span>
<a name="l00028"></a>00028 <span class="comment"> * @file templates/pwm_lld.h</span>
<a name="l00029"></a>00029 <span class="comment"> * @brief PWM Driver subsystem low level driver header template.</span>
<a name="l00030"></a>00030 <span class="comment"> *</span>
<a name="l00031"></a>00031 <span class="comment"> * @addtogroup PWM_LLD</span>
<a name="l00032"></a>00032 <span class="comment"> * @{</span>
<a name="l00033"></a>00033 <span class="comment"> */</span>
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="preprocessor">#ifndef _PWM_LLD_H_</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define _PWM_LLD_H_</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a>00038 <span class="comment">/*===========================================================================*/</span>
<a name="l00039"></a>00039 <span class="comment">/* Driver constants. */</span>
<a name="l00040"></a>00040 <span class="comment">/*===========================================================================*/</span>
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="comment">/*===========================================================================*/</span>
<a name="l00043"></a>00043 <span class="comment">/* Driver pre-compile time settings. */</span>
<a name="l00044"></a>00044 <span class="comment">/*===========================================================================*/</span>
<a name="l00045"></a>00045 <span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment">/**</span>
<a name="l00047"></a>00047 <span class="comment"> * @brief Number of PWM channels per PWM driver.</span>
<a name="l00048"></a>00048 <span class="comment"> */</span>
<a name="l00049"></a>00049 <span class="preprocessor">#if !defined(PWM_CHANNELS) || defined(__DOXYGEN__)</span>
<a name="l00050"></a><a class="code" href="group___p_w_m___l_l_d.html#ga312588cf680d50931666643dea45bb13">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define PWM_CHANNELS 1</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span>
<a name="l00053"></a>00053 <span class="comment">/*===========================================================================*/</span>
<a name="l00054"></a>00054 <span class="comment">/* Derived constants and error checks. */</span>
<a name="l00055"></a>00055 <span class="comment">/*===========================================================================*/</span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="comment">/*===========================================================================*/</span>
<a name="l00058"></a>00058 <span class="comment">/* Driver data structures and types. */</span>
<a name="l00059"></a>00059 <span class="comment">/*===========================================================================*/</span>
<a name="l00060"></a>00060 <span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">/**</span>
<a name="l00062"></a>00062 <span class="comment"> * @brief PWM channel type.</span>
<a name="l00063"></a>00063 <span class="comment"> */</span>
<a name="l00064"></a><a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5">00064</a> <span class="keyword">typedef</span> <a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> pwmchannel_t;
<a name="l00065"></a>00065 <span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">/**</span>
<a name="l00067"></a>00067 <span class="comment"> * @brief PWM counter type.</span>
<a name="l00068"></a>00068 <span class="comment"> */</span>
<a name="l00069"></a><a class="code" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61">00069</a> <span class="keyword">typedef</span> <a class="code" href="group___s_t_m8___c_o_r_e.html#ga1f1825b69244eb3ad2c7165ddc99c956">uint16_t</a> pwmcnt_t;
<a name="l00070"></a>00070 <span class="comment"></span>
<a name="l00071"></a>00071 <span class="comment">/**</span>
<a name="l00072"></a>00072 <span class="comment"> * @brief Driver configuration structure.</span>
<a name="l00073"></a>00073 <span class="comment"> * @note It could be empty on some architectures.</span>
<a name="l00074"></a>00074 <span class="comment"> */</span>
<a name="l00075"></a><a class="code" href="struct_p_w_m_config.html">00075</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00076"></a>00076
<a name="l00077"></a>00077 } <a class="code" href="struct_p_w_m_config.html" title="Driver configuration structure.">PWMConfig</a>;
<a name="l00078"></a>00078 <span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">/**</span>
<a name="l00080"></a>00080 <span class="comment"> * @brief Structure representing an PWM driver.</span>
<a name="l00081"></a>00081 <span class="comment"> */</span>
<a name="l00082"></a><a class="code" href="struct_p_w_m_driver.html">00082</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span>
<a name="l00083"></a>00083 <span class="comment"> /**</span>
<a name="l00084"></a>00084 <span class="comment"> * @brief Driver state.</span>
<a name="l00085"></a>00085 <span class="comment"> */</span>
<a name="l00086"></a><a class="code" href="struct_p_w_m_driver.html#a773d182992e086ff89dd85d2f5e17dea">00086</a> <a class="code" href="group___p_w_m.html#ga9b63d6f4d51e8ca9ee1fce2a1bc86bc5" title="Driver state machine possible states.">pwmstate_t</a> pd_state;<span class="comment"></span>
<a name="l00087"></a>00087 <span class="comment"> /**</span>
<a name="l00088"></a>00088 <span class="comment"> * @brief Current configuration data.</span>
<a name="l00089"></a>00089 <span class="comment"> */</span>
<a name="l00090"></a><a class="code" href="struct_p_w_m_driver.html#a45bb852cfb3b30143315632e74703cb8">00090</a> <span class="keyword">const</span> <a class="code" href="struct_p_w_m_config.html" title="Driver configuration structure.">PWMConfig</a> *pd_config;
<a name="l00091"></a>00091 <span class="comment">/* End of the mandatory fields.*/</span>
<a name="l00092"></a>00092 } <a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a>;
<a name="l00093"></a>00093
<a name="l00094"></a>00094 <span class="comment">/*===========================================================================*/</span>
<a name="l00095"></a>00095 <span class="comment">/* Driver macros. */</span>
<a name="l00096"></a>00096 <span class="comment">/*===========================================================================*/</span>
<a name="l00097"></a>00097
<a name="l00098"></a>00098 <span class="comment">/*===========================================================================*/</span>
<a name="l00099"></a>00099 <span class="comment">/* External declarations. */</span>
<a name="l00100"></a>00100 <span class="comment">/*===========================================================================*/</span>
<a name="l00101"></a>00101
<a name="l00102"></a>00102 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00104"></a>00104 <span class="preprocessor">#endif</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span> <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga7cb5729a65c0996584808e4f93b28a0d" title="Low level PWM driver initialization.">pwm_lld_init</a>(<span class="keywordtype">void</span>);
<a name="l00106"></a>00106 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga8a4d803d25a5326b48b3713ffd5fce53" title="Configures and activates the PWM peripheral.">pwm_lld_start</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp);
<a name="l00107"></a>00107 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga48b759363af69a6aaee37a362ed5bfd2" title="Deactivates the PWM peripheral.">pwm_lld_stop</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp);
<a name="l00108"></a>00108 <a class="code" href="group__types.html#ga7556af1cb61728b53228fa3af1c851de" title="Boolean, recommended the fastest signed.">bool_t</a> <a class="code" href="group___p_w_m___l_l_d.html#ga4249803bf9606fa509379004dbd291bb" title="Determines whatever the PWM channel is already enabled.">pwm_lld_is_enabled</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp, <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel);
<a name="l00109"></a>00109 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga85026e63dc788e377958f9566f21c9f5" title="Enables a callback mode for the specified PWM channel.">pwm_lld_set_callback</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp, <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel,
<a name="l00110"></a>00110 pwmedge_t edge, <a class="code" href="group___p_w_m.html#gabcc836c83fc710d8caa9d61f79f69962" title="PWM notification callback type.">pwmcallback_t</a> callback);
<a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga8c6320208680a823925d2816856437cc" title="Enables a PWM channel.">pwm_lld_enable_channel</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp,
<a name="l00112"></a>00112 <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel,
<a name="l00113"></a>00113 <a class="code" href="group___p_w_m___l_l_d.html#gaef1826611f5a65369e9e02d04e81ed61" title="PWM counter type.">pwmcnt_t</a> width);
<a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="group___p_w_m___l_l_d.html#ga78cb61d7ea9fc996e3c2adec3f37cfd8" title="Disables a PWM channel.">pwm_lld_disable_channel</a>(<a class="code" href="struct_p_w_m_driver.html" title="Structure representing an PWM driver.">PWMDriver</a> *pwmp, <a class="code" href="group___p_w_m___l_l_d.html#ga605a8a67c0f1cf38cecfcfada45b28b5" title="PWM channel type.">pwmchannel_t</a> channel);
<a name="l00115"></a>00115 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>}
<a name="l00117"></a>00117 <span class="preprocessor">#endif</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span>
<a name="l00119"></a>00119 <span class="preprocessor">#endif </span><span class="comment">/* _PWM_LLD_H_ */</span>
<a name="l00120"></a>00120 <span class="comment"></span>
<a name="l00121"></a>00121 <span class="comment">/** @} */</span>
</pre></div></div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Oct 24 2010 09:40:37 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.1</small></address>
</body>
</html>

View File

@@ -1,121 +0,0 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
---
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes ChibiOS/RT, without being obliged to provide
the source code for any proprietary components. See the file exception.txt
for full details of how and when the exception can be applied.
*/
/**
* @file templates/pwm_lld.h
* @brief PWM Driver subsystem low level driver header template.
*
* @addtogroup PWM_LLD
* @{
*/
#ifndef _PWM_LLD_H_
#define _PWM_LLD_H_
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
/**
* @brief Number of PWM channels per PWM driver.
*/
#if !defined(PWM_CHANNELS) || defined(__DOXYGEN__)
#define PWM_CHANNELS 1
#endif
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
/**
* @brief PWM channel type.
*/
typedef uint8_t pwmchannel_t;
/**
* @brief PWM counter type.
*/
typedef uint16_t pwmcnt_t;
/**
* @brief Driver configuration structure.
* @note It could be empty on some architectures.
*/
typedef struct {
} PWMConfig;
/**
* @brief Structure representing an PWM driver.
*/
typedef struct {
/**
* @brief Driver state.
*/
pwmstate_t pd_state;
/**
* @brief Current configuration data.
*/
const PWMConfig *pd_config;
/* End of the mandatory fields.*/
} PWMDriver;
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
#ifdef __cplusplus
extern "C" {
#endif
void pwm_lld_init(void);
void pwm_lld_start(PWMDriver *pwmp);
void pwm_lld_stop(PWMDriver *pwmp);
bool_t pwm_lld_is_enabled(PWMDriver *pwmp, pwmchannel_t channel);
void pwm_lld_set_callback(PWMDriver *pwmp, pwmchannel_t channel,
pwmedge_t edge, pwmcallback_t callback);
void pwm_lld_enable_channel(PWMDriver *pwmp,
pwmchannel_t channel,
pwmcnt_t width);
void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel);
#ifdef __cplusplus
}
#endif
#endif /* _PWM_LLD_H_ */
/** @} */

View File

@@ -28,14 +28,14 @@
#define _BOARD_H_
/*
* Setup for the Olimex LCP-P2148 proto board.
* Setup for the Olimex LPC-P2148 proto board.
*/
/*
* Board identifier.
*/
#define BOARD_OLIMEX_LCP_P2148
#define BOARD_NAME "Olimex LCP-P2148"
#define BOARD_OLIMEX_LPC_P2148
#define BOARD_NAME "Olimex LPC-P2148"
/*
* The following values are implementation dependent. You may change them in

Some files were not shown because too many files have changed in this diff Show More