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

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

?? qei.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? 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.
//

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久69国产一区二区蜜臀| xnxx国产精品| 美日韩一区二区| 国产日产欧美一区| 91蝌蚪国产九色| 污片在线观看一区二区| 久久精品一二三| 欧美性视频一区二区三区| 性欧美疯狂xxxxbbbb| 久久久蜜臀国产一区二区| 国内成人免费视频| 亚洲日本在线视频观看| 欧美日韩精品一区视频| 国产乱子伦视频一区二区三区 | 国产二区国产一区在线观看| 婷婷国产在线综合| 亚洲自拍与偷拍| 亚洲免费av网站| 中文字幕高清一区| 337p日本欧洲亚洲大胆精品| 欧美一区二区三区在线观看视频| 91麻豆.com| 91老师片黄在线观看| av高清不卡在线| 东方欧美亚洲色图在线| 狠狠狠色丁香婷婷综合激情| 视频一区视频二区中文字幕| 亚洲欧美偷拍另类a∨色屁股| 国产欧美va欧美不卡在线| 精品成a人在线观看| 日韩欧美在线综合网| 宅男在线国产精品| 91麻豆精品国产无毒不卡在线观看| 一本色道亚洲精品aⅴ| 波多野结衣一区二区三区| 国产不卡一区视频| 青青草国产成人av片免费| 亚洲专区一二三| 香蕉成人啪国产精品视频综合网| 亚洲综合色成人| 亚洲成av人片在线观看无码| 亚洲一区二区影院| 天天综合色天天综合| 日日夜夜精品视频免费| 奇米四色…亚洲| 国内精品国产三级国产a久久| 免费观看91视频大全| 美女免费视频一区二区| 麻豆传媒一区二区三区| 韩国女主播一区二区三区| 国产乱码精品1区2区3区| 国产精品系列在线观看| 成人深夜视频在线观看| 99re亚洲国产精品| 欧美影院一区二区三区| 欧美一区二区三区视频免费| 日韩欧美区一区二| 国产欧美日韩在线| 亚洲欧洲中文日韩久久av乱码| 亚洲综合小说图片| 麻豆精品新av中文字幕| 国产成人aaa| 在线观看91精品国产入口| 欧美日本精品一区二区三区| 日韩一区二区精品| 久久久.com| 国产精品对白交换视频| 亚洲国产一区二区三区| 麻豆成人91精品二区三区| 国产一区二区福利视频| 色综合中文综合网| 一本久久精品一区二区| 欧美日韩二区三区| 国产色婷婷亚洲99精品小说| 《视频一区视频二区| 婷婷国产在线综合| 成人黄色免费短视频| 欧美视频精品在线观看| 久久综合丝袜日本网| 一区二区三区91| 国产一区二区三区高清播放| 91影院在线观看| 精品久久国产老人久久综合| 国产精品理论在线观看| 日韩中文字幕一区二区三区| 丁香六月久久综合狠狠色| 欧美日韩成人激情| 国产精品免费看片| 九色|91porny| 欧美亚洲一区二区在线观看| 2023国产精品视频| 亚洲国产美国国产综合一区二区| 国产一区二区三区日韩 | 国产亚洲综合在线| 亚洲v日本v欧美v久久精品| 国产成人在线看| 91精选在线观看| 亚洲欧美日韩国产另类专区| 国内国产精品久久| 久久久99久久| 亚洲第一在线综合网站| 国产iv一区二区三区| 欧美一二三在线| 亚洲精品久久久蜜桃| 狠狠v欧美v日韩v亚洲ⅴ| 欧美色成人综合| √…a在线天堂一区| 久久精品国产**网站演员| 欧美性色aⅴ视频一区日韩精品| 欧美国产欧美亚州国产日韩mv天天看完整 | 91福利资源站| 日本一区二区电影| 精品制服美女丁香| 欧美一区二区私人影院日本| 亚洲精品免费在线观看| 成人福利视频在线| 国产调教视频一区| 国产一区二区伦理片| 日韩免费观看高清完整版在线观看| 亚洲国产你懂的| 欧美亚洲国产一区二区三区va | 欧美成人欧美edvon| 热久久免费视频| 欧美精品日韩精品| 天堂影院一区二区| 欧美日韩成人在线一区| 亚洲一区av在线| 欧美艳星brazzers| 亚洲成人资源网| 在线亚洲一区二区| 一卡二卡三卡日韩欧美| 欧美亚洲免费在线一区| 亚洲一区二区高清| 欧美理论在线播放| 日韩高清不卡在线| 日韩视频123| 捆绑紧缚一区二区三区视频| 日韩一区二区电影| 久久国产福利国产秒拍| 欧美va亚洲va在线观看蝴蝶网| 久久se这里有精品| 久久久三级国产网站| 国产馆精品极品| 中文字幕精品—区二区四季| fc2成人免费人成在线观看播放| 国产精品美女一区二区在线观看| 不卡一区二区中文字幕| 亚洲另类在线制服丝袜| 欧美日韩激情在线| 蜜桃av一区二区三区| 久久这里只有精品视频网| 粉嫩aⅴ一区二区三区四区 | 精品成人一区二区三区四区| 国产精品乡下勾搭老头1| 国产精品美女久久久久aⅴ| 99久久99久久综合| 亚洲午夜在线电影| 日韩欧美国产一区二区在线播放| 精久久久久久久久久久| 国产精品大尺度| 欧美日韩国产成人在线91| 毛片av一区二区三区| 国产免费观看久久| 日本韩国一区二区三区| 蜜臀av一区二区| 中文字幕亚洲一区二区va在线| 欧洲精品一区二区三区在线观看| 777午夜精品免费视频| 欧美日韩美少妇| 国产在线精品一区在线观看麻豆| 国产精品你懂的在线| 欧美日韩国产首页在线观看| 国产一区二区在线视频| 亚洲免费三区一区二区| 日韩一级片在线观看| 大尺度一区二区| 日韩国产高清影视| 中文字幕精品综合| 91精品婷婷国产综合久久性色 | 国产精品福利一区| 日韩一区二区在线观看视频播放| 国产成人综合自拍| 婷婷成人激情在线网| 中文字幕成人网| 日韩一卡二卡三卡国产欧美| 99精品国产99久久久久久白柏| 日本vs亚洲vs韩国一区三区二区 | 在线一区二区视频| 极品美女销魂一区二区三区| 一区二区免费在线播放| 国产视频在线观看一区二区三区| 欧美日韩精品一区二区三区蜜桃 | 国产成人自拍高清视频在线免费播放| 亚洲在线免费播放| 中文欧美字幕免费| 日韩视频在线你懂得| 在线观看日韩电影| 成人午夜碰碰视频| 韩国欧美国产1区| 日本va欧美va精品发布|