📄 speed__cntr_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>AVR446 - Linear speed control of stepper motor: speed_cntr.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div><h1>speed_cntr.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>Header file for <a class="el" href="speed__cntr_8c.html">speed_cntr.c</a>. <p><ul><li>File: <a class="el" href="speed__cntr_8h.html">speed_cntr.h</a></li><li>Compiler: IAR EWAAVR 4.11A</li><li>Supported devices: All devices with a 16 bit timer can be used. The example is written for ATmega48</li><li>AppNote: AVR446 - Linear speed control of stepper motor</li></ul><p><dl compact><dt><b>Author:</b></dt><dd>Atmel Corporation: <a href="http://www.atmel.com">http://www.atmel.com</a> <br> Support email: <a href="mailto:avr@atmel.com">avr@atmel.com</a></dd></dl><dl compact><dt><b>Name</b></dt><dd>RELEASE_1_0 </dd></dl><dl compact><dt><b>Revision</b></dt><dd>1.2 </dd></dl><dl compact><dt><b>RCSfile</b></dt><dd><a class="el" href="speed__cntr_8h.html">speed_cntr.h</a>,v </dd></dl><dl compact><dt><b>Date</b></dt><dd>2006/05/08 12:25:58 </dd></dl><p>Definition in file <a class="el" href="speed__cntr_8h-source.html">speed_cntr.h</a>.<p><p>This graph shows which files directly or indirectly include this file:<p><center><img src="speed__cntr_8h__dep__incl.png" border="0" usemap="#speed_cntr.hdep_map" alt="Included by dependency graph"></center><map name="speed_cntr.hdep_map"><area href="main_8c.html" shape="rect" coords="7,7,68,34" alt=""><area href="speed__cntr_8c.html" shape="rect" coords="92,7,188,34" alt=""><area href="uart_8c.html" shape="rect" coords="212,7,268,34" alt=""></map><p><a href="speed__cntr_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Data Structures</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>struct </td><td class="memItemRight" valign=bottom><a class="el" href="structspeedRampData.html">speedRampData</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Holding data used by timer interrupt for speed ramp calculation. <a href="structspeedRampData.html#_details">More...</a><br><br></td></tr><tr><td colspan=2><br><h2>Defines</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a5">A_SQ</a> (long)(ALPHA*2*10000000000)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a3">A_T_x100</a> ((long)(ALPHA*T1_FREQ*100))</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a6">A_x20000</a> (int)(ALPHA*20000)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a8">ACCEL</a> 1</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a2">ALPHA</a> (2*3.14159/SPR)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a9">DECEL</a> 2</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a1">FSPR</a> 200</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Number of (full)steps per round on stepper motor in use. <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a10">RUN</a> 3</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a7">STOP</a> 0</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a0">T1_FREQ</a> 460750</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a4">T1_FREQ_148</a> ((int)((T1_FREQ*0.676)/100))</td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a15">min</a> (unsigned int x, unsigned int y)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Find minimum value. <a href="#a15"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a13">speed_cntr_Init_Timer1</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Init of Timer/Counter1. <a href="#a13"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a12">speed_cntr_Move</a> (signed int step, unsigned int accel, unsigned int decel, unsigned int speed)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Move the stepper motor a given number of steps. <a href="#a12"></a><br><br></td></tr><tr><td colspan=2><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structGLOBAL__FLAGS.html">GLOBAL_FLAGS</a> </td><td class="memItemRight" valign=bottom><a class="el" href="speed__cntr_8h.html#a11">status</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Global status flags. <a href="#a11"></a><br><br></td></tr></table><hr><h2>Define Documentation</h2><a class="anchor" name="a5" doxytag="speed_cntr.h::A_SQ" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define A_SQ (long)(ALPHA*2*10000000000) </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="speed__cntr_8h-source.html#l00076">76</a> of file <a class="el" href="speed__cntr_8h-source.html">speed_cntr.h</a>.<p>Referenced by <a class="el" href="speed__cntr_8c-source.html#l00046">speed_cntr_Move()</a>. </td> </tr></table><a class="anchor" name="a3" doxytag="speed_cntr.h::A_T_x100" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define A_T_x100 ((long)(ALPHA*T1_FREQ*100)) </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="speed__cntr_8h-source.html#l00074">74</a> of file <a class="el" href="speed__cntr_8h-source.html">speed_cntr.h</a>.<p>Referenced by <a class="el" href="speed__cntr_8c-source.html#l00046">speed_cntr_Move()</a>. </td> </tr></table><a class="anchor" name="a6" doxytag="speed_cntr.h::A_x20000" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define A_x20000 (int)(ALPHA*20000) </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="speed__cntr_8h-source.html#l00077">77</a> of file <a class="el" href="speed__cntr_8h-source.html">speed_cntr.h</a>.<p>Referenced by <a class="el" href="speed__cntr_8c-source.html#l00046">speed_cntr_Move()</a>. </td> </tr></table><a class="anchor" name="a8" doxytag="speed_cntr.h::ACCEL" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ACCEL 1 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="speed__cntr_8h-source.html#l00081">81</a> of file <a class="el" href="speed__cntr_8h-source.html">speed_cntr.h</a>.<p>Referenced by <a class="el" href="speed__cntr_8c-source.html#l00046">speed_cntr_Move()</a>, and <a class="el" href="speed__cntr_8c-source.html#l00164">speed_cntr_TIMER1_COMPA_interrupt()</a>. </td> </tr></table><a class="anchor" name="a2" doxytag="speed_cntr.h::ALPHA" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ALPHA (2*3.14159/SPR) </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="speed__cntr_8h-source.html#l00073">73</a> of file <a class="el" href="speed__cntr_8h-source.html">speed_cntr.h</a>. </td> </tr></table><a class="anchor" name="a9" doxytag="speed_cntr.h::DECEL" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define DECEL 2 </td> </tr> </table> </td> </tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -