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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qei.c

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// qei.c - Driver for the Quadrature Encoder with Index.
//
// Copyright (c) 2005,2006 Luminary Micro, Inc.  All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's Stellaris Family of microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  Any use in violation
// of the foregoing restrictions may subject the user to criminal sanctions
// under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 991 of the Stellaris Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup qei_api
//! @{
//
//*****************************************************************************

#include "../hw_ints.h"
#include "../hw_memmap.h"
#include "../hw_qei.h"
#include "../hw_types.h"
#include "debug.h"
#include "interrupt.h"
#include "qei.h"

//*****************************************************************************
//
//! Enables the quadrature encoder.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This will enable operation of the quadrature encoder module.  It must be
//! configured before it is enabled.
//!
//! \sa QEIConfigure()
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_enable) || defined(BUILD_ALL) || defined(DOXYGEN)
void
QEIEnable(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Enable the QEI module.
    //
    HWREG(ulBase + QEI_O_CTL) |= QEI_CTL_ENABLE;
}
#endif

//*****************************************************************************
//
//! Disables the quadrature encoder.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This will disable operation of the quadrature encoder module.
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_disable) || defined(BUILD_ALL) || defined(DOXYGEN)
void
QEIDisable(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Disable the QEI module.
    //
    HWREG(ulBase + QEI_O_CTL) &= ~(QEI_CTL_ENABLE);
}
#endif

//*****************************************************************************
//
//! Configures the quadrature encoder.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//! \param ulConfig is the configuration for the quadrature encoder.  See below
//! for a description of this parameter.
//! \param ulMaxPosition specifies the maximum position value.
//!
//! This will configure the operation of the quadrature encoder.  The
//! \e ulConfig parameter provides the configuration of the encoder and is the
//! logical OR of several values:
//!
//! - \b QEI_CONFIG_CAPTURE_A or \b QEI_CONFIG_CAPTURE_A_B to specify if edges
//!   on channel A or on both channels A and B should be counted by the
//!   position integrator and velocity accumulator.
//! - \b QEI_CONFIG_NO_RESET or \b QEI_CONFIG_RESET_IDX to specify if the
//!   position integrator should be reset when the index pulse is detected.
//! - \b QEI_CONFIG_QUADRATURE or \b QEI_CONFIG_CLOCK_DIR to specify if
//!   quadrature signals are being provided on ChA and ChB, or if a direction
//!   signal and a clock are being provided instead.
//! - \b QEI_CONFIG_NO_SWAP or \b QEI_CONFIG_SWAP to specify if the signals
//!   provided on ChA and ChB should be swapped before being processed.
//!
//! \e ulMaxPosition is the maximum value of the position integrator, and is
//! the value used to reset the position capture when in index reset mode and
//! moving in the reverse (negative) direction.
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_configure) || defined(BUILD_ALL) || defined(DOXYGEN)
void
QEIConfigure(unsigned long ulBase, unsigned long ulConfig,
             unsigned long ulMaxPosition)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Write the new configuration to the hardware.
    //
    HWREG(ulBase + QEI_O_CTL) = ((HWREG(ulBase + QEI_O_CTL) &
                                  ~(QEI_CTL_CAPMODE | QEI_CTL_RESMODE |
                                    QEI_CTL_SIGMODE | QEI_CTL_SWAP)) |
                                 ulConfig);

    //
    // Set the maximum position.
    //
    HWREG(ulBase + QEI_O_MAXPOS) = ulMaxPosition;
}
#endif

//*****************************************************************************
//
//! Gets the current encoder position.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This returns the current position of the encoder.  Depending upon the
//! configuration of the encoder, and the incident of an index pulse, this
//! value may or may not contain the expected data (i.e. if in reset on index
//! mode, if an index pulse has not been encountered, the position counter will
//! not be aligned with the index pulse yet).
//!
//! \return The current position of the encoder.
//
//*****************************************************************************
#if defined(GROUP_positionget) || defined(BUILD_ALL) || defined(DOXYGEN)
unsigned long
QEIPositionGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Return the current position counter.
    //
    return(HWREG(ulBase + QEI_O_POS));
}
#endif

//*****************************************************************************
//
//! Sets the current encoder position.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//! \param ulPosition is the new position for the encoder.
//!
//! This sets the current position of the encoder; the encoder position will
//! then be measured relative to this value.
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_positionset) || defined(BUILD_ALL) || defined(DOXYGEN)
void
QEIPositionSet(unsigned long ulBase, unsigned long ulPosition)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Set the position counter.
    //
    HWREG(ulBase + QEI_O_POS) = ulPosition;
}
#endif

//*****************************************************************************
//
//! Gets the current direction of rotation.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This returns the current direction of rotation.  In this case, current
//! means the most recently detected direction of the encoder; it may not be
//! presently moving but this is the direction it last moved before it stopped.
//!
//! \return 1 if moving in the forward direction or -1 if moving in the reverse
//! direction.
//
//*****************************************************************************
#if defined(GROUP_directionget) || defined(BUILD_ALL) || defined(DOXYGEN)
long
QEIDirectionGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Return the direction of rotation.
    //
    return((HWREG(ulBase + QEI_O_STAT) & QEI_STAT_DIRECTION) ? -1 : 1);
}
#endif

//*****************************************************************************
//
//! Gets the encoder error indicator.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This returns the error indicator for the quadrature encoder.  It is an
//! error for both of the signals of the quadrature input to change at the same
//! time.
//!
//! \return true if an error has occurred and false otherwise.
//
//*****************************************************************************
#if defined(GROUP_errorget) || defined(BUILD_ALL) || defined(DOXYGEN)
tBoolean
QEIErrorGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Return the error indicator.
    //
    return((HWREG(ulBase + QEI_O_STAT) & QEI_STAT_ERROR) ? true : false);
}
#endif

//*****************************************************************************
//
//! Enables the velocity capture.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This will enable operation of the velocity capture in the quadrature
//! encoder module.  It must be configured before it is enabled.  Velocity
//! capture will not occur if the quadrature encoder is not enabled.
//!
//! \sa QEIVelocityConfigure() and QEIEnable()
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_velocityenable) || defined(BUILD_ALL) || defined(DOXYGEN)
void
QEIVelocityEnable(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == QEI_BASE);

    //
    // Enable the velocity capture.
    //
    HWREG(ulBase + QEI_O_CTL) |= QEI_CTL_VELEN;
}
#endif

//*****************************************************************************
//
//! Disables the velocity capture.
//!
//! \param ulBase is the base address of the quadrature encoder module.
//!
//! This will disable operation of the velocity capture in the quadrature
//! encoder module.
//!
//! \return None.
//

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产成人精品| 国产精品免费久久| 免费精品视频最新在线| 欧美日韩国产综合草草| 亚洲成人综合视频| 在线播放中文一区| 日本亚洲电影天堂| 精品国产伦一区二区三区免费| 捆绑紧缚一区二区三区视频| 26uuu亚洲婷婷狠狠天堂| 国产精华液一区二区三区| 欧美激情中文字幕一区二区| 91在线看国产| 视频一区中文字幕| 亚洲精品在线电影| 成人av免费在线播放| 亚洲宅男天堂在线观看无病毒| 欧美三日本三级三级在线播放| 日本人妖一区二区| 国产日韩三级在线| 欧美综合色免费| 久久成人羞羞网站| 亚洲人成网站色在线观看| 88在线观看91蜜桃国自产| 黄网站免费久久| 亚洲男同性恋视频| 精品国产一区a| 在线亚洲精品福利网址导航| 青青草成人在线观看| 中文字幕乱码亚洲精品一区| 色婷婷久久久久swag精品 | 国产欧美日韩在线| 91女厕偷拍女厕偷拍高清| 爽好多水快深点欧美视频| 国产人久久人人人人爽| 欧美精品aⅴ在线视频| 国产成人综合网站| 日韩精品电影在线| 最新国产精品久久精品| 欧美va亚洲va香蕉在线| 色婷婷av一区二区三区大白胸| 男男视频亚洲欧美| 亚洲精品久久嫩草网站秘色| 精品美女一区二区三区| 欧美午夜一区二区三区免费大片| 国产美女精品人人做人人爽| 无码av免费一区二区三区试看| 国产人伦精品一区二区| 日韩欧美国产三级电影视频| 在线看国产一区二区| 国产成+人+日韩+欧美+亚洲| 奇米在线7777在线精品| 一区二区三区免费在线观看| 国产日产欧产精品推荐色| 欧美一级二级三级乱码| 欧美性xxxxxx少妇| av电影一区二区| 国产河南妇女毛片精品久久久| 日韩1区2区日韩1区2区| 亚洲国产另类av| 亚洲人成在线播放网站岛国| 欧美国产一区视频在线观看| 精品久久国产97色综合| 欧美欧美欧美欧美| 欧美三级资源在线| 91行情网站电视在线观看高清版| 99精品久久只有精品| aaa亚洲精品一二三区| 国产精品羞羞答答xxdd| 国内精品伊人久久久久av一坑| 日韩影院精彩在线| 日韩成人免费在线| 日日欢夜夜爽一区| 日韩av中文字幕一区二区三区| 亚洲综合av网| 亚洲在线中文字幕| 亚洲国产成人高清精品| 亚洲一区在线观看网站| 亚洲主播在线播放| 婷婷中文字幕综合| 婷婷中文字幕一区三区| 日韩精品每日更新| 久久精品国产在热久久| 久久国产综合精品| 黄色资源网久久资源365| 久久国产精品99久久久久久老狼| 看电影不卡的网站| 国产二区国产一区在线观看| 成人午夜视频免费看| 成人黄色片在线观看| 91麻豆自制传媒国产之光| 欧美在线观看你懂的| 欧美另类z0zxhd电影| 日韩视频在线你懂得| 久久综合中文字幕| 国产精品久久久久婷婷二区次| 综合激情网...| 亚洲成人精品在线观看| 日本欧美久久久久免费播放网| 久久av资源站| www.日韩精品| 欧美性做爰猛烈叫床潮| 欧美大白屁股肥臀xxxxxx| 国产日韩欧美制服另类| 一区二区三区四区在线免费观看| 午夜一区二区三区在线观看| 九一久久久久久| 成人18视频在线播放| 欧美日韩亚洲综合| 久久综合久久鬼色中文字| 亚洲欧美综合色| 五月天网站亚洲| 国产成人免费视频一区| 色狠狠桃花综合| 精品国产凹凸成av人导航| 中文字幕在线一区二区三区| 亚洲成人先锋电影| 成人午夜看片网址| 欧美一三区三区四区免费在线看| 国产日韩欧美激情| 午夜精品视频在线观看| 国产成人a级片| 欧美疯狂性受xxxxx喷水图片| 国产婷婷色一区二区三区在线| 亚洲一区二区中文在线| 国产麻豆午夜三级精品| 欧美日韩免费电影| 中文字幕不卡的av| 91成人网在线| 久久亚洲捆绑美女| 婷婷开心久久网| eeuss鲁片一区二区三区在线观看| 欧美人妇做爰xxxⅹ性高电影| 国产色综合久久| 日本美女一区二区三区| 91色婷婷久久久久合中文| 久久奇米777| 日韩精品乱码av一区二区| 91丨porny丨户外露出| 久久麻豆一区二区| 日本一区中文字幕| 欧美色电影在线| 亚洲精品老司机| 99久久精品费精品国产一区二区| 欧美精品一区二区三区蜜臀| 亚洲成在人线免费| 在线日韩国产精品| 国产精品欧美一级免费| 韩国一区二区在线观看| 91精品国产入口在线| 亚洲自拍另类综合| 欧美怡红院视频| 亚洲欧美日韩一区二区三区在线观看| 国产精选一区二区三区 | 日韩午夜在线观看视频| 夜夜精品浪潮av一区二区三区| 成人的网站免费观看| 国产婷婷色一区二区三区在线| 久久成人免费电影| 精品国产91乱码一区二区三区| 日韩精品成人一区二区三区| 欧美日韩中文一区| 性欧美疯狂xxxxbbbb| 欧美少妇性性性| 亚洲一区二区黄色| 欧美三级日韩三级| 亚洲丶国产丶欧美一区二区三区| 色噜噜狠狠成人中文综合| 亚洲乱码中文字幕综合| 91麻豆国产在线观看| 一区二区免费在线| 欧美日韩色一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美精品丝袜久久久中文字幕| 午夜精品久久久久久久久久久| 精品视频全国免费看| 天天做天天摸天天爽国产一区| 欧美精品丝袜久久久中文字幕| 日韩电影一区二区三区| 2014亚洲片线观看视频免费| 国产一区二区三区观看| 国产欧美精品国产国产专区| 成人h精品动漫一区二区三区| 亚洲日本韩国一区| 精品视频1区2区| 久久精品72免费观看| 国产婷婷色一区二区三区四区| 成人三级伦理片| 亚洲伊人伊色伊影伊综合网| 91精品国产色综合久久不卡电影| 91蝌蚪porny成人天涯| 一区二区三区四区蜜桃| 欧美日韩dvd在线观看| 久久www免费人成看片高清| 国产偷v国产偷v亚洲高清| 色8久久精品久久久久久蜜| 丝袜美腿亚洲综合| 久久精品人人做| 在线观看亚洲精品| 久久电影网电视剧免费观看|