亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? encoder_8h-source.html

?? ATMEL的AVR單片機庫文件
?? 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>Procyon AVRlib: encoder.h Source File</title><link href="dox.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>encoder.h</h1><a href="encoder_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*! \file encoder.h \brief Quadrature Encoder reader/driver. */</span>00002 <span class="comment">//*****************************************************************************</span>00003 <span class="comment">//</span>00004 <span class="comment">// File Name    : 'encoder.h'</span>00005 <span class="comment">// Title        : Quadrature Encoder reader/driver</span>00006 <span class="comment">// Author       : Pascal Stang - Copyright (C) 2003-2004</span>00007 <span class="comment">// Created      : 2003.01.26</span>00008 <span class="comment">// Revised      : 2004.06.25</span>00009 <span class="comment">// Version      : 0.3</span>00010 <span class="comment">// Target MCU   : Atmel AVR Series</span>00011 <span class="comment">// Editor Tabs  : 4</span>00012 <span class="comment">//</span>00013 <span class="comment">// Description  : This library allows easy interfacing of quadrature encoders</span>00014 <span class="comment">//      to the Atmel AVR-series processors.</span>00015 <span class="comment">//</span>00016 <span class="comment">//      Quadrature encoders have two digital outputs usually called PhaseA and</span>00017 <span class="comment">//  PhaseB.  When the encoder rotates, PhaseA and PhaseB produce square wave</span>00018 <span class="comment">//  pulses where each pulse represents a fraction of a turn of the encoder</span>00019 <span class="comment">//  shaft.  Encoders are rated for a certain number of pulses (or counts) per</span>00020 <span class="comment">//  complete revolution of the shaft.  Common counts/revolution specs are 50,</span>00021 <span class="comment">//  100,128,200,250,256,500,etc.  By counting the number of pulses output on</span>00022 <span class="comment">//  one of the phases starting from time0, you can calculate the total</span>00023 <span class="comment">//  rotational distance the encoder has traveled.</span>00024 <span class="comment">//  </span>00025 <span class="comment">//  Often, however, we want current position not just total distance traveled.</span>00026 <span class="comment">//  For this it is necessary to know not only how far the encoder has traveled,</span>00027 <span class="comment">//  but also which direction it was going at each step of the way.  To do this</span>00028 <span class="comment">//  we need to use both outputs (or phases) of the quadrature encoder.</span>00029 <span class="comment">//</span>00030 <span class="comment">//  The pulses from PhaseA and PhaseB on quadrature encoders are always aligned</span>00031 <span class="comment">//  90 degrees out-of-phase (otherwise said: 1/4 wavelength apart).  This</span>00032 <span class="comment">//  special phase relationship lets us extract both the distance and direction</span>00033 <span class="comment">//  the encoder has rotated from the outputs.</span>00034 <span class="comment">//</span>00035 <span class="comment">//  To do this, consider Phase A to be the distance counter.  On each rising</span>00036 <span class="comment">//  edge of PhaseA we will count 1 "tic" of distance, but we need to know the</span>00037 <span class="comment">//  direction.  Look at the quadrature waveform plot below.  Notice that when</span>00038 <span class="comment">//  we travel forward in time (left-&gt;right), PhaseB is always low (logic 0) at</span>00039 <span class="comment">//  the rising edge of PhaseA.  When we travel backwards in time (right-&gt;left),</span>00040 <span class="comment">//  PhaseB is always high (logic 1) at the rising edge of PhaseA.  Note that</span>00041 <span class="comment">//  traveling forward or backwards in time is the same thing as rotating</span>00042 <span class="comment">//  forwards or bardwards. Thus, if PhaseA is our counter, PhaseB indicates</span>00043 <span class="comment">//  direction.</span>00044 <span class="comment">//</span>00045 <span class="comment">//  Here is an example waveform from a quadrature encoder:</span>00046 <span class="comment">/*</span>00047 <span class="comment">//                /---\   /---\   /---\   /---\   /---\   /---\</span>00048 <span class="comment">//  Phase A:      |   |   |   |   |   |   |   |   |   |   |   |</span>00049 <span class="comment">//             ---/   \---/   \---/   \---/   \---/   \---/   \-</span>00050 <span class="comment">//             -\   /---\   /---\   /---\   /---\   /---\   /---</span>00051 <span class="comment">//  Phase B:    |   |   |   |   |   |   |   |   |   |   |   |</span>00052 <span class="comment">//              \---/   \---/   \---/   \---/   \---/   \---/</span>00053 <span class="comment">//  Time:    &lt;---------------------------------------------------&gt;</span>00054 <span class="comment">//  Rotate FWD: &gt;----------------------------------------------&gt; </span>00055 <span class="comment">//  Rotate REV: &lt;----------------------------------------------&lt;</span>00056 <span class="comment">*/</span>00057 <span class="comment">//  To keep track of the encoder position in software, we connect PhaseA to an</span>00058 <span class="comment">//  external processor interrupt line, and PhaseB to any I/O pin.  We set up</span>00059 <span class="comment">//  the external interrupt to trigger whenever PhaseA produces a rising edge.</span>00060 <span class="comment">//  When a rising edge is detected, our interrupt handler function is executed.</span>00061 <span class="comment">//  Inside the handler function, we quickly check the PhaseB line to see if it</span>00062 <span class="comment">//  is high or low.  If it is high, we increment the encoder's position</span>00063 <span class="comment">//  counter, otherwise we decrement it.  The encoder position counter can be</span>00064 <span class="comment">//  read at any time to find out the current position.</span>00065 <span class="comment">//</span>00066 <span class="comment">//</span>00067 <span class="comment">// NOTE: This code is currently below version 1.0, and therefore is considered</span>00068 <span class="comment">// to be lacking in some functionality or documentation, or may not be fully</span>00069 <span class="comment">// tested.  Nonetheless, you can expect most functions to work.</span>00070 <span class="comment">//</span>00071 <span class="comment">// This code is distributed under the GNU Public License</span>00072 <span class="comment">//      which can be found at http://www.gnu.org/licenses/gpl.txt</span>00073 <span class="comment">//</span>00074 <span class="comment">//*****************************************************************************</span>00075 00076 <span class="preprocessor">#ifndef ENCODER_H</span>00077 <span class="preprocessor"></span><span class="preprocessor">#define ENCODER_H</span>00078 <span class="preprocessor"></span>00079 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>00080 00081 <span class="comment">// include encoder configuration file</span>00082 <span class="preprocessor">#include "<a class="code" href="encoderconf_8h.html">encoderconf.h</a>"</span>00083 00084 <span class="comment">// constants/macros/typdefs</span>00085 00086 <span class="comment">// defines for processor compatibility</span>00087 <span class="comment">// chose proper Interrupt Mask (IMSK)</span>00088 <span class="preprocessor">#ifdef EIMSK</span>00089 <span class="preprocessor"></span><span class="preprocessor">    #define IMSK    EIMSK   // for processors mega128, mega64</span>00090 <span class="preprocessor"></span><span class="preprocessor">#else</span>00091 <span class="preprocessor"></span><span class="preprocessor">    #define IMSK    GIMSK   // for other processors 90s8515, mega163, etc</span>00092 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00093 <span class="preprocessor"></span>00094 <span class="comment"></span>00095 <span class="comment">//! Encoder state structure</span>00096 <span class="comment"></span><span class="comment">//   stores the position and other information from each encoder</span><a name="l00097"></a><a class="code" href="structstruct__EncoderState.html">00097</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structstruct__EncoderState.html">struct_EncoderState</a>00098 {   <a name="l00099"></a><a class="code" href="structstruct__EncoderState.html#o0">00099</a>     s32 <a class="code" href="structstruct__EncoderState.html#o0">position</a>;       <span class="comment">///&lt; position</span>00100 <span class="comment"></span><span class="comment">//  s32 velocity;       ///&lt; velocity</span>00101 } <a class="code" href="structstruct__EncoderState.html">EncoderStateType</a>;00102 00103 00104 <span class="comment">// functions</span>00105 <span class="comment"></span>00106 <span class="comment">//! encoderInit() initializes hardware and encoder position readings</span>00107 <span class="comment"></span><span class="comment">//      Run this init routine once before using any other encoder function.</span>00108 <span class="keywordtype">void</span> <a class="code" href="encoder_8c.html#a1">encoderInit</a>(<span class="keywordtype">void</span>);00109 <span class="comment"></span>00110 <span class="comment">//! encoderOff() disables hardware and stops encoder position updates</span>00111 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="encoder_8c.html#a2">encoderOff</a>(<span class="keywordtype">void</span>);00112 <span class="comment"></span>00113 <span class="comment">//! encoderGetPosition() reads the current position of the encoder </span>00114 <span class="comment"></span>s32 <a class="code" href="encoder_8h.html#a4">encoderGetPosition</a>(u08 encoderNum);00115 <span class="comment"></span>00116 <span class="comment">//! encoderSetPosition() sets the current position of the encoder</span>00117 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="encoder_8h.html#a5">encoderSetPosition</a>(u08 encoderNum, s32 position);00118 00119 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Oct 15 03:50:21 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 + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产高清精品网站| 制服丝袜在线91| 3d动漫精品啪啪一区二区竹菊| 精品蜜桃在线看| 日韩国产精品91| 一本久久精品一区二区| 久久九九99视频| 久久99精品久久久久久久久久久久| 欧洲人成人精品| 中文字幕在线观看不卡视频| 国产精品一区二区无线| 日韩一级在线观看| 亚洲成人久久影院| 91丝袜美女网| 国产精品理伦片| 成人美女在线视频| 欧美经典一区二区三区| 国产一区欧美二区| 亚洲精品在线三区| 久久国产生活片100| 日韩三级精品电影久久久| 亚欧色一区w666天堂| 欧美在线看片a免费观看| 亚洲人成影院在线观看| 97精品视频在线观看自产线路二| 中文字幕精品综合| 国产成a人亚洲精品| 久久久久久久久久久久久久久99| 久久精品免费观看| 久久久久久黄色| 国产乱码一区二区三区| 久久精品欧美日韩| 国产成人av影院| 久久亚洲一区二区三区明星换脸 | 国产麻豆成人传媒免费观看| 日韩欧美黄色影院| 麻豆国产91在线播放| 精品国产区一区| 精品影院一区二区久久久| 精品国产污网站| 成人免费视频视频在线观看免费| 中文字幕av不卡| 色婷婷精品久久二区二区蜜臀av| 夜夜精品视频一区二区| 欧美高清dvd| 麻豆国产91在线播放| 国产日韩亚洲欧美综合| 91一区二区三区在线观看| 亚洲国产欧美日韩另类综合 | 日本久久一区二区三区| 午夜精品久久久久久久久久| 日韩精品在线网站| 国产成人免费视频网站| 亚洲人成在线观看一区二区| 欧美日韩精品三区| 国产一区二区视频在线播放| 综合av第一页| 欧美成人猛片aaaaaaa| 99久久婷婷国产| 日产国产高清一区二区三区| 国产午夜一区二区三区| 在线一区二区三区| 看电视剧不卡顿的网站| 亚洲天堂a在线| 欧美成人一级视频| 91美女福利视频| 蜜臀av一区二区在线免费观看| 中文字幕乱码亚洲精品一区| 欧美日韩一区二区三区高清| 国产白丝网站精品污在线入口| 夜夜嗨av一区二区三区中文字幕 | 欧美精品 国产精品| 成人蜜臀av电影| 日韩精品一级二级| 久久久久97国产精华液好用吗| 91麻豆免费看片| 国产一区二区三区四| 亚洲一区二区在线播放相泽| 精品福利一区二区三区免费视频| 色婷婷精品久久二区二区蜜臂av | 国产精品青草久久| 日韩欧美在线观看一区二区三区| 91在线无精精品入口| 九九久久精品视频| 一区二区在线观看不卡| 中文字幕 久热精品 视频在线| 欧美二区乱c少妇| 日本韩国欧美一区二区三区| 国产精品911| 国产主播一区二区| 天堂蜜桃91精品| 亚洲久本草在线中文字幕| 久久久精品人体av艺术| 日韩欧美在线综合网| 欧美精品久久99久久在免费线 | 亚洲免费观看高清完整版在线 | 成人久久18免费网站麻豆 | 久久成人久久爱| 亚洲国产人成综合网站| 亚洲三级免费观看| 欧美国产精品一区二区三区| 久久人人97超碰com| 日韩精品一区二区在线观看| 在线91免费看| 777色狠狠一区二区三区| 欧美三级三级三级| 欧美日韩精品三区| 欧美老肥妇做.爰bbww视频| 欧美视频一二三区| 欧美日韩精品一区二区三区蜜桃| 欧美在线你懂得| 欧美三级视频在线观看| 欧美亚洲丝袜传媒另类| 欧美日韩国产美| 欧美一级高清片在线观看| 日韩精品一区二区三区视频在线观看 | 亚洲精品成人精品456| 一区二区三区欧美久久| 亚洲精品乱码久久久久久 | 欧美亚洲禁片免费| 欧美日韩一级二级| 欧美日韩精品一区二区三区四区| 欧美日韩国产首页在线观看| 欧美伦理视频网站| 日韩欧美你懂的| 久久青草国产手机看片福利盒子 | 国产日韩一级二级三级| 国产精品美女久久久久aⅴ| 亚洲欧美另类在线| 亚洲午夜久久久久久久久电影网| 日韩高清在线电影| 国内精品嫩模私拍在线| 成人黄动漫网站免费app| 色中色一区二区| 制服丝袜亚洲精品中文字幕| 精品国产髙清在线看国产毛片| 2017欧美狠狠色| 亚洲欧洲精品成人久久奇米网| 亚洲综合免费观看高清在线观看| 午夜成人在线视频| 国产精品自产自拍| 色天天综合久久久久综合片| 欧美精品日日鲁夜夜添| 欧美国产日韩亚洲一区| 亚洲香肠在线观看| 国产麻豆成人精品| 欧美亚洲免费在线一区| 精品久久久久久无| 一区二区三区四区中文字幕| 人人狠狠综合久久亚洲| 暴力调教一区二区三区| 91精品久久久久久久99蜜桃 | 日本视频中文字幕一区二区三区 | 国产传媒欧美日韩成人| 欧美午夜电影在线播放| 久久美女高清视频| 亚洲图片欧美色图| 国产ts人妖一区二区| 欧美日本在线播放| 国产精品欧美一区二区三区| 日韩成人午夜电影| a亚洲天堂av| 久久久久成人黄色影片| 亚洲gay无套男同| 91在线精品一区二区三区| 精品国产自在久精品国产| 一区二区视频在线| 成人久久视频在线观看| 久久人人超碰精品| 日产欧产美韩系列久久99| 日本韩国欧美一区| 国产精品久久毛片| 精品一区二区三区免费观看| 在线精品亚洲一区二区不卡| 中文字幕欧美激情一区| 国产麻豆欧美日韩一区| 日韩三级电影网址| 午夜日韩在线电影| 一本大道av一区二区在线播放| 国产精品免费网站在线观看| 韩国欧美一区二区| 日韩午夜小视频| 亚洲h精品动漫在线观看| 日本韩国视频一区二区| 亚洲美女少妇撒尿| 99久久国产综合精品麻豆| 国产日本亚洲高清| 国产乱色国产精品免费视频| 日韩欧美成人激情| 久久99精品久久久久婷婷| 日韩欧美在线综合网| 久久国产精品第一页| 日韩精品一区二区三区在线观看| 日韩国产在线观看一区| 在线不卡中文字幕播放| 日本视频免费一区| 日韩欧美亚洲国产另类| 久久国产三级精品| 精品美女一区二区三区| 国产美女在线精品|