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

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

?? flash.c

?? 基于 Luminary Micro 公司的 Cortex-M3 (ARM)內核使用之 uC/OS-II 作業系統,此例程是移植于 LM3S310 上的應用,于 Keil MDK 工程編譯,而 uC/O
?? C
?? 第 1 頁 / 共 2 頁
字號:
    // Check the argument.
    //
    ASSERT(!(ulAddress & (FLASH_PROTECT_SIZE - 1)));
    ASSERT((eProtect == FlashReadWrite) || (eProtect == FlashReadOnly) ||
           (eProtect == FlashExecuteOnly));

    //
    // Convert the address into a block number.
    //
    ulAddress /= FLASH_PROTECT_SIZE;

    //
    // Get the current protection.
    //
    ulProtectRE = HWREG(FLASH_FMPRE);
    ulProtectPE = HWREG(FLASH_FMPPE);

    //
    // Set the protection based on the requested proection.
    //
    switch(eProtect)
    {
        //
        // Make this block execute only.
        //
        case FlashExecuteOnly:
        {
            //
            // Turn off the read and program bits for this block.
            //
            ulProtectRE &= ~(FLASH_FMP_BLOCK_0 << ulAddress);
            ulProtectPE &= ~(FLASH_FMP_BLOCK_0 << ulAddress);

            //
            // We're done handling this protection.
            //
            break;
        }

        //
        // Make this block read only.
        //
        case FlashReadOnly:
        {
            //
            // The block can not be made read only if it is execute only.
            //
            if(((ulProtectRE >> ulAddress) & FLASH_FMP_BLOCK_0) !=
               FLASH_FMP_BLOCK_0)
            {
                return(-1);
            }

            //
            // Make this block read only.
            //
            ulProtectPE &= ~(FLASH_FMP_BLOCK_0 << ulAddress);

            //
            // We're done handling this protection.
            //
            break;
        }

        //
        // Make this block read/write.
        //
        case FlashReadWrite:
        default:
        {
            //
            // The block can not be made read/write if it is not already
            // read/write.
            //
            if((((ulProtectRE >> ulAddress) & FLASH_FMP_BLOCK_0) !=
                FLASH_FMP_BLOCK_0) ||
               (((ulProtectPE >> ulAddress) & FLASH_FMP_BLOCK_0) !=
                FLASH_FMP_BLOCK_0))
            {
                return(-1);
            }

            //
            // The block is already read/write, so there is nothing to do.
            //
            return(0);
        }
    }

    //
    // Set the new protection.
    //
    HWREG(FLASH_FMPRE) = ulProtectRE;
    HWREG(FLASH_FMPPE) = ulProtectPE;

    //
    // Success.
    //
    return(0);
}

//*****************************************************************************
//
//! Saves the flash protection settings.
//!
//! This function will make the currently programmed flash protection settings
//! permanent.  This is a non-reversible operation; a chip reset or power cycle
//! will not change the flash protection.
//!
//! This function will not return until the protection has been saved.
//!
//! \return Returns 0 on success, or -1 if a hardware error is encountered.
//
//*****************************************************************************
long
FlashProtectSave(void)
{
    //
    // Tell the flash controller to write the flash read protection register.
    //
    HWREG(FLASH_FMA) = 0;
    HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;

    //
    // Wait until the write has completed.
    //
    while(HWREG(FLASH_FMC) & FLASH_FMC_COMT)
    {
    }

    //
    // Tell the flash controller to write the flash program protection
    // register.
    //
    HWREG(FLASH_FMA) = 1;
    HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;

    //
    // Wait until the write has completed.
    //
    while(HWREG(FLASH_FMC) & FLASH_FMC_COMT)
    {
    }

    //
    // Success.
    //
    return(0);
}

//*****************************************************************************
//
//! Registers an interrupt.handler for the flash interrupt.
//!
//! \param pfnHandler is a pointer to the function to be called when the flash
//! interrupt occurs.
//!
//! This sets the handler to be called when the flash interrupt occurs.  The
//! flash controller can generate an interrupt when an invalid flash access
//! occurs, such as trying to program or erase a read-only block, or trying to
//! read from an execute-only block.  It can also generate an interrupt when a
//! program or erase operation has completed.  The interrupt will be
//! automatically enabled when the handler is registered.
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
FlashIntRegister(void (*pfnHandler)(void))
{
    //
    // Register the interrupt.handler, returning an error if an error occurs.
    //
    IntRegister(INT_FLASH, pfnHandler);

    //
    // Enable the flash interrupt.
    //
    IntEnable(INT_FLASH);
}

//*****************************************************************************
//
//! Unregisters the interrupt.handler for the flash interrupt.
//!
//! This function will clear the handler to be called when the flash interrupt
//! occurs.  This will also mask off the interrupt in the interrupt controller
//! so that the interrupt.handler is no longer called.
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
FlashIntUnregister(void)
{
    //
    // Disable the interrupt.
    //
    IntDisable(INT_FLASH);

    //
    // Unregister the interrupt.handler.
    //
    IntUnregister(INT_FLASH);
}

//*****************************************************************************
//
//! Enables individual flash controller interrupt sources.
//!
//! \param ulIntFlags is a bit mask of the interrupt sources to be enabled.
//! Can be any of the \b FLASH_FCIM_PROGRAM or \b FLASH_FCIM_ACCESS values.
//!
//! Enables the indicated flash controller interrupt sources.  Only the sources
//! that are enabled can be reflected to the processor interrupt; disabled
//! sources have no effect on the processor.
//!
//! \return None.
//
//*****************************************************************************
void
FlashIntEnable(unsigned long ulIntFlags)
{
    //
    // Enable the specified interrupts.
    //
    HWREG(FLASH_FCIM) |= ulIntFlags;
}

//*****************************************************************************
//
//! Disables individual flash controller interrupt sources.
//!
//! \param ulIntFlags is a bit mask of the interrupt sources to be disabled.
//! Can be any of the \b FLASH_FCIM_PROGRAM or \b FLASH_FCIM_ACCESS values.
//!
//! Disables the indicated flash controller interrupt sources.  Only the
//! sources that are enabled can be reflected to the processor interrupt;
//! disabled sources have no effect on the processor.
//!
//! \return None.
//
//*****************************************************************************
void
FlashIntDisable(unsigned long ulIntFlags)
{
    //
    // Disable the specified interrupts.
    //
    HWREG(FLASH_FCIM) &= ~(ulIntFlags);
}

//*****************************************************************************
//
//! Gets the current interrupt status.
//!
//! \param bMasked is false if the raw interrupt status is required and true if
//! the masked interrupt status is required.
//!
//! This returns the interrupt status for the flash controller.  Either the raw
//! interrupt status or the status of interrupts that are allowed to reflect to
//! the processor can be returned.
//!
//! \return The current interrupt status, enumerated as a bit field of
//! \b FLASH_FCMISC_PROGRAM and \b FLASH_FCMISC_ACCESS.
//
//*****************************************************************************
unsigned long
FlashIntGetStatus(tBoolean bMasked)
{
    //
    // Return either the interrupt status or the raw interrupt status as
    // requested.
    //
    if(bMasked)
    {
        return(HWREG(FLASH_FCMISC));
    }
    else
    {
        return(HWREG(FLASH_FCRIS));
    }
}

//*****************************************************************************
//
//! Clears flash controller interrupt sources.
//!
//! \param ulIntFlags is the bit mask of the interrupt sources to be cleared.
//! Can be any of the \b FLASH_FCMISC_PROGRAM or \b FLASH_FCMISC_ACCESS
//! values.
//!
//! The specified flash controller interrupt sources are cleared, so that they
//! no longer assert.  This must be done in the interrupt.handler to keep it
//! from being called again immediately upon exit.
//!
//! \return None.
//
//*****************************************************************************
void
FlashIntClear(unsigned long ulIntFlags)
{
    //
    // Clear the flash interrupt.
    //
    HWREG(FLASH_FCMISC) = ulIntFlags;
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
eeuss鲁片一区二区三区| 亚洲综合视频在线| 亚洲欧洲制服丝袜| 国精产品一区一区三区mba视频| 欧美日韩亚州综合| 亚洲色图.com| 99精品久久只有精品| 国产精品另类一区| 青青国产91久久久久久| 欧美日韩成人综合| 午夜精品免费在线| 7777精品伊人久久久大香线蕉 | 亚洲人成伊人成综合网小说| 大美女一区二区三区| 欧美一级一级性生活免费录像| 亚洲r级在线视频| 欧美喷水一区二区| 午夜精品久久久久久久99樱桃| 欧美日韩高清在线播放| 日韩经典中文字幕一区| 欧美一区二区在线免费观看| 另类调教123区| 久久久一区二区| 粉嫩aⅴ一区二区三区四区五区| 中文字幕国产一区| 91猫先生在线| 天天色天天操综合| 精品理论电影在线| 成人精品电影在线观看| 亚洲综合久久久| 日本电影欧美片| 午夜精品123| 精品sm在线观看| 不卡区在线中文字幕| 一区二区三区欧美亚洲| 91精品麻豆日日躁夜夜躁| 国产在线乱码一区二区三区| 国产精品你懂的| 欧洲精品视频在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅 | 亚洲免费av观看| 欧美体内she精视频| 精品一区二区三区久久久| 国产日产欧美一区| 欧美三级韩国三级日本一级| 亚洲精品成人少妇| 久久久久国产精品麻豆ai换脸 | 久久国产免费看| 亚洲欧洲日韩综合一区二区| 欧美日韩国产精品成人| 国产精品 日产精品 欧美精品| 亚洲视频一区二区在线| 日韩欧美国产电影| 欧美日韩激情一区二区| 99国产精品久| 成人福利视频在线看| 国产一本一道久久香蕉| 日韩中文字幕亚洲一区二区va在线| 国产精品动漫网站| 久久亚洲精华国产精华液 | 一区二区三区四区精品在线视频| 精品国内二区三区| 91精品国产aⅴ一区二区| 欧美亚男人的天堂| 色综合久久久久久久| 成人毛片在线观看| 成人av电影在线观看| 国产精品99久久久久久久vr| 精品一区二区综合| 精品一区二区三区久久久| 久久9热精品视频| 免费观看久久久4p| 蜜桃视频在线一区| 老司机精品视频一区二区三区| 视频一区二区三区入口| 日韩激情视频网站| 免费一区二区视频| 久久精品国产99| 狠狠色丁香久久婷婷综合丁香| 美女视频黄 久久| 九色porny丨国产精品| 精品影院一区二区久久久| 国产一区二区三区四| 国产suv精品一区二区三区| 国产成人综合在线观看| 国产.欧美.日韩| 99re这里都是精品| 欧美少妇性性性| 91精品久久久久久久91蜜桃| 欧美一级黄色录像| 久久亚洲二区三区| 国产精品美女一区二区| 亚洲你懂的在线视频| 亚洲妇女屁股眼交7| 五月天视频一区| 久久精品72免费观看| 国产成人免费av在线| 一本一道久久a久久精品综合蜜臀| 色婷婷综合视频在线观看| 欧美三级一区二区| 精品成人免费观看| 亚洲欧洲国产专区| 五月婷婷综合在线| 国模冰冰炮一区二区| 99精品视频一区| 91精品国产综合久久精品麻豆 | 国产高清不卡一区二区| 91视频免费播放| 91精品国产一区二区三区| 2023国产精品| 亚洲欧美电影院| 麻豆精品久久久| 91视频免费播放| 欧美第一区第二区| 亚洲日本va在线观看| 免费观看在线综合色| 99久久久精品| 日韩视频永久免费| 亚洲人精品午夜| 国产一区视频网站| 欧洲一区在线电影| 久久久久亚洲蜜桃| 亚洲国产你懂的| 粉嫩aⅴ一区二区三区四区| 欧美日韩亚洲综合| 国产精品美女一区二区| 久久综合综合久久综合| 91麻豆自制传媒国产之光| 精品av综合导航| 亚洲va中文字幕| 成人av电影免费观看| 日韩一级欧美一级| 亚洲国产综合91精品麻豆| 风间由美一区二区av101| 欧美日韩在线综合| 中文字幕成人在线观看| 久久精品国产99国产| 欧美日韩午夜精品| 亚洲欧洲国产日韩| 国产高清不卡一区| 欧美不卡视频一区| 五月综合激情日本mⅴ| 色av成人天堂桃色av| 日本一区二区三区四区在线视频 | xfplay精品久久| 爽爽淫人综合网网站| 91成人国产精品| 国产精品国产三级国产普通话三级 | 亚洲精品久久7777| 国产麻豆精品久久一二三| 在线播放一区二区三区| 亚洲精品久久久蜜桃| 9色porny自拍视频一区二区| 国产日韩欧美精品综合| 久久精品国产一区二区| 777午夜精品视频在线播放| 亚洲激情校园春色| 99精品欧美一区二区三区小说 | 亚洲一区二区在线播放相泽| av在线这里只有精品| 日本一区二区三级电影在线观看| 久久99久久99小草精品免视看| 欧美精品丝袜中出| 午夜精品aaa| 91精品蜜臀在线一区尤物| 日韩精品视频网站| 91精品国产麻豆国产自产在线| 日韩精品一二三四| 欧美一级艳片视频免费观看| 奇米色777欧美一区二区| 日韩一级片网站| 国产剧情一区在线| 国产午夜精品一区二区三区嫩草| 国产精品一级二级三级| 久久久精品综合| 丰满少妇在线播放bd日韩电影| 久久青草欧美一区二区三区| 国产精品99久| 中文字幕不卡三区| 99国产精品视频免费观看| 亚洲一区在线视频| 欧美猛男gaygay网站| 麻豆精品一二三| 国产清纯美女被跳蛋高潮一区二区久久w| 久久精品国产99国产精品| 国产网红主播福利一区二区| 国产.欧美.日韩| 一区二区三区91| 日韩一区二区免费高清| 国产乱人伦偷精品视频免下载 | 久久久久亚洲蜜桃| 91在线精品一区二区| 午夜精品福利在线| 久久免费的精品国产v∧| 99久久综合99久久综合网站| 亚洲精品欧美二区三区中文字幕| 欧美伦理视频网站| 国产高清久久久| 亚洲五码中文字幕| 精品人在线二区三区|