亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品灌醉下药二区| 欧美美女直播网站| 国产精品伦理一区二区| 国产精品亚洲一区二区三区妖精 | 中文字幕一区二区三中文字幕| 国产成人精品在线看| 久久久久久免费网| www.在线欧美| 亚洲高清免费观看高清完整版在线观看 | 欧美电影免费观看高清完整版在线| 美国精品在线观看| 国产女同互慰高潮91漫画| bt7086福利一区国产| 亚洲美女视频在线| 欧美精品乱人伦久久久久久| 久久www免费人成看片高清| 久久一留热品黄| 99精品视频一区二区三区| 亚洲国产wwwccc36天堂| 日韩欧美一级片| 成人性色生活片| 亚洲一级片在线观看| 日韩精品中文字幕一区二区三区| 国产成人免费视频| 亚洲图片欧美色图| 久久奇米777| 91久久线看在观草草青青| 日本欧美一区二区三区| 日本一区二区三区国色天香| 欧美三区在线观看| 国产成人av电影在线| 亚洲成a人v欧美综合天堂下载 | 欧美男生操女生| 成人性视频网站| 日韩中文字幕亚洲一区二区va在线 | 福利一区福利二区| 日韩av网站免费在线| 中文字幕精品综合| 日韩视频一区二区在线观看| 99国产精品视频免费观看| 日本aⅴ亚洲精品中文乱码| 中文字幕av资源一区| 欧美日韩高清一区二区不卡| 国产精品一区二区91| 人人爽香蕉精品| 依依成人精品视频| 国产精品乱码久久久久久| 在线不卡的av| 欧美综合久久久| 成人精品gif动图一区| 麻豆国产欧美日韩综合精品二区| 亚洲欧洲精品一区二区三区| 精品国产乱码久久久久久浪潮| 日本高清成人免费播放| 国产成人超碰人人澡人人澡| 麻豆专区一区二区三区四区五区| 一区二区三区国产精华| 国产日韩欧美综合在线| 精品理论电影在线| 欧美精品免费视频| 欧美视频你懂的| 日本福利一区二区| 91丨九色丨蝌蚪丨老版| 菠萝蜜视频在线观看一区| 国产最新精品免费| 麻豆91小视频| 视频一区欧美精品| 日韩精品一二三区| 偷窥少妇高潮呻吟av久久免费| 亚洲精品水蜜桃| 亚洲免费av高清| 亚洲精品高清在线观看| 亚洲婷婷综合色高清在线| 中文字幕中文字幕在线一区| 国产香蕉久久精品综合网| 久久久久久久久99精品| 精品国产污污免费网站入口| 精品国产一区二区三区不卡 | 在线影院国内精品| 在线免费精品视频| 欧美亚洲国产一区二区三区va | 亚洲日穴在线视频| 亚洲精品成a人| 亚洲综合色成人| 夜夜精品视频一区二区 | 国产蜜臀97一区二区三区| 国产亚洲成av人在线观看导航| 久久久av毛片精品| 久久久国产一区二区三区四区小说| 久久免费看少妇高潮| 日本一区二区三级电影在线观看| 欧美国产精品一区二区三区| 国产精品另类一区| 亚洲免费电影在线| 午夜av区久久| 国产一区啦啦啦在线观看| 成人免费三级在线| 欧美性一区二区| 精品乱码亚洲一区二区不卡| 国产肉丝袜一区二区| 亚洲视频一二三区| 亚洲成国产人片在线观看| 精品一区二区三区在线观看| 国产999精品久久久久久| 色综合久久中文字幕| 欧美高清dvd| 久久久久久久久久久久电影| 亚洲色图第一区| 免费在线成人网| 99久久免费国产| 欧美一区二区三区性视频| 欧美精品一区二区三区视频| 亚洲三级免费电影| 麻豆精品视频在线观看| 成人午夜视频在线观看| 欧美视频三区在线播放| 亚洲精品一线二线三线无人区| 亚洲欧美自拍偷拍色图| 日本亚洲欧美天堂免费| 99精品在线免费| 欧美mv日韩mv| 亚洲自拍偷拍麻豆| 国产美女视频一区| 欧美日韩亚洲不卡| 国产精品午夜在线| 日本成人在线不卡视频| av电影一区二区| 精品国产一区二区国模嫣然| 亚洲综合色婷婷| 国产.欧美.日韩| 精品理论电影在线观看| 亚洲午夜影视影院在线观看| 国产成人av一区| 日韩欧美色电影| 亚洲电影在线免费观看| 丁香另类激情小说| 欧美成人伊人久久综合网| 夜夜嗨av一区二区三区四季av| 国产永久精品大片wwwapp| 在线不卡中文字幕播放| 亚洲天堂成人在线观看| 国产精品夜夜嗨| 欧美成人一区二区三区片免费| 亚洲一区二区五区| av电影天堂一区二区在线观看| 久久综合av免费| 男男视频亚洲欧美| 欧美日韩精品三区| 亚洲女同女同女同女同女同69| 高清免费成人av| 久久女同性恋中文字幕| 蜜桃视频在线观看一区二区| 欧美日韩一区二区三区在线看| 最新国产精品久久精品| 国产成人av福利| 国产午夜精品福利| 国产精品一区二区久久精品爱涩| 日韩情涩欧美日韩视频| 免费欧美在线视频| 欧美一区午夜视频在线观看| 亚洲国产一区二区在线播放| 色偷偷久久人人79超碰人人澡| 亚洲欧美在线另类| 91丝袜国产在线播放| 自拍偷拍国产亚洲| 色综合激情久久| 一区二区三区日韩欧美精品| 91亚洲精华国产精华精华液| 中文字幕在线一区免费| av电影在线不卡| 亚洲私人黄色宅男| 99久久99久久精品免费观看| 亚洲日本va午夜在线电影| 91麻豆免费看片| 亚洲一区二区三区视频在线| 在线观看欧美日本| 亚洲aⅴ怡春院| 日韩女优制服丝袜电影| 久久国产夜色精品鲁鲁99| 久久亚洲综合av| 不卡影院免费观看| 亚洲国产wwwccc36天堂| 欧美一区二区三区性视频| 国产一区二区三区免费看| 国产欧美一区二区三区在线看蜜臀| 国产99久久久国产精品潘金网站| 1区2区3区国产精品| 欧美性三三影院| 蜜桃av一区二区| 国产校园另类小说区| 99精品久久只有精品| 亚洲成av人片一区二区梦乃 | 久久女同互慰一区二区三区| 懂色av中文字幕一区二区三区| 日韩一区日韩二区| 欧美日韩三级视频| 国产在线视频一区二区| 亚洲人123区| 日韩欧美区一区二| 99在线热播精品免费|