?? flash.c.bak
字號:
#include "flash.h"
#include "..\Target\44b.h"
#include "..\Target\44blib.h"
#define LASTBLOCK 1023
unsigned int Check_Flash_Id(void)
{
}
void Flash_Reset()
{
}
/********************************************************/
/*功能:擦除FLASH的1Block(對應文件系統為1Cluster) */
/********************************************************/
unsigned char Erase_Block(unsigned int block)
{
}
/*****************************************************************/
/*功能:讀取FLASH的某個Block中的1page數據 */
/*****************************************************************/
void Read_Page(unsigned int block,unsigned int page,unsigned char *buffer)
{
}
/*****************************************************************/
/*功能:向FLASH的某個Block中的1page寫入數據 */
/*輸出:0:Fail;1:OK */
/*****************************************************************/
int Write_Page(unsigned int block,unsigned int page,unsigned char *buffer)
{
}
void Read_ID(void)
{
unsigned short id;
id = Check_Flash_Id();
Uart_Printf("\nChip's ID is 0x%4x.",id);
}
void Erase_test(void)
{
Uart_Printf("\nBegin to erase the last block...");
if(Erase_Block(LASTBLOCK))
Uart_Printf("\nOK! Compeleted.");
else
Uart_Printf("\nErase error!");
}
void Write_test(void)
{
int i;
unsigned char buffer[528];
for(i=0;i<528;i++)
buffer[i]=0xaa;
Uart_Printf("\nBegin to Write the first Page of the last block...");
if(Write_Page(LASTBLOCK,0,buffer))
Uart_Printf("\nOK! Compeleted.");
else
Uart_Printf("\nWrite error!");
}
void Read_test(void)
{
int i,j=0;
unsigned char buffer[528];
Uart_Printf("\nBegin to Read the first Page of the last block...");
Read_Page(LASTBLOCK,0,buffer);
for(i=0;i<528;i++)
{
if(buffer[i]==0xaa)
j++;
}
Uart_Printf("\n%4d Bytes verify match!",j);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -