?? f330_w25p16_flashmemory.ver.2.02.c
字號:
//
// File Name:F330_W25P16_FlashMemory.ver.2.02.c
//----------------------------------------------------------------------------
// Project Name: W25P16
// Module Name: 16MBytes Flash Memory
//----------------------------------------------------------------------------
//
// Company:Semiconductor Device Solution, Inc
// http://www.sdsi.com.tw/
//
// Engineer: Owen Chen
// Create Date: 13:30:00 10/03/2007
// Updata Date: 13:30:00 10/09/2007
// Revision: 2.02
//
// Description:
// . Winbond W25P16 16MBytes Flash Memory
// . Read / Write Status Register
// . Read / Write Page Program
// . Erase
// . RS232
//
//
// Target Devcies: C8051F330
//
// Tool Chain: Tool chain: KEIL Eval 'c'
// Copyright Semiconductor Device Solution, Inc .All Rights Reserved
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <c8051f330.h> // SFR declarations
#define High 1
#define Low 0
#define Header1 0x48
#define Header6 0xFE
typedef union {
unsigned int i;
unsigned char b[2];
} UINT;
//-----------------------------------------------------------------------------
// Initialation PROTOTYPES
//-----------------------------------------------------------------------------
void Port_IO_Init();
void SPI_Init();
void UART0_Init();
//-----------------------------------------------------------------------------
// Function PROTOTYPES
//-----------------------------------------------------------------------------
void Read_Manu(); // Read Manufacturer & Device ID
void Write_Instruction(unsigned char COMMAND, unsigned long DATA);
void W25P16_Check_BUSY(); // Check Busy
void DelayTime(int num);
//-----------------------------------------------------------------------------
// Global CONSTANTS
//-----------------------------------------------------------------------------
sbit CS = P0^6;
sbit LED = P1^3;
//-----------------------------------------------------------------------------
// Global VARIABLES
//-----------------------------------------------------------------------------
idata UINT ManID; // Manufacturer & Device ID 2 Bytes
idata unsigned char Status_REG; // Status Register
xdata unsigned char FlashDATA[512]; // Flash Memory Data
xdata unsigned char BufferDATA[512]; // Flash Memory Data
unsigned char temp[3]; // 既
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -