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

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

?? at45.h

?? Dataflash example for ARM9 using KEIL.
?? H
字號:
/* ----------------------------------------------------------------------------
 *         ATMEL Microcontroller Software Support 
 * ----------------------------------------------------------------------------
 * Copyright (c) 2008, Atmel Corporation
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * - Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the disclaimer below.
 *
 * Atmel's name may not be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * ----------------------------------------------------------------------------
 */
//------------------------------------------------------------------------------
/// \unit
///
/// !!!Purpose
/// 
/// The Dataflash driver is based on top of the corresponding Spi driver.
/// A Dataflash structure instance has to be initialized using the DF_Init
/// function. Then basic dataflash operations can be launched using macros such
/// as DF_continuous_read. These macros invoke the DF_Command() function which
/// invokes the DPI low driver using the SPI_SendCommand() function.
/// Beware to compute the dataflash internal address, the dataflash sector
/// description must be known (DataflashDesc). Dataflash can be automatically
/// detected using the DF_Scan() function.
/// !!!Usage
/// 
/// -# Initializes an AT45 instance and configures SPI chip select pin
///    using AT45_Configure().
/// -# Detect DF and returns DF description corresponding to the device
///    connected using AT45_FindDevice().This function shall be called by 
///    the application before AT45_SendCommand.
/// -# Sends a command to the DF through the SPI using AT45_SendCommand().
///    The command is identified by its command code and the number of 
///    bytes to transfer.
///    -# Example code for sending command to write a page to DF.
/// \code
///    // Issue a page write through buffer 1 command
///	   error = AT45_SendCommand(pAt45, AT45_PAGE_WRITE_BUF1, 4, 
///	           pBuffer, size, address, 0, 0);
/// \endcode
///    -# Example code for sending command to read a page from DF.
///       If data needs to be received, then a data buffer must be 
///       provided.
/// \code
///    // Issue a continuous read array command
///    error = AT45_SendCommand(pAt45, AT45_CONTINUOUS_READ_LEG, 8,
///            pBuffer, size, address, 0, 0);
/// \endcode
///    -# This function does not block; its optional callback will 
///       be invoked when the transfer completes.
/// -# Check the AT45 driver is ready or not by polling AT45_IsBusy().
/// 
//------------------------------------------------------------------------------

#ifndef AT45_H
#define AT45_H

//------------------------------------------------------------------------------
//         Headers
//------------------------------------------------------------------------------

#include "spid.h"

//------------------------------------------------------------------------------
//         Definitions
//------------------------------------------------------------------------------

/// The dataflash driver is currently in use.
#define AT45_ERROR_LOCK         1
/// There was an error with the SPI driver.
#define AT45_ERROR_SPI          2

/// AT45 dataflash SPI CSR settings given MCK and SPCK.
#define AT45_CSR(mck, spck) \
    (AT91C_SPI_NCPHA | SPID_CSR_DLYBCT(mck, 250) \
     | SPID_CSR_DLYBS(mck, 250) | SPID_CSR_SCBR(mck, spck))

//------------------------------------------------------------------------------
//         Macros
//------------------------------------------------------------------------------

#define AT45_PageOffset(pAt45) ((pAt45)->pDesc->pageOffset)
#define AT45_PageNumber(pAt45) ((pAt45)->pDesc->pageNumber)

/// Returns 1 if the device is ready; otherwise 0.
#define AT45_STATUS_READY(status)       (status & 0x80)
/// Returns the device ID code.
#define AT45_STATUS_ID(status)          (status & 0x3c)
/// Returns 1 if the device is configured in binary page mode; otherwise 0.
#define AT45_STATUS_BINARY(status)      (status & 0x01)

//------------------------------------------------------------------------------
//         Definitions
//------------------------------------------------------------------------------

/// Main memory page read command code.
#define AT45_PAGE_READ              0xD2
/// Continous array read (legacy) command code.
#define AT45_CONTINUOUS_READ_LEG    0xE8
/// Continous array read (low frequency) command code.
#define AT45_CONTINUOUS_READ_LF     0x03
/// Continous array read command code.
#define AT45_CONTINUOUS_READ        0x0B
/// Buffer 1 read (low frequency) command code.
#define AT45_BUF1_READ_LF           0xD1
/// Buffer 2 read (low frequency) command code.
#define AT45_BUF2_READ_LF           0xD3
/// Buffer 1 read (serial) command code.
#define AT45_BUF1_READ_SER          0xD4
/// Buffer 2 read (serial) command code.
#define AT45_BUF2_READ_SER          0xD6
/// Buffer 1 read (8-bit) command code.
#define AT45_BUF1_READ_8B           0x54
/// Buffer 2 read (8-bit) command code.
#define AT45_BUF2_READ_8B           0x56

/// Buffer 1 write command code.
#define AT45_BUF1_WRITE             0x84
/// Buffer 2 write command code.
#define AT45_BUF2_WRITE             0x87
/// Buffer 1 to main memory page program with erase command code.
#define AT45_BUF1_MEM_ERASE         0x83
/// Buffer 2 to main memory page program with erase command code.
#define AT45_BUF2_MEM_ERASE         0x86
/// Buffer 1 to main memory page program without erase command code.
#define AT45_BUF1_MEM_NOERASE       0x88
/// Buffer 2 to main memory page program without erase command code.
#define AT45_BUF2_MEM_NOERASE       0x89
/// Page erase command code.
#define AT45_PAGE_ERASE             0x81
/// Block erase command code.
#define AT45_BLOCK_ERASE            0x50
/// Sector erase command code.
#define AT45_SECTOR_ERASE           0x7C
/// Chip erase command code.
#define AT45_CHIP_ERASE             0xC7, 0x94, 0x80, 0x9A
/// Main memory page program through buffer 1 command code.
#define AT45_PAGE_WRITE_BUF1        0x82
/// Main memory page program through buffer 2 command code.
#define AT45_PAGE_WRITE_BUF2        0x85

/// Main memory page to buffer 1 transfer command code.
#define AT45_PAGE_BUF1_TX           0x53
/// Main memory page to buffer 2 transfer command code.
#define AT45_PAGE_BUF2_TX           0x55
/// Main memory page to buffer 1 compare command code.
#define AT45_PAGE_BUF1_CMP          0x60
/// Main memory page to buffer 2 compare command code.
#define AT45_PAGE_BUF2_CMP          0x61
/// Auto page rewrite through buffer 1 command code.
#define AT45_AUTO_REWRITE_BUF1      0x58
/// Auto page rewrite through buffer 2 command code.
#define AT45_AUTO_REWRITE_BUF2      0x59
/// Deep power-down command code.
#define AT45_DEEP_PDOWN             0xB9
/// Resume from deep power-down command code.
#define AT45_RES_DEEP_PDOWN         0xAB
/// Status register read command code.
#define AT45_STATUS_READ            0xD7
/// Manufacturer and device ID read command code.
#define AT45_ID_READ                0x9F

/// Power-of-2 binary page size configuration command code.
#define AT45_BINARY_PAGE_FIRST_OPCODE   0x3D
#define AT45_BINARY_PAGE                0x2A, 0x80, 0xA6

//------------------------------------------------------------------------------
//         Types
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
/// Dataflash description. A constant array of DataflashDesc instance is defined
/// in at45.c. The DF_Scan() function returns the corresponding descriptor
/// according to the dataflash ID detected.
/// This description (page_size, page_offset) is used to compute the internal
/// dataflash address by the DF_Command() function.
//------------------------------------------------------------------------------
typedef struct {

    /// dataflash page number.
	unsigned int pageNumber;
    // indicate if power-of-2 binary page supported.
	unsigned int hasBinaryPage;
    /// dataflash page size.
	unsigned int pageSize;
    /// page offset in command.
	unsigned int pageOffset;
    /// Dataflash ID.
	unsigned char id;
    /// Identifier.
	const char *name;

} At45Desc;

//------------------------------------------------------------------------------
/// Dataflash driver structure. It holds the current command being processed.
/// This structure is initialized by the DF_Init() command.
/// pDfDesc field can be initialized by the DF_Scan() function.
/// cmdBuffer is a private driver area used to compute the dataflash address to
/// be sent to the dataflash. 
/// Beware the PDC master must have access to this area.
//------------------------------------------------------------------------------
typedef struct _Dataflash {

    /// Pointer to Spi Structure (SPI low level driver).
	Spid *pSpid;
    /// Current SPI command sent to the SPI low level driver.
	SpidCmd command;
    /// Pointer to the dataflash description.
	const At45Desc *pDesc;
    /// Buffer to store the current command (opcode + dataflash address.
	unsigned char pCmdBuffer[8];

} At45;

//------------------------------------------------------------------------------
//         Exported functions
//------------------------------------------------------------------------------

extern unsigned char AT45_Configure(At45 *pAt45, Spid *pSpid, unsigned char spiCs);

extern unsigned char AT45_IsBusy(At45 *pAt45);

extern unsigned char AT45_SendCommand(
	At45 *pAt45,
	unsigned char cmd,
	unsigned char cmdSize,
	unsigned char *pData,
	unsigned int dataSize,
	unsigned int address,
	SpidCallback callback,
	void *pArgument);

extern const At45Desc * AT45_FindDevice(At45 *pAt45, unsigned char status);

extern unsigned int  AT45_PageSize(At45 *pAt45);
#endif // #ifndef AT45_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内成人免费视频| 亚洲视频中文字幕| 欧美视频三区在线播放| 成人在线视频首页| 成人激情小说乱人伦| 国产精品77777竹菊影视小说| 极品少妇xxxx精品少妇偷拍| 看电视剧不卡顿的网站| 麻豆91在线观看| 激情小说欧美图片| 福利一区二区在线观看| 成人国产精品视频| 色婷婷av一区| 777久久久精品| 精品日韩99亚洲| 中文字幕精品一区二区精品绿巨人 | 欧美日韩一区二区在线观看视频| 色综合久久综合网| 欧美精品久久99久久在免费线| 欧美电影在线免费观看| 欧美大尺度电影在线| 国产精品天天摸av网| 亚洲色图另类专区| 天堂在线亚洲视频| 捆绑紧缚一区二区三区视频| 国产福利视频一区二区三区| yourporn久久国产精品| 欧美日韩午夜精品| 国产欧美一区二区精品婷婷 | 美女看a上一区| 国产做a爰片久久毛片| 99精品一区二区| 欧美一区二区三区在线观看视频| 国产婷婷一区二区| 亚洲一区二区影院| 国产成人av电影在线播放| 不卡电影一区二区三区| 欧美丰满美乳xxx高潮www| 久久精品欧美一区二区三区麻豆| 亚洲青青青在线视频| 丝袜美腿亚洲一区| 99精品视频一区二区| 91麻豆精品国产91久久久久久久久| 久久久久久久综合| 亚洲一区二区三区四区的| 国产成人av一区二区| 欧美老肥妇做.爰bbww视频| 精品国产一区久久| 亚洲不卡在线观看| 99久久99久久久精品齐齐 | 久草这里只有精品视频| 91女人视频在线观看| 欧美大胆一级视频| 视频在线在亚洲| 一本一本大道香蕉久在线精品 | 一区在线中文字幕| 久久99国产乱子伦精品免费| 91久久精品一区二区三区| 精品sm在线观看| 洋洋成人永久网站入口| 成人丝袜高跟foot| 久久蜜桃av一区二区天堂| 亚洲福利一二三区| 欧美在线视频日韩| 综合在线观看色| 成人国产视频在线观看| 国产欧美一区二区三区网站| 麻豆精品在线视频| 欧美一区二区成人| 丝袜脚交一区二区| 欧美日韩在线播放三区四区| 亚洲女爱视频在线| 色婷婷久久综合| 亚洲免费色视频| 99精品视频中文字幕| 综合久久久久久| 在线一区二区三区四区| 亚洲免费观看在线观看| 一本色道久久加勒比精品| 亚洲天堂久久久久久久| 成人动漫视频在线| 中文字幕一区二区视频| 99久久久免费精品国产一区二区| 国产精品久久久久一区二区三区 | 欧美mv日韩mv国产网站| 蜜桃av一区二区| 日韩欧美卡一卡二| 久久成人18免费观看| 欧美xfplay| 国产91在线观看丝袜| 中文字幕av一区二区三区高| 国产精品一级片在线观看| 日韩久久精品一区| 国产一区高清在线| 国产精品大尺度| 在线观看视频一区| 日本伊人色综合网| 久久蜜桃av一区二区天堂 | 欧美日韩一区二区在线观看| 日日夜夜免费精品视频| 精品精品欲导航| 99亚偷拍自图区亚洲| 亚洲成人中文在线| 精品精品国产高清a毛片牛牛| av网站免费线看精品| 一区二区三区四区激情| 欧美一区二区三级| 成人av资源网站| 亚洲国产va精品久久久不卡综合 | 色94色欧美sute亚洲线路一久| 午夜在线电影亚洲一区| 精品国产sm最大网站| 97精品电影院| 麻豆国产精品官网| 伊人开心综合网| 欧美精品一区二区三区蜜桃视频| 国产欧美日韩在线| 国产精品午夜在线观看| 国产日本欧洲亚洲| 综合久久国产九一剧情麻豆| 中文一区二区在线观看| 久久九九99视频| 久久九九99视频| 亚洲综合视频网| 亚洲国产精品久久久男人的天堂| 夜夜爽夜夜爽精品视频| 日韩精品五月天| 午夜精品在线视频一区| 亚洲高清免费视频| 九一九一国产精品| 免费观看一级特黄欧美大片| 久久国产综合精品| 欧美v日韩v国产v| 久久久久久久综合色一本| 中文字幕乱码一区二区免费| 亚洲精品一区二区三区精华液| 91精品欧美久久久久久动漫| 日韩精品一区二区三区视频在线观看| 另类调教123区| 国产激情精品久久久第一区二区| 国产在线不卡视频| 国产精品全国免费观看高清| 亚洲天堂2016| 亚洲亚洲人成综合网络| 免费三级欧美电影| 国产成人午夜99999| 色噜噜狠狠色综合中国| 欧美日韩亚州综合| 8x8x8国产精品| 黑人巨大精品欧美一区| caoporn国产一区二区| 欧美性生活影院| 26uuu国产日韩综合| 亚洲精品国产一区二区精华液 | 欧美日韩中文一区| 国产精品主播直播| 色综合久久中文综合久久牛| 美日韩黄色大片| 国产色综合久久| 亚洲免费av高清| 精品99一区二区三区| 在线免费观看成人短视频| 欧美成人免费网站| 欧美国产日韩精品免费观看| 亚洲欧美一区二区三区久本道91| 琪琪久久久久日韩精品| 在线观看一区日韩| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美精品色一区二区三区| 国产精品欧美久久久久无广告| 亚洲精品国产高清久久伦理二区| 国产一级精品在线| 成人高清伦理免费影院在线观看| 精品夜夜嗨av一区二区三区| 七七婷婷婷婷精品国产| 亚洲精品高清在线| 亚洲一区二区三区在线看| 国产精品成人一区二区艾草 | 日韩专区欧美专区| 久久99九九99精品| 日韩欧美卡一卡二| 免费高清不卡av| 91看片淫黄大片一级| 99精品视频免费在线观看| 中文字幕不卡一区| 成人中文字幕在线| 91成人在线精品| 精品区一区二区| 粉嫩av一区二区三区| 久久久久久久精| 国产夜色精品一区二区av| 国产精品久久久久久亚洲伦| 一区二区成人在线观看| 91美女精品福利| 亚洲成a人片综合在线| 男女男精品视频网| 91精品国产综合久久精品 | 国产精品九色蝌蚪自拍| 最新日韩在线视频| 色拍拍在线精品视频8848|