⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nandflash.c

📁 44box的bootloader原代码及其分析。
💻 C
字号:
#include "..\flashtest\flash.h"
#include "..\Target\44blib.h"
#include "nandflash.h"

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_Cluster(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(WritePage(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...");
	ReadPage(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 + -