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

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

?? interrupt.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// interrupt.c - Driver for the NVIC Interrupt Controller.
//
// Copyright (c) 2005-2010 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// 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. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 5821 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup interrupt_api
//! @{
//
//*****************************************************************************

#include "inc/hw_ints.h"
#include "inc/hw_nvic.h"
#include "inc/hw_types.h"
#include "driverlib/cpu.h"
#include "driverlib/debug.h"
#include "driverlib/interrupt.h"

//*****************************************************************************
//
// This is a mapping between priority grouping encodings and the number of
// preemption priority bits.
//
//*****************************************************************************
static const unsigned long g_pulPriority[] =
{
    NVIC_APINT_PRIGROUP_0_8, NVIC_APINT_PRIGROUP_1_7, NVIC_APINT_PRIGROUP_2_6,
    NVIC_APINT_PRIGROUP_3_5, NVIC_APINT_PRIGROUP_4_4, NVIC_APINT_PRIGROUP_5_3,
    NVIC_APINT_PRIGROUP_6_2, NVIC_APINT_PRIGROUP_7_1
};

//*****************************************************************************
//
// This is a mapping between interrupt number and the register that contains
// the priority encoding for that interrupt.
//
//*****************************************************************************
static const unsigned long g_pulRegs[] =
{
    0, NVIC_SYS_PRI1, NVIC_SYS_PRI2, NVIC_SYS_PRI3, NVIC_PRI0, NVIC_PRI1,
    NVIC_PRI2, NVIC_PRI3, NVIC_PRI4, NVIC_PRI5, NVIC_PRI6, NVIC_PRI7,
    NVIC_PRI8, NVIC_PRI9, NVIC_PRI10, NVIC_PRI11, NVIC_PRI12, NVIC_PRI13
};

//*****************************************************************************
//
//! \internal
//! The default interrupt handler.
//!
//! This is the default interrupt handler for all interrupts.  It simply loops
//! forever so that the system state is preserved for observation by a
//! debugger.  Since interrupts should be disabled before unregistering the
//! corresponding handler, this should never be called.
//!
//! \return None.
//
//*****************************************************************************
static void
IntDefaultHandler(void)
{
    //
    // Go into an infinite loop.
    //
    while(1)
    {
    }
}

//*****************************************************************************
//
// The processor vector table.
//
// This contains a list of the handlers for the various interrupt sources in
// the system.  The layout of this list is defined by the hardware; assertion
// of an interrupt causes the processor to start executing directly at the
// address given in the corresponding location in this list.
//
//*****************************************************************************
#if defined(ewarm)
static __no_init void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void) @ "VTABLE";
#elif defined(sourcerygxx)
static __attribute__((section(".cs3.region-head.ram")))
void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void);
#elif defined(ccs)
#pragma DATA_SECTION(g_pfnRAMVectors, ".vtable")
void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void);
#else
static __attribute__((section("vtable")))
void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void);
#endif

//*****************************************************************************
//
//! Enables the processor interrupt.
//!
//! Allows the processor to respond to interrupts.  This does not affect the
//! set of interrupts enabled in the interrupt controller; it just gates the
//! single interrupt from the controller to the processor.
//!
//! \note Previously, this function had no return value.  As such, it was
//! possible to include <tt>interrupt.h</tt> and call this function without
//! having included <tt>hw_types.h</tt>.  Now that the return is a
//! <tt>tBoolean</tt>, a compiler error will occur in this case.  The solution
//! is to include <tt>hw_types.h</tt> before including <tt>interrupt.h</tt>.
//!
//! \return Returns \b true if interrupts were disabled when the function was
//! called or \b false if they were initially enabled.
//
//*****************************************************************************
tBoolean
IntMasterEnable(void)
{
    //
    // Enable processor interrupts.
    //
    return(CPUcpsie());
}

//*****************************************************************************
//
//! Disables the processor interrupt.
//!
//! Prevents the processor from receiving interrupts.  This does not affect the
//! set of interrupts enabled in the interrupt controller; it just gates the
//! single interrupt from the controller to the processor.
//!
//! \note Previously, this function had no return value.  As such, it was
//! possible to include <tt>interrupt.h</tt> and call this function without
//! having included <tt>hw_types.h</tt>.  Now that the return is a
//! <tt>tBoolean</tt>, a compiler error will occur in this case.  The solution
//! is to include <tt>hw_types.h</tt> before including <tt>interrupt.h</tt>.
//!
//! \return Returns \b true if interrupts were already disabled when the
//! function was called or \b false if they were initially enabled.
//
//*****************************************************************************
tBoolean
IntMasterDisable(void)
{
    //
    // Disable processor interrupts.
    //
    return(CPUcpsid());
}

//*****************************************************************************
//
//! Registers a function to be called when an interrupt occurs.
//!
//! \param ulInterrupt specifies the interrupt in question.
//! \param pfnHandler is a pointer to the function to be called.
//!
//! This function is used to specify the handler function to be called when the
//! given interrupt is asserted to the processor.  When the interrupt occurs,
//! if it is enabled (via IntEnable()), the handler function will be called in
//! interrupt context.  Since the handler function can preempt other code, care
//! must be taken to protect memory or peripherals that are accessed by the
//! handler and other non-handler code.
//!
//! \note The use of this function (directly or indirectly via a peripheral
//! driver interrupt register function) moves the interrupt vector table from
//! flash to SRAM.  Therefore, care must be taken when linking the application
//! to ensure that the SRAM vector table is located at the beginning of SRAM;
//! otherwise NVIC will not look in the correct portion of memory for the
//! vector table (it requires the vector table be on a 1 kB memory alignment).
//! Normally, the SRAM vector table is so placed via the use of linker scripts;
//! some tool chains, such as the evaluation version of RV-MDK, do not support
//! linker scripts and therefore will not produce a valid executable.  See the
//! discussion of compile-time versus run-time interrupt handler registration
//! in the introduction to this chapter.
//!
//! \return None.
//
//*****************************************************************************
void
IntRegister(unsigned long ulInterrupt, void (*pfnHandler)(void))
{
    unsigned long ulIdx, ulValue;

    //
    // Check the arguments.
    //
    ASSERT(ulInterrupt < NUM_INTERRUPTS);

    //
    // Make sure that the RAM vector table is correctly aligned.
    //
    ASSERT(((unsigned long)g_pfnRAMVectors & 0x000003ff) == 0);

    //
    // See if the RAM vector table has been initialized.
    //
    if(HWREG(NVIC_VTABLE) != (unsigned long)g_pfnRAMVectors)
    {
        //
        // Copy the vector table from the beginning of FLASH to the RAM vector
        // table.
        //
        ulValue = HWREG(NVIC_VTABLE);
        for(ulIdx = 0; ulIdx < NUM_INTERRUPTS; ulIdx++)
        {
            g_pfnRAMVectors[ulIdx] = (void (*)(void))HWREG((ulIdx * 4) +
                                                     ulValue);
        }

        //
        // Point NVIC at the RAM vector table.
        //
        HWREG(NVIC_VTABLE) = (unsigned long)g_pfnRAMVectors;
    }

    //
    // Save the interrupt handler.
    //
    g_pfnRAMVectors[ulInterrupt] = pfnHandler;
}

//*****************************************************************************
//
//! Unregisters the function to be called when an interrupt occurs.
//!
//! \param ulInterrupt specifies the interrupt in question.
//!
//! This function is used to indicate that no handler should be called when the
//! given interrupt is asserted to the processor.  The interrupt source will be
//! automatically disabled (via IntDisable()) if necessary.
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
IntUnregister(unsigned long ulInterrupt)
{
    //
    // Check the arguments.
    //
    ASSERT(ulInterrupt < NUM_INTERRUPTS);

    //
    // Reset the interrupt handler.
    //
    g_pfnRAMVectors[ulInterrupt] = IntDefaultHandler;
}

//*****************************************************************************
//
//! Sets the priority grouping of the interrupt controller.
//!
//! \param ulBits specifies the number of bits of preemptable priority.
//!
//! This function specifies the split between preemptable priority levels and
//! subpriority levels in the interrupt priority specification.  The range of
//! the grouping values are dependent upon the hardware implementation; on
//! the Stellaris family, three bits are available for hardware interrupt
//! prioritization and therefore priority grouping values of three through
//! seven have the same effect.
//!
//! \return None.
//
//*****************************************************************************
void
IntPriorityGroupingSet(unsigned long ulBits)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBits < NUM_PRIORITY);

    //
    // Set the priority grouping.
    //
    HWREG(NVIC_APINT) = NVIC_APINT_VECTKEY | g_pulPriority[ulBits];
}

//*****************************************************************************
//
//! Gets the priority grouping of the interrupt controller.
//!
//! This function returns the split between preemptable priority levels and
//! subpriority levels in the interrupt priority specification.
//!
//! \return The number of bits of preemptable priority.
//
//*****************************************************************************
unsigned long
IntPriorityGroupingGet(void)
{
    unsigned long ulLoop, ulValue;

    //
    // Read the priority grouping.
    //
    ulValue = HWREG(NVIC_APINT) & NVIC_APINT_PRIGROUP_M;

    //
    // Loop through the priority grouping values.
    //
    for(ulLoop = 0; ulLoop < NUM_PRIORITY; ulLoop++)
    {
        //
        // Stop looping if this value matches.
        //
        if(ulValue == g_pulPriority[ulLoop])
        {
            break;
        }
    }

    //
    // Return the number of priority bits.
    //
    return(ulLoop);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜视频福利| 成人av影院在线| 日韩在线卡一卡二| 午夜精品一区二区三区免费视频| 亚洲伦理在线免费看| 亚洲精品成人a在线观看| 亚洲精品欧美综合四区| 亚洲激情图片一区| 亚洲第一久久影院| 免费看日韩a级影片| 蜜臀va亚洲va欧美va天堂| 麻豆一区二区三区| 国产美女精品人人做人人爽| 国产成人午夜精品影院观看视频 | 亚洲福利一二三区| 婷婷综合五月天| 极品少妇一区二区三区精品视频| 久久成人18免费观看| 国产精品888| 99久久夜色精品国产网站| 色婷婷精品大视频在线蜜桃视频| 精品1区2区3区| 精品毛片乱码1区2区3区| 国产亚洲1区2区3区| 亚洲人妖av一区二区| 亚洲成av人片观看| 国产精品中文字幕欧美| 91亚洲大成网污www| 欧美久久久久中文字幕| www国产成人免费观看视频 深夜成人网| 欧美高清一级片在线观看| 亚洲色图.com| 久草精品在线观看| 97久久精品人人爽人人爽蜜臀| 欧美视频一区在线观看| 欧美精品一区二区三区视频| 亚洲欧美视频在线观看| 丝袜国产日韩另类美女| 成人app在线| 欧美日韩电影在线播放| 欧美极品美女视频| 视频一区二区三区中文字幕| 高清beeg欧美| 日韩一区国产二区欧美三区| 亚洲视频一区在线| 国内成+人亚洲+欧美+综合在线| 91成人在线精品| 国产亚洲精品超碰| 麻豆国产精品777777在线| 色欧美片视频在线观看在线视频| 久久伊人蜜桃av一区二区| 亚洲v中文字幕| 日本乱人伦一区| 国产精品久久久久久久久免费相片| 蜜臀精品一区二区三区在线观看 | 久久国内精品视频| 欧美三电影在线| 亚洲欧洲一区二区在线播放| 国产自产2019最新不卡| 欧美理论在线播放| 亚洲乱码国产乱码精品精可以看| 成人爽a毛片一区二区免费| 欧美一区2区视频在线观看| 午夜亚洲福利老司机| 91亚洲永久精品| 亚洲视频精选在线| av电影在线观看一区| 欧美国产乱子伦| 国产精品 日产精品 欧美精品| 日韩一级片在线播放| 天天操天天色综合| 69p69国产精品| 五月婷婷综合网| 欧美一区二区三级| 日韩中文字幕一区二区三区| 在线成人av影院| 蜜臀久久久久久久| 2024国产精品| 国产91丝袜在线18| 欧美国产激情二区三区 | 夜夜操天天操亚洲| 色婷婷av一区二区三区gif | 免费观看一级特黄欧美大片| 欧美一区二区女人| 国内成人免费视频| 国产精品女上位| 91在线视频观看| 亚洲一区二区综合| 日韩精品最新网址| 韩国成人福利片在线播放| 国产人成亚洲第一网站在线播放 | 国产亚洲精品7777| hitomi一区二区三区精品| 国产精品久久久久久亚洲毛片 | 亚洲自拍偷拍综合| 欧美精品久久天天躁| 美女视频黄免费的久久| 国产日韩精品一区二区三区 | 亚洲视频一区二区在线| 欧美性三三影院| 激情偷乱视频一区二区三区| 中文字幕精品一区二区三区精品 | 久草在线在线精品观看| 欧美国产精品久久| 欧美日韩国产在线播放网站| 九一久久久久久| 一区二区三区中文字幕在线观看| 欧美日韩黄色影视| 成人黄色一级视频| 日日骚欧美日韩| 中文字幕高清一区| 91精品国产入口在线| 懂色av噜噜一区二区三区av| 五月激情六月综合| 亚洲欧洲日韩女同| 欧美一级高清片在线观看| 不卡视频在线观看| 男男gaygay亚洲| 亚洲一区精品在线| 国产精品久久久久久户外露出 | 久久精品国产久精国产爱| 亚洲欧洲一区二区三区| 日韩欧美在线一区二区三区| 99久久99久久久精品齐齐| 精品一区二区三区在线播放视频| 亚洲免费在线视频一区 二区| 久久这里只有精品视频网| 欧美精品粉嫩高潮一区二区| 不卡视频一二三| 国产精品中文字幕日韩精品| 美女网站色91| 日韩福利视频导航| 亚洲综合在线电影| 国产精品久久午夜夜伦鲁鲁| 精品成人佐山爱一区二区| 欧美二区三区的天堂| 色欧美88888久久久久久影院| 国产999精品久久| 韩国毛片一区二区三区| 美日韩黄色大片| 日本最新不卡在线| 午夜国产精品一区| 亚洲第一成人在线| 亚洲一区二区3| 亚洲三级在线观看| 亚洲男人的天堂一区二区 | 亚洲成av人影院| 亚洲一级电影视频| 一区二区三区电影在线播| 国产精品久久久久久亚洲伦| 亚洲国产高清不卡| 国产精品毛片久久久久久| 久久精品亚洲精品国产欧美 | 午夜精品在线视频一区| 夜夜嗨av一区二区三区中文字幕| 日韩美女视频19| 亚洲同性gay激情无套| 中文字幕视频一区二区三区久| 欧美国产视频在线| 亚洲女同一区二区| 亚洲午夜精品久久久久久久久| 亚洲bt欧美bt精品777| 日韩在线观看一区二区| 久久9热精品视频| 懂色av一区二区在线播放| 成人黄色777网| 日本韩国欧美一区二区三区| 欧美性生活久久| 欧美一区二区播放| 久久精品亚洲精品国产欧美| 中文字幕一区免费在线观看| 中文字幕一区二区三区乱码在线 | 欧美激情一区不卡| 亚洲人成网站精品片在线观看| 一区二区三区鲁丝不卡| 日韩 欧美一区二区三区| 国产福利91精品一区二区三区| 粉嫩在线一区二区三区视频| 91一区一区三区| 欧美一区二区三区日韩| 国产午夜精品一区二区三区视频| 亚洲嫩草精品久久| 免费成人小视频| 91免费小视频| 日韩欧美亚洲另类制服综合在线| 中文字幕免费在线观看视频一区| 怡红院av一区二区三区| 日韩av不卡在线观看| 99国产精品国产精品久久| 欧美日韩国产三级| 国产欧美一区二区精品忘忧草| 亚洲第一狼人社区| 成人免费看黄yyy456| 在线不卡中文字幕播放| 中文字幕不卡在线观看| 秋霞成人午夜伦在线观看| 91视视频在线观看入口直接观看www | 亚洲成a人片在线不卡一二三区| 国产精品一区免费在线观看| 欧美日韩视频一区二区|