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

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

?? flash.c

?? KEIL驅動 各方面各 你的看法女士的煩惱 方看到你
?? C
?? 第 1 頁 / 共 2 頁
字號:

        //
        // 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);
        }
    }

    //
    // For Stellaris Sandstorm-class devices, revision C1 and C2, the upper
    // bits of the FMPPE register are used for JTAG options, and are not
    // available for the FLASH protection scheme.  When setting block
    // protection, ensure that these bits are not altered.
    //
    if(CLASS_IS_SANDSTORM && (REVISION_IS_C1 || REVISION_IS_C2))
    {
        ulProtectRE &= ~(FLASH_FMP_BLOCK_31 | FLASH_FMP_BLOCK_30);
        ulProtectRE |= (HWREG(g_pulFMPRERegs[ulBank]) &
                (FLASH_FMP_BLOCK_31 | FLASH_FMP_BLOCK_30));
    }

    //
    // Set the new protection for the specified flash bank.
    //
    HWREG(g_pulFMPRERegs[ulBank]) = ulProtectRE;
    HWREG(g_pulFMPPERegs[ulBank]) = 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)
{
    int ulTemp, ulLimit;

    //
    // If running on a Sandstorm-class device, only trigger a save of the first
    // two protection registers (FMPRE and FMPPE).  Otherwise, save the
    // entire bank of flash protection registers.
    //
    ulLimit = CLASS_IS_SANDSTORM ? 2 : 8;
    for(ulTemp = 0; ulTemp < ulLimit; ulTemp++)
    {
        //
        // Tell the flash controller to write the flash protection register.
        //
        HWREG(FLASH_FMA) = ulTemp;
        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);
}

//*****************************************************************************
//
//! Gets the user registers.
//!
//! \param pulUser0 is a pointer to the location to store USER Register 0.
//! \param pulUser1 is a pointer to the location to store USER Register 1.
//!
//! This function will read the contents of user registers (0 and 1), and
//! store them in the specified locations.
//!
//! \return Returns 0 on success, or -1 if a hardware error is encountered.
//
//*****************************************************************************
long
FlashUserGet(unsigned long *pulUser0, unsigned long *pulUser1)
{
    //
    // Verify that the pointers are valid.
    //
    ASSERT(pulUser0 != 0);
    ASSERT(pulUser1 != 0);

    //
    // Verify that hardware supports user registers.
    //
    if(CLASS_IS_SANDSTORM)
    {
        return(-1);
    }

    //
    // Get and store the current value of the user registers.
    //
    *pulUser0 = HWREG(FLASH_USERREG0);
    *pulUser1 = HWREG(FLASH_USERREG1);

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

//*****************************************************************************
//
//! Sets the user registers.
//!
//! \param ulUser0 is the value to store in USER Register 0.
//! \param ulUser1 is the value to store in USER Register 1.
//!
//! This function will set the contents of the user registers (0 and 1) to
//! the specified values.
//!
//! \return Returns 0 on success, or -1 if a hardware error is encountered.
//
//*****************************************************************************
long
FlashUserSet(unsigned long ulUser0, unsigned long ulUser1)
{
    //
    // Verify that hardware supports user registers.
    //
    if(CLASS_IS_SANDSTORM)
    {
        return(-1);
    }

    //
    // Save the new values into the user registers.
    //
    HWREG(FLASH_USERREG0) = ulUser0;
    HWREG(FLASH_USERREG1) = ulUser1;

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

//*****************************************************************************
//
//! Saves the user registers.
//!
//! This function will make the currently programmed user register settings
//! permanent.  This is a non-reversible operation; a chip reset or power cycle
//! will not change this setting.
//!
//! 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
FlashUserSave(void)
{
    //
    // Verify that hardware supports user registers.
    //
    if(CLASS_IS_SANDSTORM)
    {
        return(-1);
    }

    //
    // Setting the MSB of FMA will trigger a permanent save of a USER
    // register.  Bit 0 will indicate User 0 (0) or User 1 (1).
    //
    HWREG(FLASH_FMA) = 0x80000000;
    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 USER1 Register.
    //
    HWREG(FLASH_FMA) = 0x80000001;
    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_AMISC.
//
//*****************************************************************************
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_AMISC 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.
//!
//! \note Since there is a write buffer in the Cortex-M3 processor, it may take
//! several clock cycles before the interrupt source is actually cleared.
//! Therefore, it is recommended that the interrupt source be cleared early in
//! the interrupt handler (as opposed to the very last action) to avoid
//! returning from the interrupt handler before the interrupt source is
//! actually cleared.  Failure to do so may result in the interrupt handler
//! being immediately reentered (since NVIC still sees the interrupt source
//! asserted).
//!
//! \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精品久久| 日韩欧美一二三区| 国产精品免费视频网站| 亚洲精品国产品国语在线app| 天堂午夜影视日韩欧美一区二区| 日本色综合中文字幕| 国产激情视频一区二区在线观看 | 精品91自产拍在线观看一区| 欧美日本一区二区三区四区| 久久久久久麻豆| 午夜精品福利在线| 日本视频一区二区三区| 色综合久久六月婷婷中文字幕| 91精品一区二区三区在线观看| 中文字幕在线不卡国产视频| 日本不卡一区二区| 91免费在线看| 精品国产在天天线2019| 亚洲午夜日本在线观看| 成人黄色小视频| 日韩欧美一级二级| 日日夜夜免费精品| 91视视频在线观看入口直接观看www | 亚洲婷婷在线视频| 国产一区在线不卡| 欧美精品色综合| 综合色中文字幕| 日本欧洲一区二区| 欧洲视频一区二区| 亚洲精品一线二线三线无人区| 亚洲综合男人的天堂| 风间由美一区二区三区在线观看| 欧美一区二区三区视频免费| 亚洲欧洲色图综合| 丁香五精品蜜臀久久久久99网站| 欧美大肚乱孕交hd孕妇| 亚洲成年人影院| 欧美精品1区2区| 久久精品噜噜噜成人88aⅴ| wwwwww.欧美系列| 国产成人免费视频网站| 日韩一区中文字幕| 欧美性做爰猛烈叫床潮| 一个色在线综合| 欧美一区二区视频在线观看2022| 美国十次综合导航| 久久精品人人做| 一本一道综合狠狠老| 亚洲国产日韩一级| 精品理论电影在线观看| 高清不卡在线观看av| 亚洲欧洲99久久| 欧美午夜精品一区二区蜜桃| 蜜芽一区二区三区| 国产亚洲欧美一级| 在线欧美日韩国产| 激情图区综合网| 一区二区在线免费| 日韩欧美中文字幕精品| 99精品视频在线播放观看| 亚洲国产美女搞黄色| 精品国产精品一区二区夜夜嗨| 成人18视频在线播放| 日韩激情在线观看| 欧美激情一区二区三区全黄| 欧美亚洲国产一卡| 国产乱色国产精品免费视频| 亚洲色欲色欲www| 日韩免费成人网| 一本大道久久精品懂色aⅴ| 日日夜夜精品视频免费| 国产精品久久久久影院色老大| 欧美日韩中字一区| 国产91精品一区二区| 肉色丝袜一区二区| 亚洲色图视频免费播放| 欧美xingq一区二区| 91国在线观看| 成人免费毛片aaaaa**| 蜜臀av一级做a爰片久久| 亚洲色欲色欲www| 国产无遮挡一区二区三区毛片日本| 欧美在线观看视频在线| 岛国av在线一区| 美女网站色91| 性做久久久久久免费观看 | 5858s免费视频成人| 成人免费毛片高清视频| 久久精品99久久久| 日日夜夜精品视频免费| 亚洲综合免费观看高清完整版在线| 久久久另类综合| 欧美一级片免费看| 欧美日韩国产高清一区二区 | 久久99久久99| 肉丝袜脚交视频一区二区| 亚洲精品欧美二区三区中文字幕| 国产女同互慰高潮91漫画| 日韩精品一区二区三区在线观看| 欧美主播一区二区三区美女| 91女人视频在线观看| 成人午夜视频在线| 丁香亚洲综合激情啪啪综合| 国产高清精品久久久久| 狠狠色丁香九九婷婷综合五月| 日韩国产在线观看一区| 亚洲午夜电影在线| 亚洲一区二区三区影院| 一区二区三区**美女毛片| 一区二区视频在线| 亚洲人被黑人高潮完整版| 亚洲日本乱码在线观看| 亚洲免费观看在线观看| 亚洲男人的天堂av| 亚洲激情综合网| 亚洲午夜久久久| 亚洲大片免费看| 无吗不卡中文字幕| 日本系列欧美系列| 精品中文字幕一区二区| 精品亚洲免费视频| 国产精品538一区二区在线| 国产精品18久久久久久久久 | 色综合视频一区二区三区高清| 成人黄色在线看| 色乱码一区二区三区88| 欧美午夜电影在线播放| 91麻豆精品91久久久久同性| 日韩丝袜美女视频| www成人在线观看| 自拍偷拍欧美精品| 亚洲国产精品一区二区久久| 日本女人一区二区三区| 国内精品自线一区二区三区视频| 国产精品一区一区三区| 99久久国产综合精品色伊| 欧美私人免费视频| 精品国产a毛片| 中文字幕亚洲电影| 热久久国产精品| 国产91对白在线观看九色| 色菇凉天天综合网| 欧美一区二区三区免费视频| 国产婷婷色一区二区三区在线| 中文字幕在线观看一区| 天天色综合天天| 成人免费视频国产在线观看| 在线观看精品一区| 精品久久人人做人人爱| 亚洲人成网站影音先锋播放| 日本伊人午夜精品| 成人av午夜电影| 日韩视频永久免费| 亚洲黄色免费网站| 久久成人免费日本黄色| 91麻豆文化传媒在线观看| 精品99一区二区| 亚洲午夜av在线| www.亚洲在线| 精品国产一区二区三区不卡| 亚洲一区二区三区激情| 国产超碰在线一区| 欧美一区二区三区电影| 亚洲视频一二三| 国产传媒一区在线| 欧美一区二区啪啪| 亚洲精品日韩一| 成人的网站免费观看| 日韩三级免费观看| 午夜激情综合网| 一本久久综合亚洲鲁鲁五月天 | 精品一区二区在线看| 在线观看亚洲成人| 国产欧美va欧美不卡在线| 捆绑紧缚一区二区三区视频| 欧美视频自拍偷拍| 亚洲乱码国产乱码精品精98午夜| 国产成人亚洲综合a∨婷婷| 91精品啪在线观看国产60岁| 亚洲宅男天堂在线观看无病毒| 成人综合在线网站| 久久久久久久久岛国免费| 日日欢夜夜爽一区| 欧美日韩成人在线| 一区二区不卡在线视频 午夜欧美不卡在| 国产69精品久久777的优势| 2024国产精品视频| 精品制服美女丁香| 日韩精品中文字幕在线一区| 亚洲v精品v日韩v欧美v专区| 欧美图片一区二区三区| 有坂深雪av一区二区精品| 99精品国产热久久91蜜凸| 国产精品女同一区二区三区| 国产suv一区二区三区88区| 久久久亚洲精品一区二区三区| 国模大尺度一区二区三区| 精品久久国产老人久久综合| 久久99国产乱子伦精品免费|