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

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

?? flash.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// 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 991 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.
//
//*****************************************************************************
#if defined(GROUP_usecget) || defined(BUILD_ALL) || defined(DOXYGEN)
unsigned long
FlashUsecGet(void)
{
    //
    // Return the number of clocks per micro-second.
    //
    return(HWREG(FLASH_USECRL) + 1);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_usecset) || defined(BUILD_ALL) || defined(DOXYGEN)
void
FlashUsecSet(unsigned long ulClocks)
{
    //
    // Set the number of clocks per micro-second.
    //
    HWREG(FLASH_USECRL) = ulClocks - 1;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_erase) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_program) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_protectget) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
        }
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_protectset) || defined(BUILD_ALL) || defined(DOXYGEN)
long
FlashProtectSet(unsigned long ulAddress, tFlashProtection eProtect)
{
    unsigned long ulProtectRE, ulProtectPE;

    //
    // Check the argument.
    //

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品自产自拍| 夜夜夜精品看看| 亚洲欧美在线观看| 亚洲成a人在线观看| 三级在线观看一区二区| 国内精品伊人久久久久av影院| 国产ts人妖一区二区| 欧洲另类一二三四区| 日韩一区二区三区电影| 国产精品久线在线观看| 偷拍一区二区三区| www.亚洲在线| 欧美一区二区三区公司| 国产精品萝li| 久久疯狂做爰流白浆xx| 色综合天天狠狠| 欧美精品一区二区三区很污很色的| 中文字幕的久久| 麻豆91在线看| 91免费在线看| 久久久天堂av| 婷婷六月综合网| 99久久99久久免费精品蜜臀| 在线不卡中文字幕播放| 国产精品国产三级国产专播品爱网| 偷拍一区二区三区| 91啦中文在线观看| 久久久99精品免费观看不卡| 香蕉av福利精品导航| 波多野结衣91| 精品精品国产高清一毛片一天堂| 亚洲一区成人在线| 成人av免费在线| 2024国产精品视频| 日韩精品视频网站| www.爱久久.com| 精品国产一区二区国模嫣然| 亚洲综合丝袜美腿| av色综合久久天堂av综合| 精品久久久久久最新网址| 亚洲一区二区黄色| 91蝌蚪porny成人天涯| 国产亚洲女人久久久久毛片| 奇米影视7777精品一区二区| 一本色道**综合亚洲精品蜜桃冫| 国产亚洲精品aa午夜观看| 琪琪一区二区三区| 91.成人天堂一区| 亚洲六月丁香色婷婷综合久久| 国产成人av电影在线观看| 精品少妇一区二区三区免费观看 | 美腿丝袜在线亚洲一区| 91麻豆swag| 国产精品午夜免费| 国产精品88av| 久久九九全国免费| 国产尤物一区二区| 久久伊人中文字幕| 国产综合色在线| 精品国产一区二区三区不卡| 奇米影视7777精品一区二区| 欧美男男青年gay1069videost| 亚洲一级片在线观看| 色哟哟精品一区| 亚洲人成网站精品片在线观看 | 国产精品视频线看| 丰满少妇久久久久久久| 国产亚洲污的网站| 国产精品亚洲а∨天堂免在线| 精品国产区一区| 国产一区 二区| 久久久不卡网国产精品二区 | 国产女人水真多18毛片18精品视频| 精品无人区卡一卡二卡三乱码免费卡| 91精品国产综合久久蜜臀| 午夜精品久久久久久久蜜桃app| 欧美三级电影一区| 日韩国产欧美三级| 精品嫩草影院久久| 国产在线一区二区综合免费视频| 久久综合久久久久88| 国产99一区视频免费| 亚洲国产精品二十页| 94-欧美-setu| 一区二区三区在线播| 欧美色图片你懂的| 美女www一区二区| 国产午夜精品一区二区| av在线这里只有精品| 亚洲激情网站免费观看| 欧美日韩国产影片| 免费日本视频一区| 国产三级三级三级精品8ⅰ区| eeuss国产一区二区三区| 亚洲视频你懂的| 欧美日韩精品系列| 美女视频一区二区| 中文字幕 久热精品 视频在线 | 日韩一区在线播放| 欧美中文字幕一区二区三区亚洲| 天天色天天操综合| 久久久国产精品麻豆| 92精品国产成人观看免费| 亚洲.国产.中文慕字在线| 欧美不卡一二三| 成人做爰69片免费看网站| 一区二区三区在线观看动漫| 欧美一级片在线| 成人精品鲁一区一区二区| 夜夜嗨av一区二区三区网页| 91精品国产福利| 成人激情免费视频| 亚洲第一久久影院| 国产三级一区二区| 欧美日韩和欧美的一区二区| 久久91精品国产91久久小草| 18欧美乱大交hd1984| 欧美一级电影网站| av在线不卡观看免费观看| 丝袜美腿亚洲综合| 国产精品久久久久久久午夜片 | 欧美a一区二区| 国产精品久久久久久户外露出 | 蜜臀久久99精品久久久久宅男| 国产欧美日韩不卡| 欧美日韩在线播放三区四区| 国产美女主播视频一区| 亚洲一区二区三区视频在线播放| 精品国产区一区| 欧美丝袜丝交足nylons| 国产精品影视网| 亚洲3atv精品一区二区三区| 国产欧美一区二区精品性色超碰 | 天天免费综合色| 国产精品久久夜| 日韩免费性生活视频播放| 色综合色狠狠天天综合色| 韩日精品视频一区| 水蜜桃久久夜色精品一区的特点| 国产精品日韩成人| 欧美成人猛片aaaaaaa| 日本二三区不卡| 成人国产精品免费观看| 久久99九九99精品| 天堂一区二区在线免费观看| 国产精品麻豆欧美日韩ww| 精品久久久久久无| 欧美日韩一级大片网址| av高清久久久| 国产精品小仙女| 九九视频精品免费| 五月天一区二区| 亚洲午夜激情av| 亚洲欧美乱综合| 国产精品美女视频| 久久久久久久久久看片| 欧美一区二区三区四区高清 | 美女mm1313爽爽久久久蜜臀| 亚洲精品国产a久久久久久| 中文乱码免费一区二区| 精品久久久久久久人人人人传媒 | 日韩精品亚洲一区二区三区免费| 一区二区在线观看免费视频播放 | 91九色最新地址| 成人爱爱电影网址| 国产成+人+日韩+欧美+亚洲| 久久99国产精品久久| 青娱乐精品视频| 三级欧美韩日大片在线看| 亚洲国产成人va在线观看天堂| 自拍偷拍亚洲综合| 综合在线观看色| 中文字幕一区二区三区在线不卡| 国产调教视频一区| 日本一区二区三区视频视频| 久久蜜臀中文字幕| 久久精品欧美一区二区三区麻豆| www激情久久| 亚洲精品精品亚洲| 亚洲日本免费电影| 一区二区三区日韩精品| 亚洲精品国产无套在线观| 一个色妞综合视频在线观看| 亚洲男同性视频| 亚洲黄色性网站| 香蕉久久夜色精品国产使用方法| 亚洲成av人在线观看| 三级一区在线视频先锋| 天天av天天翘天天综合网| 日韩精品一二区| 麻豆成人91精品二区三区| 激情图片小说一区| 国产福利91精品一区二区三区| 国产福利视频一区二区三区| 粉嫩av亚洲一区二区图片| 波多野结衣一区二区三区| 91色porny| 欧美日韩电影在线播放| 91精品国产91久久久久久最新毛片 | 欧美日韩不卡一区|