<!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>Procyon AVRlib: Timer Function Library for ATmega128 (timer128.c)</title>
<link href="dox.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</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>Timer Function Library for ATmega128 (timer128.c)<br>
<small>
[<a class="el" href="group__driver__avr.html">Drivers (for AVR peripherals)</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="timer128_8h.html">timer128.h</a>"</span>
</pre></div> <dl compact><dt><b>Overview</b></dt><dd>This library provides functions for use with the timers internal to the AVR ATmega128. Functions include initialization, set prescaler, calibrated pause function (in milliseconds), attaching and detaching of user functions to interrupts, overflow counters, and PWM.</dd></dl>
<dl compact><dt><b>About Timers</b></dt><dd>The Atmel AVR-series processors each contain at least one hardware timer/counter. Many of the processors contain 2 or 3 timers. Generally speaking, a timer is a hardware counter inside the processor which counts at a rate related to the main CPU clock frequency. Because the counter value increasing (counting up) at a precise rate, we can use it as a timer to create or measure precise delays, schedule events, or generate signals of a certain frequency or pulse-width. </dd></dl>
<dl compact><dt><b></b></dt><dd>As an example, the ATmega163 processor has 3 timer/counters. Timer0, Timer1, and Timer2 are 8, 16, and 8 bits wide respectively. This means that they overflow, or roll over back to zero, at a count value of 256 for 8bits or 65536 for 16bits. A prescaler is avaiable for each timer, and the prescaler allows you to pre-divide the main CPU clock rate down to a slower speed before feeding it to the counting input of a timer. For example, if the CPU clock frequency is 3.69MHz, and Timer0's prescaler is set to divide-by-8, then Timer0 will "tic" at 3690000/8 = 461250Hz. Because Timer0 is an 8bit timer, it will count to 256 in just 256/461250Hz = 0.555ms. In fact, when it hits 255, it will overflow and start again at zero. In this case, Timer0 will overflow 461250/256 = 1801.76 times per second. </dd></dl>
<dl compact><dt><b></b></dt><dd>Timer0 can be used a number of ways simultaneously. First, the value of the timer can be read by accessing the CPU register <code>TCNT0</code>. We could, for example, figure out how long it takes to execute a C command by recording the value of <code>TCNT0</code> before and after execution, then subtract (after-before) = time elapsed. Or we can enable the overflow interrupt which goes off every time T0 overflows and count out longer delays (multiple overflows), or execute a special periodic function at every overflow. </dd></dl>
<dl compact><dt><b></b></dt><dd>The other timers (Timer1 and Timer2) offer all the abilities of Timer0 and many more features. Both T1 and T2 can operate as general-purpose timers, but T1 has special hardware allowing it to generate PWM signals, while T2 is specially designed to help count out real time (like hours, minutes, seconds). See the Timer/Counter section of the processor datasheet for more info. </dd></dl>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga45" doxytag="timer128::TIMER_CLK_STOP"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga45">TIMER_CLK_STOP</a> 0x00</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer Stopped. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga46" doxytag="timer128::TIMER_CLK_DIV1"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga46">TIMER_CLK_DIV1</a> 0x01</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at F_CPU. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga47" doxytag="timer128::TIMER_CLK_DIV8"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga47">TIMER_CLK_DIV8</a> 0x02</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at F_CPU/8. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga48" doxytag="timer128::TIMER_CLK_DIV64"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga48">TIMER_CLK_DIV64</a> 0x03</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at F_CPU/64. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga49" doxytag="timer128::TIMER_CLK_DIV256"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga49">TIMER_CLK_DIV256</a> 0x04</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at F_CPU/256. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga50" doxytag="timer128::TIMER_CLK_DIV1024"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga50">TIMER_CLK_DIV1024</a> 0x05</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at F_CPU/1024. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga51" doxytag="timer128::TIMER_CLK_T_FALL"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga51">TIMER_CLK_T_FALL</a> 0x06</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at T falling edge. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga52" doxytag="timer128::TIMER_CLK_T_RISE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga52">TIMER_CLK_T_RISE</a> 0x07</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer clocked at T rising edge. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga53" doxytag="timer128::TIMER_PRESCALE_MASK"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga53">TIMER_PRESCALE_MASK</a> 0x07</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timer Prescaler Bit-Mask. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga54" doxytag="timer128::TIMERRTC_CLK_STOP"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga54">TIMERRTC_CLK_STOP</a> 0x00</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer Stopped. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga55" doxytag="timer128::TIMERRTC_CLK_DIV1"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga55">TIMERRTC_CLK_DIV1</a> 0x01</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga56" doxytag="timer128::TIMERRTC_CLK_DIV8"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga56">TIMERRTC_CLK_DIV8</a> 0x02</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU/8. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga57" doxytag="timer128::TIMERRTC_CLK_DIV32"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga57">TIMERRTC_CLK_DIV32</a> 0x03</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU/32. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga58" doxytag="timer128::TIMERRTC_CLK_DIV64"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga58">TIMERRTC_CLK_DIV64</a> 0x04</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU/64. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga59" doxytag="timer128::TIMERRTC_CLK_DIV128"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga59">TIMERRTC_CLK_DIV128</a> 0x05</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU/128. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga60" doxytag="timer128::TIMERRTC_CLK_DIV256"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga60">TIMERRTC_CLK_DIV256</a> 0x06</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU/256. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga61" doxytag="timer128::TIMERRTC_CLK_DIV1024"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga61">TIMERRTC_CLK_DIV1024</a> 0x07</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer clocked at F_CPU/1024. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga62" doxytag="timer128::TIMERRTC_PRESCALE_MASK"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga62">TIMERRTC_PRESCALE_MASK</a> 0x07</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RTC Timer Prescaler Bit-Mask. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga63" doxytag="timer128::TIMER0PRESCALE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga63">TIMER0PRESCALE</a> TIMERRTC_CLK_DIV64</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">timer 0 prescaler default <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga64" doxytag="timer128::TIMER1PRESCALE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga64">TIMER1PRESCALE</a> TIMER_CLK_DIV64</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">timer 1 prescaler default <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga65" doxytag="timer128::TIMER2PRESCALE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga65">TIMER2PRESCALE</a> TIMER_CLK_DIV8</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">timer 2 prescaler default <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga66" doxytag="timer128::TIMER3PRESCALE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga66">TIMER3PRESCALE</a> TIMER_CLK_DIV64</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">timer 3 prescaler default <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga67" doxytag="timer128::TIMER0OVERFLOW_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER0OVERFLOW_INT</b> 0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga68" doxytag="timer128::TIMER0OUTCOMPARE_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER0OUTCOMPARE_INT</b> 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga69" doxytag="timer128::TIMER1OVERFLOW_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER1OVERFLOW_INT</b> 2</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga70" doxytag="timer128::TIMER1OUTCOMPAREA_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER1OUTCOMPAREA_INT</b> 3</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga71" doxytag="timer128::TIMER1OUTCOMPAREB_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER1OUTCOMPAREB_INT</b> 4</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga72" doxytag="timer128::TIMER1OUTCOMPAREC_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER1OUTCOMPAREC_INT</b> 5</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga73" doxytag="timer128::TIMER1INPUTCAPTURE_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER1INPUTCAPTURE_INT</b> 6</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga74" doxytag="timer128::TIMER2OVERFLOW_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER2OVERFLOW_INT</b> 7</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga75" doxytag="timer128::TIMER2OUTCOMPARE_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER2OUTCOMPARE_INT</b> 8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga76" doxytag="timer128::TIMER3OVERFLOW_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER3OVERFLOW_INT</b> 9</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga77" doxytag="timer128::TIMER3OUTCOMPAREA_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER3OUTCOMPAREA_INT</b> 10</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga78" doxytag="timer128::TIMER3OUTCOMPAREB_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER3OUTCOMPAREB_INT</b> 11</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga79" doxytag="timer128::TIMER3OUTCOMPAREC_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER3OUTCOMPAREC_INT</b> 12</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga80" doxytag="timer128::TIMER3INPUTCAPTURE_INT"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER3INPUTCAPTURE_INT</b> 13</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga81" doxytag="timer128::TIMER_NUM_INTERRUPTS"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER_NUM_INTERRUPTS</b> 14</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga82" doxytag="timer128::TIMER_INTERRUPT_HANDLER"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TIMER_INTERRUPT_HANDLER</b> SIGNAL</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga83" doxytag="timer128::delay"></a>
#define </td><td class="memItemRight" valign="bottom"><b>delay</b> delay_us</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga84" doxytag="timer128::delay_ms"></a>
#define </td><td class="memItemRight" valign="bottom"><b>delay_ms</b> timerPause</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="timer128::delay_us"></a>
void </td><td class="memItemRight" valign="bottom"><b>delay_us</b> (unsigned short time_us)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="timer128::timerInit"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga1">timerInit</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initializes timing system (all timers) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2" doxytag="timer128::timer0Init"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga2">timer0Init</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize timer0 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga3" doxytag="timer128::timer1Init"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga3">timer1Init</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize timer1 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga4" doxytag="timer128::timer2Init"></a>
void </td><td class="memItemRight" valign="bottom"><b>timer2Init</b> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga5" doxytag="timer128::timer3Init"></a>
void </td><td class="memItemRight" valign="bottom"><b>timer3Init</b> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="timer128::timer0SetPrescaler"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga6">timer0SetPrescaler</a> (u08 prescale)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set timer0 prescaler division index <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="timer128::timer1SetPrescaler"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga7">timer1SetPrescaler</a> (u08 prescale)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set timer1 prescaler division index <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="timer128::timer2SetPrescaler"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga8">timer2SetPrescaler</a> (u08 prescale)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set timer2 prescaler division index <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="timer128::timer3SetPrescaler"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga9">timer3SetPrescaler</a> (u08 prescale)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set timer3 prescaler division index <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga10" doxytag="timer128::timer0GetPrescaler"></a>
u16 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga10">timer0GetPrescaler</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">get timer0 prescaler division rate <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="timer128::timer1GetPrescaler"></a>
u16 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga11">timer1GetPrescaler</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">get timer1 prescaler division rate <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga12" doxytag="timer128::timer2GetPrescaler"></a>
u16 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga12">timer2GetPrescaler</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">get timer2 prescaler division rate <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="timer128::timer3GetPrescaler"></a>
u16 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga13">timer3GetPrescaler</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">get timer3 prescaler division rate <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="timer128::timerAttach"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga14">timerAttach</a> (u08 interruptNum, void(*userFunc)(void))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Attach a user function to a timer interrupt. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga15" doxytag="timer128::timerDetach"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga15">timerDetach</a> (u08 interruptNum)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Detach a user function from a timer interrupt. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga16">timerPause</a> (unsigned short pause_ms)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="timer128::timer0ClearOverflowCount"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga17">timer0ClearOverflowCount</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear timer0's overflow counter. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="timer128::timer0GetOverflowCount"></a>
long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga18">timer0GetOverflowCount</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">read timer0's overflow counter <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="timer128::timer2ClearOverflowCount"></a>
void </td><td class="memItemRight" valign="bottom"><b>timer2ClearOverflowCount</b> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga20" doxytag="timer128::timer2GetOverflowCount"></a>
long </td><td class="memItemRight" valign="bottom"><b>timer2GetOverflowCount</b> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga21">timer1PWMInit</a> (u08 bitRes)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize and set timer1 mode to PWM <a href="#ga21"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga22">timer1PWMInitICR</a> (u16 topcount)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize and set timer1 mode to PWM with specific top count <a href="#ga22"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="timer128::timer1PWMOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga23">timer1PWMOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off all timer1 PWM output and set timer mode to normal <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="timer128::timer1PWMAOn"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga24">timer1PWMAOn</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn on timer1 Channel A (OC1A) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="timer128::timer1PWMBOn"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga25">timer1PWMBOn</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn on timer1 Channel B (OC1B) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="timer128::timer1PWMCOn"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga26">timer1PWMCOn</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn on timer1 Channel C (OC1C) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="timer128::timer1PWMAOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga27">timer1PWMAOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off timer1 Channel A (OC1A) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="timer128::timer1PWMBOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga28">timer1PWMBOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off timer1 Channel B (OC1B) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga29" doxytag="timer128::timer1PWMCOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga29">timer1PWMCOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off timer1 Channel C (OC1C) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga30" doxytag="timer128::timer1PWMASet"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga30">timer1PWMASet</a> (u16 pwmDuty)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set duty of timer1 Channel A (OC1A) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga31" doxytag="timer128::timer1PWMBSet"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga31">timer1PWMBSet</a> (u16 pwmDuty)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set duty of timer1 Channel B (OC1B) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga32" doxytag="timer128::timer1PWMCSet"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga32">timer1PWMCSet</a> (u16 pwmDuty)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set duty of timer1 Channel C (OC1C) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga33" doxytag="timer128::timer3PWMInit"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga33">timer3PWMInit</a> (u08 bitRes)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize and set timer3 mode to PWM <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga34" doxytag="timer128::timer3PWMInitICR"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga34">timer3PWMInitICR</a> (u16 topcount)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">initialize and set timer3 mode to PWM with specific top count <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga35" doxytag="timer128::timer3PWMOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga35">timer3PWMOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off all timer3 PWM output and set timer mode to normal <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga36" doxytag="timer128::timer3PWMAOn"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga36">timer3PWMAOn</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn on timer3 Channel A (OC3A) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga37" doxytag="timer128::timer3PWMBOn"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga37">timer3PWMBOn</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn on timer3 Channel B (OC3B) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga38" doxytag="timer128::timer3PWMCOn"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga38">timer3PWMCOn</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn on timer3 Channel C (OC3C) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga39" doxytag="timer128::timer3PWMAOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga39">timer3PWMAOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off timer3 Channel A (OC3A) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga40" doxytag="timer128::timer3PWMBOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga40">timer3PWMBOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off timer3 Channel B (OC3B) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga41" doxytag="timer128::timer3PWMCOff"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga41">timer3PWMCOff</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">turn off timer3 Channel C (OC3C) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga42" doxytag="timer128::timer3PWMASet"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga42">timer3PWMASet</a> (u16 pwmDuty)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set duty of timer3 Channel A (OC3A) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga43" doxytag="timer128::timer3PWMBSet"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga43">timer3PWMBSet</a> (u16 pwmDuty)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set duty of timer3 Channel B (OC3B) PWM output <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga44" doxytag="timer128::timer3PWMCSet"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__timer128.html#ga44">timer3PWMCSet</a> (u16 pwmDuty)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">set duty of timer3 Channel C (OC3C) PWM output <br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga21" doxytag="timer128.h::timer1PWMInit"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer1PWMInit </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u08 </td>
<td class="mdname1" valign="top" nowrap> <em>bitRes</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Enter standard PWM Mode on timer1. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>bitRes</em> </td><td>indicates the period/resolution to use for PWM output in timer bits. Must be either 8, 9, or 10 bits corresponding to PWM periods of 256, 512, or 1024 timer tics. </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="timer_8c-source.html#l00277">277</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga22" doxytag="timer128.h::timer1PWMInitICR"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer1PWMInitICR </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">u16 </td>
<td class="mdname1" valign="top" nowrap> <em>topcount</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Enter PWM Mode on timer1 with a specific top-count value. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>topcount</em> </td><td>indicates the desired PWM period in timer tics. Can be a number between 1 and 65535 (16-bit). </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="timer128_8c-source.html#l00297">297</a> of file <a class="el" href="timer128_8c-source.html">timer128.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga16" doxytag="timer128.h::timerPause"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timerPause </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">unsigned short </td>
<td class="mdname1" valign="top" nowrap> <em>pause_ms</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
A timer-based delay/pause function <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pause_ms</em> </td><td>Number of integer milliseconds to wait. </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="timer_8c-source.html#l00204">204</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:09 2006 for Procyon AVRlib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>
|