亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
美女在线观看视频一区二区| 国产三区在线成人av| 亚洲国产欧美日韩另类综合| 91香蕉视频黄| 亚洲一区二区三区中文字幕| 欧洲另类一二三四区| 午夜精品成人在线视频| 日韩一区二区免费在线观看| 经典三级视频一区| 中文字幕不卡在线播放| 色综合久久88色综合天天免费| 亚洲精品国产无套在线观| 欧美美女一区二区三区| 精彩视频一区二区三区| 中文字幕不卡在线| 欧美日韩国产成人在线免费| 韩国一区二区在线观看| 日韩一区在线看| 宅男噜噜噜66一区二区66| 国产精品亚洲视频| 一区二区三区.www| 久久美女艺术照精彩视频福利播放| zzijzzij亚洲日本少妇熟睡| 石原莉奈在线亚洲二区| 中文幕一区二区三区久久蜜桃| 在线观看区一区二| 国产一区二区三区免费观看| 一区二区理论电影在线观看| 日韩免费看的电影| 在线日韩av片| 国产91丝袜在线观看| 午夜电影一区二区| 中文字幕国产一区| 欧美一区二区人人喊爽| aaa国产一区| 久久成人久久鬼色| 亚洲一区二区欧美| 欧美经典一区二区| 日韩精品中文字幕在线一区| 91亚洲精华国产精华精华液| 国产一区在线观看视频| 婷婷六月综合网| 综合分类小说区另类春色亚洲小说欧美| 欧美一卡2卡3卡4卡| 欧洲国内综合视频| 成人丝袜视频网| 久久99蜜桃精品| 午夜视频在线观看一区二区三区 | 高清不卡在线观看av| 亚洲成人动漫一区| 亚洲欧洲国产日本综合| 国产偷国产偷精品高清尤物| 制服丝袜中文字幕亚洲| 在线亚洲免费视频| eeuss影院一区二区三区| 国产一区二区精品在线观看| 日韩精品一二区| 亚洲成人免费看| 一区二区三区久久久| 中文字幕欧美一区| 中文字幕精品一区二区精品绿巨人 | 香港成人在线视频| 亚洲裸体在线观看| 国产精品国产三级国产普通话蜜臀| 精品国产一区久久| 欧美α欧美αv大片| 日韩午夜激情电影| 欧美一级在线免费| 91精品黄色片免费大全| 欧美视频在线不卡| 欧美日韩一级视频| 欧美色精品在线视频| 欧美午夜精品久久久| 91精彩视频在线观看| 91免费看`日韩一区二区| 91啪九色porn原创视频在线观看| a级高清视频欧美日韩| 91亚洲国产成人精品一区二三| 91免费在线视频观看| 在线一区二区三区四区| 欧美理论片在线| 69堂精品视频| 日韩免费看网站| 久久久国际精品| 自拍偷拍亚洲综合| 一片黄亚洲嫩模| 亚洲成人午夜影院| 男男gaygay亚洲| 国产精品99久久久久久有的能看 | 久久免费视频色| 中文一区在线播放| 亚洲免费观看高清完整版在线| 亚洲影院免费观看| 天天爽夜夜爽夜夜爽精品视频| 首页综合国产亚洲丝袜| 国产自产v一区二区三区c| 成人一道本在线| 91国偷自产一区二区三区成为亚洲经典 | 亚洲精品国产品国语在线app| 午夜精品福利视频网站| 国产一区二区三区在线观看免费视频 | 国产欧美日韩亚州综合| 日韩理论在线观看| 日本欧美韩国一区三区| 成人免费视频视频| 欧美性大战久久久| 日韩女优视频免费观看| 1区2区3区欧美| 日本午夜一区二区| 国产高清不卡二三区| 欧美自拍偷拍一区| 亚洲精品一区二区三区99| 亚洲精品视频自拍| 精品一区二区三区欧美| 91啦中文在线观看| 亚洲精品一区二区三区99| 亚洲综合色婷婷| 国产一区二区在线视频| 欧美色图天堂网| 精品国产免费久久| 亚洲精品日产精品乱码不卡| 久草中文综合在线| 日本黄色一区二区| 久久久久久免费| 污片在线观看一区二区 | 91美女福利视频| www激情久久| 亚洲激情av在线| 国产成人亚洲综合a∨婷婷| 欧美性猛交xxxx乱大交退制版| 国产免费观看久久| 久久99精品国产| 欧美日韩视频第一区| 1000部国产精品成人观看| 精品中文字幕一区二区小辣椒 | 日本中文字幕一区二区有限公司| 99久久婷婷国产综合精品 | 欧美一级高清大全免费观看| 亚洲桃色在线一区| 国产麻豆精品95视频| 日韩亚洲欧美中文三级| 亚洲精品成人悠悠色影视| 成人亚洲精品久久久久软件| 日韩精品一区二区三区在线播放| 亚洲亚洲精品在线观看| 91污在线观看| 亚洲色图.com| 成年人网站91| 亚洲国产精品精华液ab| 国产制服丝袜一区| 精品噜噜噜噜久久久久久久久试看 | 国产精品久久影院| 国产精品18久久久久久vr| 欧美岛国在线观看| 男女激情视频一区| 6080国产精品一区二区| 亚洲成人午夜影院| 欧美日韩一级二级三级| 日韩美女一区二区三区四区| 色综合天天综合给合国产| 精品精品欲导航| 日韩1区2区日韩1区2区| 精品视频一区三区九区| 夜夜操天天操亚洲| 在线观看www91| 亚洲成人av免费| 欧美日韩在线免费视频| 午夜精品久久久久久久久久久 | 国产精品1区二区.| 亚洲天堂av一区| 成人av免费在线| 欧美国产禁国产网站cc| www.色精品| 一区二区日韩av| 88在线观看91蜜桃国自产| 日本不卡一区二区三区高清视频| 欧美一区二区在线不卡| 狂野欧美性猛交blacked| 久久影院视频免费| 成人看片黄a免费看在线| 亚洲私人影院在线观看| 成人夜色视频网站在线观看| 久久精品人人做人人综合 | 久久综合狠狠综合| 成熟亚洲日本毛茸茸凸凹| 亚洲欧洲一区二区在线播放| 91激情在线视频| 另类专区欧美蜜桃臀第一页| 久久久国产午夜精品| 色综合久久99| 琪琪一区二区三区| 国产精品视频九色porn| 在线观看一区二区精品视频| 蜜臂av日日欢夜夜爽一区| 337p日本欧洲亚洲大胆色噜噜| 成人禁用看黄a在线| 亚洲一二三专区| 久久综合给合久久狠狠狠97色69| 粉嫩一区二区三区性色av| 亚洲一区二区在线免费看|