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

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

?? timer.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? 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 991 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.
//
//*****************************************************************************
#if defined(GROUP_enable) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_disable) || defined(BUILD_ALL) || defined(DOXYGEN)
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));
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_configure) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_controllevel) || defined(BUILD_ALL) || defined(DOXYGEN)
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)));
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_controltrigger) || defined(BUILD_ALL) || defined(DOXYGEN)
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)));
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_controlevent) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_controlstall) || defined(BUILD_ALL) || defined(DOXYGEN)
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)));
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_rtcenable) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲蜜桃精久久久久久久| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲欧洲性图库| 99久久精品免费| 久久久激情视频| 国产91在线看| 亚洲综合清纯丝袜自拍| 欧美人动与zoxxxx乱| 热久久久久久久| 国产性色一区二区| 欧美在线观看一区| 蜜臀久久久久久久| 精品理论电影在线观看| 国产v日产∨综合v精品视频| 国产福利视频一区二区三区| 亚洲自拍偷拍av| 午夜精品爽啪视频| 国产精品国产三级国产a| 欧美丰满嫩嫩电影| www.爱久久.com| 日本免费新一区视频| 亚洲伦理在线免费看| 欧美精品一区二区三区在线| 欧美亚州韩日在线看免费版国语版| 国产精品资源在线观看| 亚洲成av人片在www色猫咪| 国产精品高潮呻吟久久| 亚洲自拍偷拍麻豆| 久久国产综合精品| 日本美女一区二区三区| 粉嫩绯色av一区二区在线观看| av在线播放不卡| 91精品国产综合久久精品| 99精品在线免费| 欧美日韩一级片网站| 91成人国产精品| 91在线小视频| 日韩一区二区电影网| 欧美日韩国产综合久久| 2021中文字幕一区亚洲| 日韩欧美成人午夜| 欧美一级艳片视频免费观看| 国产精品污污网站在线观看| 五月天中文字幕一区二区| 国产精品一区二区黑丝| 欧美精品tushy高清| 亚洲色图丝袜美腿| 亚洲免费av高清| 精品一区在线看| 精品一区二区综合| 精品视频全国免费看| 欧美激情在线一区二区| 国产清纯白嫩初高生在线观看91| 精品国产乱码91久久久久久网站| 亚洲欧美另类久久久精品| 国产精品一二三在| 精品国产乱码久久久久久免费| 夜夜操天天操亚洲| 日韩电影在线观看一区| 色婷婷精品大在线视频 | 成人免费看的视频| 99免费精品视频| 欧美一区二区三区思思人| 亚洲一区影音先锋| 色综合久久综合| 亚洲人成网站在线| 9人人澡人人爽人人精品| 久久久亚洲欧洲日产国码αv| 日日欢夜夜爽一区| 精品一区二区三区在线播放视频| 欧美日产在线观看| 亚洲成人久久影院| 欧美日韩成人综合在线一区二区| 一区二区三区不卡视频 | 香蕉av福利精品导航| 欧美一a一片一级一片| 亚洲色图制服丝袜| 欧美伊人久久久久久午夜久久久久| 一区在线播放视频| 99久久伊人网影院| 亚洲欧美另类小说| 欧美日韩亚洲高清一区二区| 午夜一区二区三区视频| 欧美精品黑人性xxxx| 爽爽淫人综合网网站| 欧美一三区三区四区免费在线看| 蜜臀av性久久久久蜜臀av麻豆 | 国产欧美一区二区三区网站| 国产成人免费9x9x人网站视频| 欧美国产一区二区| 91丨porny丨最新| 日韩视频一区二区在线观看| 久久国产人妖系列| 中日韩av电影| 欧美高清dvd| 国产一区二区影院| 欧美日韩国产成人在线免费| 青青草一区二区三区| 国产日产欧美一区二区三区| 91免费国产在线| 美女爽到高潮91| 亚洲欧美综合色| 欧美色电影在线| 国产在线精品免费| 亚洲欧美在线aaa| 欧美日韩午夜精品| 丁香婷婷综合网| 视频在线观看91| 国产精品国产三级国产aⅴ原创 | 久色婷婷小香蕉久久| 日本一区二区免费在线| 欧美写真视频网站| 蜜臀91精品一区二区三区| 亚洲图片欧美激情| 日韩欧美电影在线| 欧美日韩中文精品| 成人一区二区视频| 蜜桃视频免费观看一区| 一区二区三区美女| 国产精品毛片无遮挡高清| 91精品在线免费| 日本亚洲欧美天堂免费| 1024成人网色www| 日韩视频在线一区二区| 欧美系列一区二区| 99视频一区二区三区| 精品一区二区免费看| 亚洲午夜精品在线| 91精品蜜臀在线一区尤物| 国产91精品一区二区麻豆网站| 日本麻豆一区二区三区视频| 亚洲影院免费观看| 亚洲精品五月天| 中文字幕在线免费不卡| 国产欧美日韩视频在线观看| 欧美videos中文字幕| 欧美乱妇15p| 欧美日韩免费一区二区三区视频| 91女神在线视频| 91蜜桃传媒精品久久久一区二区| 粉嫩蜜臀av国产精品网站| 极品瑜伽女神91| 国产一区视频导航| 韩国毛片一区二区三区| 国产精品国产三级国产aⅴ无密码| 精品91自产拍在线观看一区| 欧美一卡二卡三卡四卡| 欧美猛男男办公室激情| 4438x亚洲最大成人网| 欧美午夜理伦三级在线观看| 91免费国产在线观看| 91在线云播放| 91色综合久久久久婷婷| 一本久道中文字幕精品亚洲嫩| 91免费看片在线观看| 色婷婷国产精品久久包臀| 91久久线看在观草草青青| 丰满少妇久久久久久久| 懂色av一区二区三区免费观看| 成人久久18免费网站麻豆 | 国产一区二区调教| 国产伦精品一区二区三区视频青涩| 国模冰冰炮一区二区| 丁香婷婷综合激情五月色| 色综合天天综合网天天狠天天| 一区二区三区不卡在线观看 | 久久久久久久久久久久久夜| 日韩女优av电影| 国产欧美一区二区三区网站| 亚洲人成影院在线观看| 亚洲va天堂va国产va久| 老司机一区二区| 丁香激情综合五月| 欧美在线不卡视频| 精品久久久三级丝袜| 中文字幕中文字幕中文字幕亚洲无线| 亚洲理论在线观看| 久久精品国产久精国产爱| 东方aⅴ免费观看久久av| av激情综合网| 777久久久精品| 国产精品久久久久久久久免费樱桃| 亚洲精品视频在线观看网站| 久久电影网电视剧免费观看| 成人福利视频网站| 男女男精品视频| www.亚洲人| 日韩欧美一区二区三区在线| 欧美高清视频www夜色资源网| 亚洲乱码国产乱码精品精小说 | 国产风韵犹存在线视精品| 日本电影欧美片| 精品欧美乱码久久久久久1区2区| 国产精品欧美一区二区三区| 亚洲高清一区二区三区| 成人黄色国产精品网站大全在线免费观看 | 7777精品伊人久久久大香线蕉的| 国产欧美精品一区二区三区四区 | 久久丝袜美腿综合| 亚洲h动漫在线|