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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? flash.c

?? 基于 Luminary Micro 公司的 Cortex-M3 (ARM)內(nèi)核使用之 uC/OS-II 作業(yè)系統(tǒng),此例程是移植于 LM3S310 上的應(yīng)用,于 Keil MDK 工程編譯,而 uC/O
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
//*****************************************************************************
//
// flash.c - Driver for programming the on-chip flash.
//
// 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 852 of the Stellaris Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup flash_api
//! @{
//
//*****************************************************************************

#include "hw_flash.h"
#include "hw_ints.h"
#include "hw_memmap.h"
#include "hw_sysctl.h"
#include "hw_types.h"
#include "debug.h"
#include "flash.h"
#include "interrupt.h"

//*****************************************************************************
//
//! Gets the number of processor clocks per micro-second.
//!
//! This function returns the number of clocks per micro-second, as presently
//! known by the flash controller.
//!
//! \return Returns the number of processor clocks per micro-second.
//
//*****************************************************************************
unsigned long
FlashUsecGet(void)
{
    //
    // Return the number of clocks per micro-second.
    //
    return(HWREG(FLASH_USECRL) + 1);
}

//*****************************************************************************
//
//! Sets the number of processor clocks per micro-second.
//!
//! \param ulClocks is the number of processor clocks per micro-second.
//!
//! This function is used to tell the flash controller the number of processor
//! clocks per micro-second.  This value must be programmed correctly or the
//! flash most likely will not program correctly; it has no affect on reading
//! flash.
//!
//! \return None.
//
//*****************************************************************************
void
FlashUsecSet(unsigned long ulClocks)
{
    //
    // Set the number of clocks per micro-second.
    //
    HWREG(FLASH_USECRL) = ulClocks - 1;
}

//*****************************************************************************
//
//! Erases a block of flash.
//!
//! \param ulAddress is the start address of the flash block to be erased.
//!
//! This function will erase a 1 kB block of the on-chip flash.  After erasing,
//! the block will be filled with 0xFF bytes.  Read-only and execute-only
//! blocks cannot be erased.
//!
//! This function will not return until the block has been erased.
//!
//! \return Returns 0 on success, or -1 if an invalid block address was
//! specified or the block is write-protected.
//
//*****************************************************************************
long
FlashErase(unsigned long ulAddress)
{
    //
    // Check the arguments.
    //
    ASSERT(!(ulAddress & (FLASH_ERASE_SIZE - 1)));

    //
    // Clear the flash access interrupt.
    //
    HWREG(FLASH_FCMISC) = FLASH_FCMISC_ACCESS;

    //
    // Erase the block.
    //
    HWREG(FLASH_FMA) = ulAddress;
    HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_ERASE;

    //
    // Wait until the word has been programmed.
    //
    while(HWREG(FLASH_FMC) & FLASH_FMC_ERASE)
    {
    }

    //
    // Return an error if an access violation occurred.
    //
    if(HWREG(FLASH_FCRIS) & FLASH_FCRIS_ACCESS)
    {
        return(-1);
    }

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

//*****************************************************************************
//
//! Programs flash.
//!
//! \param pulData is a pointer to the data to be programmed.
//! \param ulAddress is the starting address in flash to be programmed.  Must
//! be a multiple of four.
//! \param ulCount is the number of bytes to be programmed.  Must be a multiple
//! of four.
//!
//! This function will program a sequence of words into the on-chip flash.
//! Programming each location consists of the result of an AND operation
//! of the new data and the existing data; in other words bits that contain
//! 1 can remain 1 or be changed to 0, but bits that are 0 cannot be changed
//! to 1.  Therefore, a word can be programmed multiple times as long as these
//! rules are followed; if a program operation attempts to change a 0 bit to
//! a 1 bit, that bit will not have its value changed.
//!
//! Since the flash is programmed one word at a time, the starting address and
//! byte count must both be multiples of four.  It is up to the caller to
//! verify the programmed contents, if such verification is required.
//!
//! This function will not return until the data has been programmed.
//!
//! \return Returns 0 on success, or -1 if a programming error is encountered.
//
//*****************************************************************************
long
FlashProgram(unsigned long *pulData, unsigned long ulAddress,
             unsigned long ulCount)
{
    //
    // Check the arguments.
    //
    ASSERT(!(ulAddress & 3));
    ASSERT(!(ulCount & 3));

    //
    // Clear the flash access interrupt.
    //
    HWREG(FLASH_FCMISC) = FLASH_FCMISC_ACCESS;

    //
    // Loop over the words to be programmed.
    //
    while(ulCount)
    {
        //
        // Program the next word.
        //
        HWREG(FLASH_FMA) = ulAddress;
        HWREG(FLASH_FMD) = *pulData;
        HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_WRITE;

        //
        // Wait until the word has been programmed.
        //
        while(HWREG(FLASH_FMC) & FLASH_FMC_WRITE)
        {
        }

        //
        // Increment to the next word.
        //
        pulData++;
        ulAddress += 4;
        ulCount -= 4;
    }

    //
    // Return an error if an access violation occurred.
    //
    if(HWREG(FLASH_FCRIS) & FLASH_FCRIS_ACCESS)
    {
        return(-1);
    }

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

//*****************************************************************************
//
//! Gets the protection setting for a block of flash.
//!
//! \param ulAddress is the start address of the flash block to be queried.
//!
//! This function will get the current protection for the specified 2 kB block
//! of flash.  Each block can be read/write, read-only, or execute-only.
//! Read/write blocks can be read, executed, erased, and programmed.  Read-only
//! blocks can be read and executed.  Execute-only blocks can only be executed;
//! processor and debugger data reads are not allowed.
//!
//! \return Returns the protection setting for this block.  See
//! FlashProtectSet() for possible values.
//
//*****************************************************************************
tFlashProtection
FlashProtectGet(unsigned long ulAddress)
{
    unsigned long ulFMPRE, ulFMPPE;

    //
    // Check the argument.
    //
    ASSERT(!(ulAddress & (FLASH_PROTECT_SIZE - 1)));

    //
    // Read the flash protection register and get the bits that apply to the
    // specified block.
    //
    ulFMPRE = HWREG(FLASH_FMPRE);
    ulFMPPE = HWREG(FLASH_FMPPE);
    switch((((ulFMPRE >> (ulAddress / FLASH_PROTECT_SIZE)) &
             FLASH_FMP_BLOCK_0) << 1) |
           ((ulFMPPE >> (ulAddress / FLASH_PROTECT_SIZE)) & FLASH_FMP_BLOCK_0))
    {
        //
        // This block is marked as execute only (i.e. it can not be erased or
        // programmed, and the only reads allowed are via the instruction fecth
        // interface).
        //
        case 0:
        case 1:
        {
            return(FlashExecuteOnly);
        }

        //
        // This block is marked as read only (i.e. it can not be erased or
        // programmed).
        //
        case 2:
        {
            return(FlashReadOnly);
        }

        //
        // This block is read/write; it can be read, erased, and programmed.
        //
        case 3:
        default:
        {
            return(FlashReadWrite);
        }
    }
}

//*****************************************************************************
//
//! Sets the protection setting for a block of flash.
//!
//! \param ulAddress is the start address of the flash block to be protected.
//! \param eProtect is the protection to be applied to the block.  Can be one
//! of \b FlashReadWrite, \b FlashReadOnly, or \b FlashExecuteOnly.
//!
//! This function will set the protection for the specified 2 kB block of
//! flash.  Blocks which are read/write can be made read-only or execute-only.
//! Blocks which are read-only can be made execute-only.  Blocks which are
//! execute-only cannot have their protection modified.  Attempts to make the
//! block protection less stringent (i.e. read-only to read/write) will result
//! in a failure (and be prevented by the hardware).
//!
//! Changes to the flash protection are maintained only until the next reset.
//! This allows the application to be executed in the desired flash protection
//! environment to check for inappropriate flash access (via the flash
//! interrupt).  To make the flash protection permanent, use the
//! FlashProtectSave() function.
//!
//! \return Returns 0 on success, or -1 if an invalid address or an invalid
//! protection was specified.
//
//*****************************************************************************
long
FlashProtectSet(unsigned long ulAddress, tFlashProtection eProtect)
{
    unsigned long ulProtectRE, ulProtectPE;

    //

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狂野欧美性猛交blacked| 91视频免费看| 男人操女人的视频在线观看欧美| 国产精品不卡在线| 久久久噜噜噜久久人人看 | 在线视频欧美精品| jlzzjlzz亚洲女人18| 国产成人免费在线观看不卡| 久久国产综合精品| 日韩福利电影在线| 亚洲高清视频中文字幕| 国产欧美日韩视频在线观看| 精品国产伦一区二区三区观看体验 | 日韩成人一级大片| 亚洲自拍偷拍九九九| 综合久久久久综合| 26uuu欧美| 久久在线免费观看| 欧美精品一区二区高清在线观看| 日韩美女视频在线| 欧美一区二区在线播放| 99国产欧美久久久精品| 成人av第一页| 91蜜桃传媒精品久久久一区二区| 岛国精品在线播放| 国产乱子轮精品视频| 国产美女av一区二区三区| 韩国视频一区二区| 久久精品国产亚洲5555| 久久不见久久见免费视频1| 久久国产三级精品| 国产一区在线看| 国产成人午夜99999| 高清beeg欧美| 国产精品18久久久久久久久久久久| 国产一区三区三区| 国产成人综合在线| a4yy欧美一区二区三区| 色婷婷亚洲精品| 欧美日韩dvd在线观看| 日韩一区二区在线看片| 久久久久久久久久看片| 久久久精品人体av艺术| 久久人人爽人人爽| 中文字幕一区二区日韩精品绯色| 亚洲免费伊人电影| 日韩高清在线一区| 精品一二三四区| 成人免费视频视频在线观看免费| 91亚洲午夜精品久久久久久| 欧美日韩在线观看一区二区| 欧美亚洲图片小说| 日韩三级视频中文字幕| 久久久99精品久久| 一卡二卡三卡日韩欧美| 视频一区二区三区入口| 国产在线精品一区二区不卡了| 国产成人av一区| 欧洲一区在线电影| 欧美性猛片xxxx免费看久爱| 日韩女优av电影在线观看| 久久久久久久久99精品| 亚洲人吸女人奶水| 青娱乐精品视频| 韩国视频一区二区| 国产福利一区二区三区视频在线 | 亚洲视频你懂的| 天天亚洲美女在线视频| 国产精品一区久久久久| 欧美视频一区二区三区在线观看| 欧美一级片在线看| 中文字幕一区免费在线观看| 亚洲美女偷拍久久| 麻豆91免费观看| 色素色在线综合| 久久免费的精品国产v∧| 亚洲国产一区在线观看| 国产河南妇女毛片精品久久久 | 日韩欧美一级在线播放| 日韩精品一区二| 亚洲女人小视频在线观看| 久久国产尿小便嘘嘘尿| 91蝌蚪porny| 久久婷婷一区二区三区| 亚洲电影一区二区| 国产伦精品一区二区三区视频青涩| 日本精品视频一区二区三区| 国产午夜精品一区二区三区视频 | 欧美丝袜第三区| 欧美激情中文字幕| 麻豆成人在线观看| 欧美日韩一本到| 亚洲欧美影音先锋| 男男视频亚洲欧美| 不卡的av中国片| 亚洲精品一区二区三区福利| 偷拍与自拍一区| 91视频xxxx| 精品美女在线播放| 日韩av一区二区三区四区| 一本高清dvd不卡在线观看| 久久九九影视网| 麻豆极品一区二区三区| 一本大道av一区二区在线播放 | 久久久国产一区二区三区四区小说| 婷婷国产v国产偷v亚洲高清| 日韩精品一二三区| 欧美久久久久久久久| 日本成人中文字幕| 欧美大片拔萝卜| 国产一区二区不卡老阿姨| 久久久久久久久久久久电影 | 国产在线看一区| 亚洲精品一区二区三区蜜桃下载| 国产在线精品免费av| 国产亚洲一区二区在线观看| 成人免费高清视频| 亚洲美女区一区| 欧美日本一区二区| 麻豆精品在线播放| 国产色婷婷亚洲99精品小说| 99在线精品观看| 亚洲国产另类av| 日韩精品最新网址| 成人在线视频一区二区| 亚洲丝袜自拍清纯另类| 欧美日韩视频专区在线播放| 美女被吸乳得到大胸91| 国产色爱av资源综合区| 色综合久久天天综合网| 日韩精品三区四区| 国产亚洲欧洲一区高清在线观看| 97精品国产97久久久久久久久久久久 | 亚洲精品成人精品456| 欧美日韩精品一区二区| 极品少妇一区二区| 中文字幕一区二区三区不卡| 欧美精品三级日韩久久| 国产一区二区三区久久悠悠色av| 国产精品国产三级国产专播品爱网| 色综合一区二区三区| 日韩综合在线视频| 久久精品人人做人人爽97| 91久久精品日日躁夜夜躁欧美| 日本伊人色综合网| 亚洲国产精品成人综合色在线婷婷| 91精彩视频在线| 久久国产麻豆精品| 亚洲精品久久嫩草网站秘色| 日韩欧美黄色影院| 91丨九色porny丨蝌蚪| 麻豆成人av在线| 综合精品久久久| 日韩一级精品视频在线观看| www.日韩精品| 免费在线一区观看| 亚洲欧洲制服丝袜| 精品久久久久一区二区国产| 一本久久精品一区二区| 狠狠色综合日日| 亚洲在线观看免费视频| 日本一区二区三区视频视频| 欧美日韩国产首页| a4yy欧美一区二区三区| 久久91精品久久久久久秒播| 亚洲精品乱码久久久久久久久| 精品国产99国产精品| 欧美影片第一页| 成人国产精品视频| 免费久久精品视频| 一区二区三区在线播放| 国产网站一区二区| 欧美成人一区二区三区在线观看| 91黄视频在线观看| 粉嫩蜜臀av国产精品网站| 蜜桃精品视频在线| 亚洲成在人线在线播放| ㊣最新国产の精品bt伙计久久| 欧美不卡一区二区三区| 欧美日韩日日夜夜| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品一二三区| 经典三级在线一区| 日韩电影在线观看网站| 亚洲二区在线视频| 一区二区三区波多野结衣在线观看| 久久亚洲私人国产精品va媚药| 91精品国产综合久久香蕉的特点| 色乱码一区二区三区88| 91一区二区在线观看| 国产jizzjizz一区二区| 国内精品第一页| 麻豆免费看一区二区三区| 日韩国产一区二| 日韩电影一区二区三区四区| 亚洲不卡一区二区三区| 亚洲激情图片小说视频| 亚洲精品福利视频网站| 亚洲精品v日韩精品| 亚洲欧洲综合另类|