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

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

?? encoder.h

?? avr encoder counter source code project. read out encoder and send to UART. implemented on ATMega1
?? H
字號:
/*! \file encoder.h \brief Quadrature Encoder reader/driver. */
//*****************************************************************************
//
// File Name	: 'encoder.h'
// Title		: Quadrature Encoder reader/driver
// Author		: Pascal Stang - Copyright (C) 2003-2004
// Created		: 2003.01.26
// Revised		: 2004.06.25
// Version		: 0.3
// Target MCU	: Atmel AVR Series
// Editor Tabs	: 4
//
///	\ingroup driver_hw
/// \defgroup encoder Quadrature Encoder Driver (encoder.c)
/// \code #include "encoder.h" \endcode
/// \par Overview
///		This library allows easy interfacing of standard quadrature encoders
///		(used for sensing shaft rotational position and speed) to the Atmel
///		AVR-series processors. The library uses external interrupts to sense
///		and keep track of the encoder's movements. The library is extendable
///		with the maximum number of encoders equal to the total number of
///		external interrupts available on the target AVR processor.
///		
///		\note Due to the wide range of external interrupt capability on
///		AVR processors, it is difficult for this library to automatically
///		adapt to different processors.  For this reason, much of the
///		configuration responsibility has been left with the user.  See
///		the encoderconf.h configuration file.
//
/// \par Operation:
///		Quadrature encoders have two digital outputs usually called PhaseA and
///	PhaseB.  When the encoder rotates, PhaseA and PhaseB produce square wave
///	pulses where each pulse represents a fraction of a turn of the encoder
///	shaft.  Encoders are rated for a certain number of pulses (or counts) per
///	complete revolution of the shaft.  Common counts/revolution specs are 50,
///	100,128,200,250,256,500,etc.  By counting the number of pulses output on
///	one of the phases starting from time0, you can calculate the total
///	rotational distance the encoder has traveled.
///	
/// Often, however, we want current position not just total distance traveled.
/// For this it is necessary to know not only how far the encoder has traveled,
///	but also which direction it was going at each step of the way.  To do this
///	we need to use both outputs (or phases) of the quadrature encoder.
///
///	The pulses from PhaseA and PhaseB on quadrature encoders are always aligned
///	90 degrees out-of-phase (otherwise said: 1/4 wavelength apart).  This
///	special phase relationship lets us extract both the distance and direction
///	the encoder has rotated from the outputs.
///
///	To do this, consider Phase A to be the distance counter.  On each rising
///	edge of PhaseA we will count 1 "tic" of distance, but we need to know the
///	direction.  Look at the quadrature waveform plot below.  Notice that when
///	we travel forward in time (left->right), PhaseB is always low (logic 0) at
///	the rising edge of PhaseA.  When we travel backwards in time (right->left),
///	PhaseB is always high (logic 1) at the rising edge of PhaseA.  Note that
///	traveling forward or backwards in time is the same thing as rotating
///	forwards or bardwards. Thus, if PhaseA is our counter, PhaseB indicates
///	direction.
///
///	Here is an example waveform from a quadrature encoder:
/*
///                /---\   /---\   /---\   /---\   /---\   /---\
///  Phase A:      |   |   |   |   |   |   |   |   |   |   |   |
///             ---/   \---/   \---/   \---/   \---/   \---/   \-
///             -\   /---\   /---\   /---\   /---\   /---\   /---
///  Phase B:    |   |   |   |   |   |   |   |   |   |   |   |
///              \---/   \---/   \---/   \---/   \---/   \---/
///  Time:    <--------------------------------------------------->
///  Rotate FWD: >----------------------------------------------> 
///  Rotate REV: <----------------------------------------------<
*/
///	To keep track of the encoder position in software, we connect PhaseA to an
///	external processor interrupt line, and PhaseB to any I/O pin.  We set up
///	the external interrupt to trigger whenever PhaseA produces a rising edge.
///	When a rising edge is detected, our interrupt handler function is executed.
///	Inside the handler function, we quickly check the PhaseB line to see if it
///	is high or low.  If it is high, we increment the encoder's position
///	counter, otherwise we decrement it.  The encoder position counter can be
///	read at any time to find out the current position.
//
// NOTE: This code is currently below version 1.0, and therefore is considered
// to be lacking in some functionality or documentation, or may not be fully
// tested.  Nonetheless, you can expect most functions to work.
//
// This code is distributed under the GNU Public License
//		which can be found at http://www.gnu.org/licenses/gpl.txt
//
//*****************************************************************************

#ifndef ENCODER_H
#define ENCODER_H

#include "global.h"

// include encoder configuration file
#include "encoderconf.h"

// constants/macros/typdefs

// defines for processor compatibility
// chose proper Interrupt Mask (IMSK)
#ifdef EIMSK
	#define IMSK	EIMSK	// for processors mega128, mega64
#endif
#ifdef GICR
	#define IMSK	GICR	// for mega16,32,etc
#endif
// default
#ifndef IMSK
	#define IMSK	GIMSK	// for other processors 90s8515, mega163, etc
#endif


//! Encoder state structure
//   stores the position and other information from each encoder
typedef struct struct_EncoderState
{	
	s32 position;		///< position
} EncoderStateType;


// functions

//! encoderInit() initializes hardware and encoder position readings
//		Run this init routine once before using any other encoder function.
void encoderInit(void);

//! encoderOff() disables hardware and stops encoder position updates
void encoderOff(void);

//! encoderGetPosition() reads the current position of the encoder 
s32 encoderGetPosition(u08 encoderNum);

//! encoderSetPosition() sets the current position of the encoder
void encoderSetPosition(u08 encoderNum, s32 position);

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区黄视频 | 91色porny| 国产九色精品成人porny| 亚洲.国产.中文慕字在线| 亚洲午夜免费电影| 亚洲三级久久久| 成人欧美一区二区三区小说| 国产精品毛片大码女人| 欧美高清在线精品一区| 国产精品久久久久一区| 国产精品久久久久久妇女6080| 国产精品无遮挡| 中文字幕在线免费不卡| 亚洲精品国产无套在线观| 一区二区三区国产精华| 午夜欧美大尺度福利影院在线看| 视频一区二区三区在线| 蜜桃精品在线观看| 狠狠色丁香九九婷婷综合五月| 日本不卡视频一二三区| 国产一区二区三区电影在线观看| 国产乱色国产精品免费视频| 成人高清视频在线| 在线欧美日韩精品| 精品国内片67194| 国产欧美一区二区精品忘忧草 | 日韩精品亚洲专区| 久久se精品一区精品二区| 国产精品1区2区| 91啪亚洲精品| 91精品一区二区三区久久久久久 | 麻豆国产精品777777在线| 国产一区二区调教| 91网站最新地址| 久久综合狠狠综合久久综合88| 国产亚洲一区二区三区在线观看| 97久久精品人人爽人人爽蜜臀| 色婷婷亚洲婷婷| 欧美一区二区三区四区视频| 久久青草欧美一区二区三区| 亚洲码国产岛国毛片在线| 男人的j进女人的j一区| 成人a区在线观看| 欧美色图第一页| 久久久久亚洲蜜桃| 亚洲一区二区3| 国产宾馆实践打屁股91| 欧美日本一区二区三区四区 | 欧美一区二区三区视频在线| 亚洲国产精品v| 天天亚洲美女在线视频| 成人av午夜影院| 日韩视频123| 一区二区三区丝袜| 成人动漫一区二区在线| 欧美一二三四在线| 国产精品久久久久精k8| 国产一区二区导航在线播放| 欧美日韩国产电影| 亚洲天堂中文字幕| 国产盗摄一区二区三区| 欧美一区二区在线视频| 一区二区三区美女| 色综合天天综合给合国产| 久久久亚洲国产美女国产盗摄 | 成人精品视频一区二区三区尤物| 一区二区三区四区国产精品| 在线综合视频播放| 婷婷久久综合九色综合伊人色| 色综合久久久久综合体桃花网| 一道本成人在线| 国产精品久99| 欧美日韩国产成人在线91| 欧美日韩激情一区| 亚洲综合色视频| 久久精品999| 色一区在线观看| 欧美喷潮久久久xxxxx| 亚洲最新视频在线观看| 在线看国产一区二区| 99精品视频中文字幕| 国产女人aaa级久久久级| 91视视频在线观看入口直接观看www| 亚洲人成网站色在线观看| 91精品国产麻豆国产自产在线| av在线不卡免费看| 国内精品伊人久久久久av影院| 中文字幕成人网| 日韩免费性生活视频播放| 丁香激情综合五月| 激情综合网最新| 丝袜亚洲另类欧美| 亚洲欧美日韩中文字幕一区二区三区 | 午夜久久电影网| 欧美精品在线观看播放| 91丨porny丨蝌蚪视频| 国产一区二区三区av电影| 成人午夜激情影院| 奇米四色…亚洲| 7777精品伊人久久久大香线蕉经典版下载| 亚洲三级视频在线观看| 欧美激情在线看| 久久精品72免费观看| 国产精品久久久久毛片软件| 欧美不卡一区二区| 亚洲手机成人高清视频| 国产成人8x视频一区二区| 国产精品视频一二三区| 白白色 亚洲乱淫| 一区二区三区视频在线观看| 欧洲人成人精品| 日韩国产一二三区| av不卡在线播放| 一本到三区不卡视频| 成人看片黄a免费看在线| 91久久精品日日躁夜夜躁欧美| 91精品一区二区三区久久久久久| 欧美一区二区三区性视频| 日韩一区二区中文字幕| 国产精品色眯眯| 国产福利电影一区二区三区| 亚洲女性喷水在线观看一区| 精品入口麻豆88视频| 在线免费不卡视频| 99re视频这里只有精品| 丝袜美腿高跟呻吟高潮一区| 国产精品第五页| 国产亚洲人成网站| 日韩欧美国产综合一区| 欧美视频一区二区在线观看| av一二三不卡影片| 经典三级视频一区| 老色鬼精品视频在线观看播放| 成人免费一区二区三区在线观看| 一本大道久久a久久综合婷婷| 欧美欧美欧美欧美| 亚洲欧美日韩国产一区二区三区| 狠狠色丁香婷婷综合久久片| 欧美日韩亚洲国产综合| 日韩成人伦理电影在线观看| 色国产综合视频| 日韩一区欧美二区| 国产精品理论在线观看| 91精品婷婷国产综合久久竹菊| 国产一区二区三区在线观看免费 | 日韩黄色一级片| 国产精品剧情在线亚洲| 日韩亚洲欧美综合| 欧美日韩激情一区二区三区| 97久久精品人人做人人爽| 国产精品夜夜嗨| 久久精品噜噜噜成人av农村| 亚洲综合在线第一页| 久久久久97国产精华液好用吗| 色婷婷综合五月| 三级欧美在线一区| 国产99一区视频免费| 性感美女极品91精品| 91麻豆精品国产自产在线观看一区| 99国产麻豆精品| 91精品国产欧美一区二区18| 欧美激情在线观看视频免费| 中文字幕中文字幕一区| 亚洲欧美另类图片小说| 日本伊人色综合网| 亚洲一级二级三级| 国产精品一区二区久久精品爱涩| 欧美自拍丝袜亚洲| 久久久精品蜜桃| 日韩精品乱码av一区二区| 成人精品国产一区二区4080| 欧美色综合久久| 国产亚洲欧美一区在线观看| 亚洲一卡二卡三卡四卡无卡久久| 成人小视频免费观看| 日韩无一区二区| 亚洲国产一区二区a毛片| 不卡av电影在线播放| 26uuu成人网一区二区三区| 亚洲v中文字幕| 91久久精品一区二区| 国产精品国产精品国产专区不蜜 | 欧美一区二区性放荡片| 中文字幕中文字幕在线一区| 免费人成在线不卡| 欧美日韩aaa| 午夜精品一区在线观看| 在线精品视频免费播放| 欧美国产一区视频在线观看| 免费观看日韩电影| 欧美麻豆精品久久久久久| 国产精品福利电影一区二区三区四区| 黑人巨大精品欧美一区| 91精品国产综合久久香蕉的特点 | 国产精品久久久久久久久久久免费看 | 国产精品久久一卡二卡| 国产91精品免费| 国产亚洲福利社区一区| 国内精品嫩模私拍在线| 欧美不卡一二三|