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

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

?? timer.c

?? 飛利浦LM3S系列ARM的庫文件,在進行arm開發時所必須的庫文件,直接加到工程中,一般不必修改.
?? C
?? 第 1 頁 / 共 3 頁
字號:
//*****************************************************************************
//
// timer.c - Driver for the timer module.
//
// 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 687 of the Stellaris Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup timer_api
//! @{
//
//*****************************************************************************

#include "hw_ints.h"
#include "hw_memmap.h"
#include "hw_timer.h"
#include "hw_types.h"
#include "debug.h"
#include "interrupt.h"
#include "timer.h"

//*****************************************************************************
//
//! Enables the timer(s).
//!
//! \param ulBase is the base address of the timer module.
//! \param ulTimer specifies the timer(s) to enable; must be one of \b TIMER_A,
//! \b TIMER_B, or \b TIMER_BOTH.
//!
//! This will enable operation of the timer module.  The timer must be
//! configured before it is enabled.
//!
//! \return None.
//
//*****************************************************************************
void
TimerEnable(unsigned long ulBase, unsigned long ulTimer)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulTimer == TIMER_A) || (ulTimer == TIMER_B) ||
           (ulTimer == TIMER_BOTH));

    //
    // Enable the timer(s) module.
    //
    HWREG(ulBase + TIMER_O_CTL) |= ulTimer & (TIMER_CTL_TAEN | TIMER_CTL_TBEN);
}

//*****************************************************************************
//
//! Disables the timer(s).
//!
//! \param ulBase is the base address of the timer module.
//! \param ulTimer specifies the timer(s) to disable; must be one of
//! \b TIMER_A, \b TIMER_B, or \b TIMER_BOTH.
//!
//! This will disable operation of the timer module.
//!
//! \return None.
//
//*****************************************************************************
void
TimerDisable(unsigned long ulBase, unsigned long ulTimer)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulTimer == TIMER_A) || (ulTimer == TIMER_B) ||
           (ulTimer == TIMER_BOTH));

    //
    // Disable the timer module.
    //
    HWREG(ulBase + TIMER_O_CTL) &= ~(ulTimer &
                                     (TIMER_CTL_TAEN | TIMER_CTL_TBEN));
}

//*****************************************************************************
//
//! Configures the timer(s).
//!
//! \param ulBase is the base address of the timer module.
//! \param ulConfig is the configuration for the timer.
//!
//! This function configures the operating mode of the timer(s).  The timer
//! module is disabled before being configured, and is left in the disabled
//! state.  The configuration is specified in \e ulConfig as one of the
//! following values:
//!
//! - \b TIMER_CFG_32_BIT_OS - 32-bit one shot timer
//! - \b TIMER_CFG_32_BIT_PER - 32-bit periodic timer
//! - \b TIMER_CFG_32_RTC - 32-bit real time clock timer
//! - \b TIMER_CFG_16_BIT_PAIR - Two 16-bit timers
//!
//! When configured for a pair of 16-bit timers, each timer is separately
//! configured.  The first timer is configured by setting \e ulConfig to
//! the result of a logical OR operation between one of the following values
//! and \e ulConfig:
//!
//! - \b TIMER_CFG_A_ONE_SHOT - 16-bit one shot timer
//! - \b TIMER_CFG_A_PERIODIC - 16-bit periodic timer
//! - \b TIMER_CFG_A_CAP_COUNT - 16-bit edge count capture
//! - \b TIMER_CFG_A_CAP_TIME - 16-bit edge time capture
//! - \b TIMER_CFG_A_PWM - 16-bit PWM output
//!
//! Similarly, the second timer is configured by setting \e ulConfig to
//! the result of a logical OR operation between one of the corresponding
//! \b TIMER_CFG_B_* values and \e ulConfig.
//!
//! \return None.
//
//*****************************************************************************
void
TimerConfigure(unsigned long ulBase, unsigned long ulConfig)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulConfig == TIMER_CFG_32_BIT_OS) ||
           (ulConfig == TIMER_CFG_32_BIT_PER) ||
           (ulConfig == TIMER_CFG_32_RTC) ||
           ((ulConfig & 0xff000000) == TIMER_CFG_16_BIT_PAIR));
    ASSERT(((ulConfig & 0xff000000) != TIMER_CFG_16_BIT_PAIR) ||
           ((((ulConfig & 0x000000ff) == TIMER_CFG_A_ONE_SHOT) ||
             ((ulConfig & 0x000000ff) == TIMER_CFG_A_PERIODIC) ||
             ((ulConfig & 0x000000ff) == TIMER_CFG_A_CAP_COUNT) ||
             ((ulConfig & 0x000000ff) == TIMER_CFG_A_CAP_TIME) ||
             ((ulConfig & 0x000000ff) == TIMER_CFG_A_PWM)) &&
            (((ulConfig & 0x0000ff00) == TIMER_CFG_B_ONE_SHOT) ||
             ((ulConfig & 0x0000ff00) == TIMER_CFG_B_PERIODIC) ||
             ((ulConfig & 0x0000ff00) == TIMER_CFG_B_CAP_COUNT) ||
             ((ulConfig & 0x0000ff00) == TIMER_CFG_B_CAP_TIME) ||
             ((ulConfig & 0x0000ff00) == TIMER_CFG_B_PWM))));

    //
    // Disable the timers.
    //
    HWREG(ulBase + TIMER_O_CTL) &= ~(TIMER_CTL_TAEN | TIMER_CTL_TBEN);

    //
    // Set the global timer configuration.
    //
    HWREG(ulBase + TIMER_O_CFG) = ulConfig >> 24;

    //
    // Set the configuration of the A and B timers.  Note that the B timer
    // configuration is ignored by the hardware in 32-bit modes.
    //
    HWREG(ulBase + TIMER_O_TAMR) = ulConfig & 255;
    HWREG(ulBase + TIMER_O_TBMR) = (ulConfig >> 8) & 255;
}

//*****************************************************************************
//
//! Controls the output level.
//!
//! \param ulBase is the base address of the timer module.
//! \param ulTimer specifies the timer(s) to adjust; must be one of \b TIMER_A,
//! \b TIMER_B, or \b TIMER_BOTH.
//! \param bInvert specifies the output level.
//!
//! This function sets the PWM output level for the specified timer.  If the
//! parameter \e bInvert is \b true, then the timer's output will be made
//! active low; otherwise, it will be made active high.
//!
//! \return None.
//
//*****************************************************************************
void
TimerControlLevel(unsigned long ulBase, unsigned long ulTimer,
                  tBoolean bInvert)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulTimer == TIMER_A) || (ulTimer == TIMER_B) ||
           (ulTimer == TIMER_BOTH));

    //
    // Set the output levels as requested.
    //
    ulTimer &= TIMER_CTL_TAPWML | TIMER_CTL_TBPWML;
    HWREG(ulBase + TIMER_O_CTL) = (bInvert ?
                                   (HWREG(ulBase + TIMER_O_CTL) | ulTimer) :
                                   (HWREG(ulBase + TIMER_O_CTL) & ~(ulTimer)));
}

//*****************************************************************************
//
//! Enables or disables the trigger output.
//!
//! \param ulBase is the base address of the timer module.
//! \param ulTimer specifies the timer to adjust; must be one of \b TIMER_A,
//! \b TIMER_B, or \b TIMER_BOTH.
//! \param bEnable specifies the desired trigger state.
//!
//! This function controls the trigger output for the specified timer.  If the
//! parameter \e bEnable is \b true, then the timer's output trigger is
//! enabled; otherwise it is disabled.
//!
//! \return None.
//
//*****************************************************************************
void
TimerControlTrigger(unsigned long ulBase, unsigned long ulTimer,
                    tBoolean bEnable)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulTimer == TIMER_A) || (ulTimer == TIMER_B) ||
           (ulTimer == TIMER_BOTH));

    //
    // Set the trigger output as requested.
    //
    ulTimer &= TIMER_CTL_TAOTE | TIMER_CTL_TBOTE;
    HWREG(ulBase + TIMER_O_CTL) = (bEnable ?
                                   (HWREG(ulBase + TIMER_O_CTL) | ulTimer) :
                                   (HWREG(ulBase + TIMER_O_CTL) & ~(ulTimer)));
}

//*****************************************************************************
//
//! Controls the event type.
//!
//! \param ulBase is the base address of the timer module.
//! \param ulTimer specifies the timer(s) to be adjusted; must be one of
//! \b TIMER_A, \b TIMER_B, or \b TIMER_BOTH.
//! \param ulEvent specifies the type of event; must be one of
//! \b TIMER_EVENT_POS_EDGE, \b TIMER_EVENT_NEG_EDGE, or
//! \b TIMER_EVENT_BOTH_EDGES.
//!
//! This function sets the signal edge(s) that will trigger the timer when in
//! capture mode.
//!
//! \return None.
//
//*****************************************************************************
void
TimerControlEvent(unsigned long ulBase, unsigned long ulTimer,
                  unsigned long ulEvent)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulTimer == TIMER_A) || (ulTimer == TIMER_B) ||
           (ulTimer == TIMER_BOTH));

    //
    // Set the event type.
    //
    ulEvent &= ulTimer & TIMER_CTL_TAEVENT_MSK | TIMER_CTL_TBEVENT_MSK;
    HWREG(ulBase + TIMER_O_CTL) = ((HWREG(ulBase + TIMER_O_CTL) &
                                    ~(TIMER_CTL_TAEVENT_MSK |
                                      TIMER_CTL_TBEVENT_MSK)) | ulEvent);
}

//*****************************************************************************
//
//! Controls the stall handling.
//!
//! \param ulBase is the base address of the timer module.
//! \param ulTimer specifies the timer(s) to be adjusted; must be one of
//! \b TIMER_A, \b TIMER_B, or \b TIMER_BOTH.
//! \param bStall specifies the response to a stall signal.
//!
//! This function controls the stall response for the specified timer.  If the
//! parameter \e bStall is \b true, then the timer will stop counting if the
//! processor enters debug mode; otherwise the timer will keep running while in
//! debug mode.
//!
//! \return None.
//
//*****************************************************************************
void
TimerControlStall(unsigned long ulBase, unsigned long ulTimer,
                  tBoolean  bStall)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));
    ASSERT((ulTimer == TIMER_A) || (ulTimer == TIMER_B) ||
           (ulTimer == TIMER_BOTH));

    //
    // Set the stall mode.
    //
    ulTimer &= TIMER_CTL_TASTALL | TIMER_CTL_TBSTALL;
    HWREG(ulBase + TIMER_O_CTL) = (bStall ?
                                   (HWREG(ulBase + TIMER_O_CTL) | ulTimer) :
                                   (HWREG(ulBase + TIMER_O_CTL) & ~(ulTimer)));
}

//*****************************************************************************
//
//! Enable RTC counting.
//!
//! \param ulBase is the base address of the timer module.
//!
//! This function causes the timer to start counting when in RTC mode.  If not
//! configured for RTC mode, this will do nothing.
//!
//! \return None.
//
//*****************************************************************************
void
TimerRTCEnable(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
           (ulBase == TIMER2_BASE));

    //
    // Enable RTC counting.
    //
    HWREG(ulBase + TIMER_O_CTL) |= TIMER_CTL_RTCEN;
}

//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色狠狠色合久久伊人| 久久国产精品无码网站| 国产日产欧美一区二区视频| 欧美一区二区视频网站| 91精品国产综合久久久久| 欧美另类高清zo欧美| 欧美精选一区二区| 欧美一区二区三区性视频| 欧美一级二级三级乱码| 日韩欧美一区在线观看| 精品国产乱码久久久久久浪潮| 日韩三级中文字幕| www国产精品av| 中日韩av电影| 亚洲欧美视频一区| 亚洲va中文字幕| 蜜臀av性久久久久蜜臀aⅴ流畅| 美女任你摸久久| 国产91精品一区二区麻豆亚洲| 国产成人8x视频一区二区| aaa国产一区| 欧美视频一区二区在线观看| 欧美一区二区三区性视频| 国产亚洲一区二区三区四区| 国产精品麻豆网站| 日韩精品亚洲专区| 精品亚洲aⅴ乱码一区二区三区| 国产91高潮流白浆在线麻豆| 99re亚洲国产精品| 3d成人动漫网站| 国产精品三级在线观看| 亚洲成人高清在线| 国产乱码精品一区二区三区五月婷 | 精品久久久久久久久久久久久久久| 精品久久久久一区| 亚洲欧洲国产专区| 蜜芽一区二区三区| 91浏览器在线视频| 久久久午夜电影| 亚洲国产美女搞黄色| 国产一区二区导航在线播放| 欧美亚洲综合网| 久久精品一区二区| 亚洲第一福利视频在线| 成人网在线免费视频| 91麻豆精品国产自产在线| 中文字幕一区二区三区在线不卡| 蜜桃视频一区二区三区在线观看| 91蝌蚪porny九色| xnxx国产精品| 蜜桃视频第一区免费观看| 一本在线高清不卡dvd| 久久久99久久| 九九视频精品免费| 欧美日韩极品在线观看一区| 亚洲欧美日韩中文播放| 国产成人综合视频| 精品国产欧美一区二区| 午夜天堂影视香蕉久久| 色狠狠一区二区三区香蕉| 欧美激情资源网| 国产一区二区在线看| 在线不卡一区二区| 亚洲图片自拍偷拍| 欧美无砖专区一中文字| 依依成人综合视频| 在线看不卡av| 亚洲精品视频免费看| 色网综合在线观看| 一区二区三区在线观看欧美| 色香色香欲天天天影视综合网| 国产精品久久国产精麻豆99网站| 国产真实乱偷精品视频免| 精品美女在线观看| 国产一区二区三区四区在线观看| 欧美成人一区二区三区在线观看| 强制捆绑调教一区二区| 7799精品视频| 精油按摩中文字幕久久| 26uuu欧美| 国产成人精品免费在线| 国产精品乱人伦中文| 91丝袜美腿高跟国产极品老师| 国产精品久久久久久久久搜平片| 成人h精品动漫一区二区三区| 综合色天天鬼久久鬼色| 色婷婷av一区二区三区之一色屋| 亚洲精品视频在线| 欧美一级二级三级蜜桃| 国产精品综合在线视频| 中文一区二区完整视频在线观看| 波多野结衣中文一区| 中文字幕在线不卡国产视频| 欧美影视一区二区三区| 免费观看30秒视频久久| 国产日产欧美精品一区二区三区| 91在线看国产| 爽好久久久欧美精品| 久久久久久久免费视频了| 99精品欧美一区二区蜜桃免费| 亚洲午夜激情av| 精品精品国产高清一毛片一天堂| 国产99精品视频| 亚洲成av人综合在线观看| 精品女同一区二区| 91免费观看在线| 欧美a一区二区| 国产精品久久久久天堂| 欧美福利视频一区| 99天天综合性| 九九**精品视频免费播放| 亚洲欧美乱综合| 精品剧情v国产在线观看在线| aaa欧美大片| 蜜桃av一区二区| 一区二区三区蜜桃| 国产亚洲欧美在线| 欧美人妖巨大在线| 成人av电影观看| 美国毛片一区二区| 亚洲综合激情另类小说区| 国产日产欧美一区| 欧美一区二区三区精品| 91久久精品网| 成人在线视频首页| 玖玖九九国产精品| 亚洲va在线va天堂| 一区二区三区四区av| 国产日韩欧美一区二区三区综合| 3751色影院一区二区三区| 91捆绑美女网站| 播五月开心婷婷综合| 国产精品原创巨作av| 日韩精品免费专区| 亚洲最快最全在线视频| 国产精品久久久久久户外露出| www激情久久| 精品国产电影一区二区| 欧美理论电影在线| 欧美日韩国产片| 在线免费观看成人短视频| av电影天堂一区二区在线观看| 精品写真视频在线观看| 日韩精品免费视频人成| 日韩综合小视频| 午夜精品aaa| 亚洲成人www| 天堂久久一区二区三区| 亚洲福利一区二区三区| 亚洲香蕉伊在人在线观| 亚洲成人动漫一区| 日本视频免费一区| 日韩av不卡一区二区| 日韩av中文在线观看| 首页综合国产亚洲丝袜| 日韩精品一二三| 激情av综合网| 国产精品夜夜嗨| 成人av在线一区二区| 91免费版pro下载短视频| 91色porny在线视频| 欧美性色综合网| 91精品久久久久久久91蜜桃| 日韩欧美中文一区| 久久久久久久免费视频了| 国产日韩欧美精品一区| 国产精品成人午夜| 亚洲h在线观看| 久久精品国产精品亚洲精品 | 成人性生交大片免费看中文| 成人黄色av网站在线| 91麻豆swag| 91麻豆精品久久久久蜜臀| 久久在线观看免费| 中文字幕一区二区三区在线观看 | 国产黄色成人av| www.视频一区| 欧美亚洲免费在线一区| 日韩免费高清av| 亚洲丝袜美腿综合| 麻豆视频一区二区| 成人av网在线| 欧美一区二区三区啪啪| 日本一区二区综合亚洲| 亚洲成人动漫在线观看| 国精产品一区一区三区mba桃花| www.欧美精品一二区| 欧美精品高清视频| 亚洲国产激情av| 免费高清视频精品| 91免费在线看| 精品国产电影一区二区| 亚洲一区二区中文在线| 国产一区二区视频在线播放| 欧美午夜免费电影| 国产欧美日韩另类视频免费观看| 视频一区中文字幕国产| 99久久久精品| 久久综合久久鬼色| 日日摸夜夜添夜夜添国产精品|