⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer128_8h-source.html

📁 ATMEL的AVR单片机库文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
00192 <span class="comment"></span>u16  <a class="code" href="timer128_8c.html#a21">timer3GetPrescaler</a>(<span class="keywordtype">void</span>);              <span class="comment">///&lt; get timer3 prescaler division rate</span>00193 <span class="comment"></span>00194 00195 <span class="comment">// TimerAttach and Detach commands</span>00196 <span class="comment">//      These functions allow the attachment (or detachment) of any user function</span>00197 <span class="comment">//      to a timer interrupt.  "Attaching" one of your own functions to a timer</span>00198 <span class="comment">//      interrupt means that it will be called whenever that interrupt happens.</span>00199 <span class="comment">//      Using attach is better than rewriting the actual INTERRUPT() function</span>00200 <span class="comment">//      because your code will still work and be compatible if the timer library</span>00201 <span class="comment">//      is updated.  Also, using Attach allows your code and any predefined timer</span>00202 <span class="comment">//      code to work together and at the same time.  (ie. "attaching" your own</span>00203 <span class="comment">//      function to the timer0 overflow doesn't prevent timerPause from working,</span>00204 <span class="comment">//      but rather allows you to share the interrupt.)</span>00205 <span class="comment">//</span>00206 <span class="comment">//      timerAttach(TIMER1OVERFLOW_INT, myOverflowFunction);</span>00207 <span class="comment">//      timerDetach(TIMER1OVERFLOW_INT)</span>00208 <span class="comment">//</span>00209 <span class="comment">//      timerAttach causes the myOverflowFunction() to be attached, and therefore</span>00210 <span class="comment">//      execute, whenever an overflow on timer1 occurs.  timerDetach removes the</span>00211 <span class="comment">//      association and executes no user function when the interrupt occurs.</span>00212 <span class="comment">//      myOverflowFunction must be defined with no return value and no arguments:</span>00213 <span class="comment">//</span>00214 <span class="comment">//      void myOverflowFunction(void) { ... }</span>00215 00216 <span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a52">timerAttach</a>(u08 interruptNum, <span class="keywordtype">void</span> (*userFunc)(<span class="keywordtype">void</span>) );00217 <span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a53">timerDetach</a>(u08 interruptNum);00218 00219 00220 <span class="comment">// timing commands</span>00221 <span class="comment">// timerPause pauses for the number of milliseconds specified in &lt;pause_ms&gt;</span>00222 <span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a54">timerPause</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> pause_ms);00223 00224 <span class="comment">// overflow counters</span>00225 <span class="comment">// to be documented</span>00226 <span class="keywordtype">void</span> <a class="code" href="timer_8c.html#a17">timer0ClearOverflowCount</a>(<span class="keywordtype">void</span>);00227 <span class="keywordtype">long</span> <a class="code" href="timer_8c.html#a18">timer0GetOverflowCount</a>(<span class="keywordtype">void</span>);00228 <span class="keywordtype">void</span> timer2ClearOverflowCount(<span class="keywordtype">void</span>);00229 <span class="keywordtype">long</span> timer2GetOverflowCount(<span class="keywordtype">void</span>);00230 00231 <span class="comment">// PWM initialization and set commands for timerX (where X is either 1 or 3)</span>00232 <span class="comment">// timerXPWMInit()</span>00233 <span class="comment">//      configures the timerX hardware for PWM mode on pins OCXA, OCXB, and OCXC.</span>00234 <span class="comment">//      bitRes should be 8,9,or 10 for 8,9,or 10bit PWM resolution</span>00235 <span class="comment">//</span>00236 <span class="comment">// timerXPWMOff()</span>00237 <span class="comment">//      turns off all timerX PWM output and set timer mode to normal state</span>00238 <span class="comment">//</span>00239 <span class="comment">// timerXPWMAOn(), timerXPWMBOn(), timerXPWMCOn()</span>00240 <span class="comment">//      turn on output of PWM signals to OCXA,B,C pins</span>00241 <span class="comment">//      NOTE: Until you define the OCXA,B,C pins as outputs, and run</span>00242 <span class="comment">//      this "on" command, no PWM output will be output</span>00243 <span class="comment">//</span>00244 <span class="comment">// timerXPWMAOff(), timerXPWMBOff(), timerXPWMCOff()</span>00245 <span class="comment">//      turn off output of PWM signals to OCXA,B,C pins</span>00246 <span class="comment">//</span>00247 <span class="comment">// timerXPWMASet(), timer1PWMBSet(), timerXPWMCSet()</span>00248 <span class="comment">//      sets the PWM duty cycle for each channel</span>00249 <span class="comment">//  NOTE:   &lt;pwmDuty&gt; should be in the range 0-255 for 8bit PWM</span>00250 <span class="comment">//          &lt;pwmDuty&gt; should be in the range 0-511 for 9bit PWM</span>00251 <span class="comment">//          &lt;pwmDuty&gt; should be in the range 0-1023 for 10bit PWM</span>00252 <span class="comment">// NOTE: the PWM frequency can be controlled in increments by setting the</span>00253 <span class="comment">//          prescaler for timer1</span>00254 00255 <span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a59">timer1PWMInit</a>(u08 bitRes);     <span class="comment">///&lt; initialize and set timer1 mode to PWM</span>00256 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a60">timer1PWMInitICR</a>(u16 topcount);<span class="comment">///&lt; initialize and set timer1 mode to PWM with specific top count</span>00257 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer_8c.html#a20">timer1PWMOff</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn off all timer1 PWM output and set timer mode to normal</span>00258 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer_8c.html#a21">timer1PWMAOn</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn on timer1 Channel A (OC1A) PWM output</span>00259 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer_8c.html#a22">timer1PWMBOn</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn on timer1 Channel B (OC1B) PWM output</span>00260 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a34">timer1PWMCOn</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn on timer1 Channel C (OC1C) PWM output</span>00261 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer_8c.html#a23">timer1PWMAOff</a>(<span class="keywordtype">void</span>);           <span class="comment">///&lt; turn off timer1 Channel A (OC1A) PWM output</span>00262 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer_8c.html#a24">timer1PWMBOff</a>(<span class="keywordtype">void</span>);           <span class="comment">///&lt; turn off timer1 Channel B (OC1B) PWM output</span>00263 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a37">timer1PWMCOff</a>(<span class="keywordtype">void</span>);           <span class="comment">///&lt; turn off timer1 Channel C (OC1C) PWM output</span>00264 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a68">timer1PWMASet</a>(u16 pwmDuty);    <span class="comment">///&lt; set duty of timer1 Channel A (OC1A) PWM output</span>00265 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a69">timer1PWMBSet</a>(u16 pwmDuty);    <span class="comment">///&lt; set duty of timer1 Channel B (OC1B) PWM output</span>00266 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a70">timer1PWMCSet</a>(u16 pwmDuty);    <span class="comment">///&lt; set duty of timer1 Channel C (OC1C) PWM output</span>00267 <span class="comment"></span>00268 <span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a71">timer3PWMInit</a>(u08 bitRes);     <span class="comment">///&lt; initialize and set timer3 mode to PWM</span>00269 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a72">timer3PWMInitICR</a>(u16 topcount);<span class="comment">///&lt; initialize and set timer3 mode to PWM with specific top count</span>00270 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a43">timer3PWMOff</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn off all timer3 PWM output and set timer mode to normal</span>00271 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a44">timer3PWMAOn</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn on timer3 Channel A (OC3A) PWM output</span>00272 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a45">timer3PWMBOn</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn on timer3 Channel B (OC3B) PWM output</span>00273 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a46">timer3PWMCOn</a>(<span class="keywordtype">void</span>);            <span class="comment">///&lt; turn on timer3 Channel C (OC3C) PWM output</span>00274 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a47">timer3PWMAOff</a>(<span class="keywordtype">void</span>);           <span class="comment">///&lt; turn off timer3 Channel A (OC3A) PWM output</span>00275 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a48">timer3PWMBOff</a>(<span class="keywordtype">void</span>);           <span class="comment">///&lt; turn off timer3 Channel B (OC3B) PWM output</span>00276 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8c.html#a49">timer3PWMCOff</a>(<span class="keywordtype">void</span>);           <span class="comment">///&lt; turn off timer3 Channel C (OC3C) PWM output</span>00277 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a80">timer3PWMASet</a>(u16 pwmDuty);    <span class="comment">///&lt; set duty of timer3 Channel A (OC3A) PWM output</span>00278 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a81">timer3PWMBSet</a>(u16 pwmDuty);    <span class="comment">///&lt; set duty of timer3 Channel B (OC3B) PWM output</span>00279 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="timer128_8h.html#a82">timer3PWMCSet</a>(u16 pwmDuty);    <span class="comment">///&lt; set duty of timer3 Channel C (OC3C) PWM output</span>00280 <span class="comment"></span>00281 <span class="comment">// Pulse generation commands have been moved to the pulse.c library</span>00282 00283 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Oct 15 03:50:22 2004 for Procyon AVRlib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -