亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
天堂一区二区在线| 一本大道av伊人久久综合| a亚洲天堂av| 欧美裸体一区二区三区| 中文字幕第一区第二区| 麻豆精品久久久| 日本高清不卡aⅴ免费网站| 久久久精品tv| 美女视频网站久久| 欧美性感一区二区三区| 国产精品理论在线观看| 黄色资源网久久资源365| 欧美影院一区二区三区| 亚洲视频一二三区| 国产精品一二二区| 日韩欧美激情四射| 天天综合色天天综合| 色老汉一区二区三区| 国产精品久久久久久久蜜臀| 国模娜娜一区二区三区| 91精品国产色综合久久ai换脸| 亚洲欧美偷拍三级| 久久成人av少妇免费| 在线观看视频欧美| 亚洲自拍与偷拍| 久国产精品韩国三级视频| 欧美少妇bbb| 国产精品久久久久久久久免费樱桃 | 日韩免费看的电影| 视频在线在亚洲| 欧美疯狂做受xxxx富婆| 亚洲一区二区三区视频在线播放| 色婷婷亚洲综合| 亚洲乱码中文字幕| 在线观看日产精品| 午夜在线成人av| 日韩一区二区三区在线| 久色婷婷小香蕉久久| 精品日韩99亚洲| 国产白丝精品91爽爽久久| 亚洲国产精品激情在线观看 | 日本免费新一区视频| 91精品国产一区二区三区蜜臀| 日韩经典中文字幕一区| 日韩精品中文字幕一区二区三区 | 久久―日本道色综合久久| 久久成人免费日本黄色| 国产日韩欧美精品一区| 91亚洲资源网| 亚洲成精国产精品女| 日韩一区二区三区电影在线观看| 久久精品国产亚洲a| 久久先锋资源网| 91亚洲国产成人精品一区二区三| 尤物av一区二区| 日韩三区在线观看| 国产成人av一区二区三区在线观看| 国产精品色眯眯| 精品视频免费在线| 国产美女精品一区二区三区| 欧美国产1区2区| 欧美日韩电影在线| 国产福利精品导航| 性久久久久久久久久久久| 日韩精品一区二区在线| 99国产精品国产精品毛片| 午夜精品视频一区| 欧美高清在线精品一区| 欧美日韩精品一二三区| 国产麻豆日韩欧美久久| 一区二区三区不卡视频| 精品福利一区二区三区免费视频| 99综合影院在线| 免费不卡在线观看| 中文字幕日本不卡| 欧美电影精品一区二区| 色婷婷一区二区三区四区| 国产毛片精品一区| 午夜一区二区三区视频| 中文字幕日韩一区| 久久免费国产精品| 欧美区视频在线观看| 91网站最新地址| 国产精品亚洲第一| 六月丁香婷婷色狠狠久久| 亚洲欧美日韩成人高清在线一区| 26uuu国产在线精品一区二区| 欧美性xxxxxx少妇| 91欧美激情一区二区三区成人| 精品中文av资源站在线观看| 一区二区三区91| 亚洲欧洲美洲综合色网| 精品久久久影院| 欧美一区二区三区视频免费播放| 色综合久久综合网欧美综合网| 国产一区二区三区在线观看免费 | 一区二区三区四区不卡视频| 久久九九国产精品| 欧美va天堂va视频va在线| 欧美性大战久久久久久久| 99久久国产免费看| 懂色av一区二区三区免费观看| 精品中文字幕一区二区| 美腿丝袜在线亚洲一区| 午夜国产精品一区| 日韩精品欧美精品| 午夜婷婷国产麻豆精品| 亚洲国产精品人人做人人爽| 亚洲综合视频在线| 亚洲一区二区精品3399| 亚洲成人免费在线| 亚洲成人在线观看视频| 香蕉乱码成人久久天堂爱免费| 亚洲电影一区二区| 亚洲va欧美va天堂v国产综合| 亚洲国产精品视频| 日韩va亚洲va欧美va久久| 日韩精品五月天| 免费成人在线影院| 激情综合一区二区三区| 狠狠色丁香久久婷婷综| 国产成人综合在线观看| 成人免费毛片片v| 91视频xxxx| 欧美日韩精品专区| 日韩午夜电影在线观看| 精品久久久久久久久久久院品网 | 成人黄色软件下载| 91在线porny国产在线看| 在线免费不卡视频| 91精品国产综合久久香蕉的特点| 日韩三级高清在线| 久久精品视频网| 国产精品国产自产拍高清av王其| 日韩美女精品在线| 日韩经典中文字幕一区| 国产精品一卡二| 日韩欧美一级在线播放| 久久久久久久精| 亚洲欧美精品午睡沙发| 午夜激情久久久| 国产成人超碰人人澡人人澡| 在线一区二区三区做爰视频网站| 欧美影院一区二区| 久久久亚洲高清| 樱桃国产成人精品视频| 久久99精品一区二区三区三区| 成人手机电影网| 欧美日韩国产色站一区二区三区| 欧美白人最猛性xxxxx69交| 中文字幕亚洲区| 久久精品国产秦先生| 99精品欧美一区二区三区小说| 欧美日韩一区二区三区在线| 久久午夜色播影院免费高清| 一区2区3区在线看| 国产真实乱子伦精品视频| 色欧美日韩亚洲| 欧美精品一区二区三区高清aⅴ| 亚洲欧美在线高清| 男人的天堂久久精品| 91网上在线视频| 久久久久高清精品| 天天综合网 天天综合色| av网站一区二区三区| 欧美电影免费观看高清完整版在线观看 | 激情综合网av| 欧洲精品视频在线观看| 中文字幕av资源一区| 美美哒免费高清在线观看视频一区二区| 91色综合久久久久婷婷| 国产亚洲欧美日韩在线一区| 午夜av一区二区三区| 成人福利视频网站| 国产亚洲欧美在线| 久久国产精品一区二区| 欧美日韩不卡在线| 亚洲精品久久7777| 9色porny自拍视频一区二区| 久久久精品tv| 欧美一区二区三区四区在线观看| 亚洲欧美另类图片小说| 成人免费精品视频| 国产色产综合产在线视频| 久久国产精品露脸对白| 911国产精品| 亚洲www啪成人一区二区麻豆| 91美女视频网站| ...xxx性欧美| 99re66热这里只有精品3直播| 久久久久97国产精华液好用吗| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美美女网站色| 午夜影院久久久| 欧美精品xxxxbbbb| 亚洲午夜久久久久中文字幕久| 在线观看区一区二| 亚洲一区二区三区视频在线| 欧美三区在线观看| 日韩精品电影一区亚洲|