亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
一区二区三区波多野结衣在线观看| 欧美日韩欧美一区二区| 99精品国产99久久久久久白柏| 色一区在线观看| 91精品黄色片免费大全| 久久久久国产成人精品亚洲午夜| 国产精品视频yy9299一区| 亚洲最新视频在线观看| 精品一区二区三区免费视频| 懂色av一区二区三区免费观看| 欧美在线色视频| 欧美v国产在线一区二区三区| 日本一区二区三区电影| 一区二区三区国产精品| 国产一区二区在线免费观看| 91欧美一区二区| 欧美一级电影网站| 亚洲欧美日韩在线播放| 久久99国产精品麻豆| 一本色道久久加勒比精品 | 日韩av中文在线观看| 国产乱色国产精品免费视频| 在线观看日韩精品| 久久伊人蜜桃av一区二区| 亚洲国产一区二区三区| 国产成都精品91一区二区三| 欧美精品精品一区| 亚洲欧洲日韩女同| 九一九一国产精品| 欧美在线制服丝袜| 中文字幕中文在线不卡住| 久久精品国产亚洲aⅴ| 色狠狠一区二区| 国产亚洲视频系列| 日韩成人精品视频| 91视视频在线观看入口直接观看www| 日韩欧美久久久| 亚洲电影一区二区| 91视频在线看| 国产精品美日韩| 韩国成人精品a∨在线观看| 在线观看网站黄不卡| 一色桃子久久精品亚洲| 国产精品综合一区二区三区| 91精品中文字幕一区二区三区| 综合久久一区二区三区| 国产激情视频一区二区三区欧美 | 亚洲人成精品久久久久久| 国产一区二三区好的| 91 com成人网| 亚洲一区av在线| 99久久精品国产观看| 久久久久久日产精品| 秋霞午夜av一区二区三区| 欧美性一区二区| 亚洲激情欧美激情| 粉嫩aⅴ一区二区三区四区| 26uuu精品一区二区| 男人的天堂久久精品| 欧美三级三级三级| 亚洲综合视频在线观看| 色婷婷激情综合| 综合激情成人伊人| fc2成人免费人成在线观看播放| 国产亚洲一区二区三区在线观看| 久88久久88久久久| 精品成人在线观看| 精品一区二区三区av| 欧美电影免费观看高清完整版 | 91亚洲精品久久久蜜桃| 国产精品免费视频一区| 成人听书哪个软件好| 中文一区在线播放| 成人在线视频一区二区| 国产精品污污网站在线观看| 国产宾馆实践打屁股91| 国产日韩欧美在线一区| 成人听书哪个软件好| 中文字幕一区二区三区在线不卡| 国产成人av自拍| 久久久久久久久一| 国产成人高清视频| 中文字幕一区在线观看| 91亚洲国产成人精品一区二区三 | 色综合色综合色综合 | 91黄色免费版| 一区二区三区在线免费观看| 色域天天综合网| 亚洲一区二区三区中文字幕 | 亚洲乱码日产精品bd| 91免费视频网址| 亚洲国产日韩av| 9191成人精品久久| 久草热8精品视频在线观看| 久久久国产午夜精品| av一区二区不卡| 亚洲综合成人在线| 91精品视频网| 国产在线视视频有精品| 国产情人综合久久777777| 波多野结衣一区二区三区 | 欧美丝袜丝交足nylons图片| 日本最新不卡在线| 久久一区二区视频| 99re热视频精品| 午夜精品免费在线| 精品国产乱码久久久久久夜甘婷婷 | 国产精品白丝jk黑袜喷水| 中文字幕一区二区三区av| 在线免费观看成人短视频| 亚洲成人手机在线| 久久亚洲精品国产精品紫薇| 成人app在线观看| 亚洲高清中文字幕| 久久久久久久综合| 欧美最猛性xxxxx直播| 蜜臀av一区二区在线免费观看| 久久精品视频网| 欧美最新大片在线看| 精品在线亚洲视频| 国产精品三级av| 欧美日本在线视频| 国产a视频精品免费观看| 亚洲一二三四区不卡| 337p日本欧洲亚洲大胆精品| 97超碰欧美中文字幕| 奇米色777欧美一区二区| 日韩一区日韩二区| 日韩精品一区二区三区视频播放 | 在线视频欧美精品| 韩国女主播成人在线| 亚洲一区日韩精品中文字幕| 欧美成人官网二区| 91麻豆国产福利在线观看| 免费一级片91| 亚洲欧美乱综合| 久久影院视频免费| 欧美日韩日本视频| 成人app在线观看| 九九精品一区二区| 亚洲综合激情另类小说区| 国产日韩精品一区二区浪潮av| 欧美三级一区二区| 成人aaaa免费全部观看| 麻豆精品视频在线观看免费| 成人欧美一区二区三区小说| 精品国产成人系列| 欧美性videosxxxxx| 成人午夜在线视频| 久久99精品久久只有精品| 亚洲国产wwwccc36天堂| 自拍偷拍欧美精品| 中文字幕免费不卡| 欧美tk—视频vk| 欧美日韩亚洲高清一区二区| 色综合欧美在线视频区| 岛国av在线一区| 国产一区在线观看麻豆| 日韩电影免费在线| 午夜国产不卡在线观看视频| 专区另类欧美日韩| 中文字幕在线不卡一区| 久久精品一区二区三区四区| 精品免费视频一区二区| 制服丝袜中文字幕一区| 欧美日韩亚洲综合| 欧美系列一区二区| 色综合久久中文字幕| www.亚洲精品| 成人综合婷婷国产精品久久 | 久久久99久久| 2020国产精品| 久久亚洲二区三区| 欧美变态凌虐bdsm| 日韩一区二区在线观看视频 | 丝袜a∨在线一区二区三区不卡| 亚洲乱码国产乱码精品精98午夜| 国产精品区一区二区三| 欧美精彩视频一区二区三区| 26uuuu精品一区二区| 欧美精品一区二区三区视频| 欧美mv日韩mv国产网站| 2023国产精品| 久久久噜噜噜久久人人看 | 成人一二三区视频| 国产成人精品1024| 成人aaaa免费全部观看| 成人小视频在线| aaa国产一区| 91色九色蝌蚪| 欧美综合天天夜夜久久| 欧美日本在线一区| 欧美一级免费大片| 精品久久五月天| 久久夜色精品一区| 中文字幕乱码久久午夜不卡| 国产精品乱人伦中文| 一区二区三区在线免费播放| 亚洲电影中文字幕在线观看| 免费在线视频一区|