📄 main_nandflash.c
字号:
/*
*********************************************************
* Copyright (c)
* All rights reserved.
*
* 文件名称:main_nandflash.c
* 文件标识:程序实现体
* 摘 要:本文件是对nandflash功能的测试
*
* 当前版本:1.0
* 作 者:刘征
* 完成日期:2005.4.3
*
* 取代版本:
* 作 者:
* 完成日期:
*********************************************************
*/
/*
*********************************************************
* 头文件
*********************************************************
*/
#include "2410addr.h"
#include "2410lib.h"
#include "def.h"
#include "nandflash_k9f1208.h"
/*
*********************************************************
* 常量
*********************************************************
*/
/*
*********************************************************
* 变量
*********************************************************
*/
/*
*********************************************************
* 函数原型
*********************************************************
*/
/*
*********************************************************
* 函数介绍:本函数被使用来做测试nandflash的功能。
* 输入参数:无
* 输出参数:无
* 返回值 :无
*********************************************************
*/
void Main(void)
{
U8 key = 0;
Port_Init(); //端口初始化
Isr_Init(); //中断初始化
Uart_Init(0,115200); //串口初始化 波特率为115200
Uart_Select(1); //选者串口0
ChangeClockDivider(1,1); // 1:2:4
ChangeMPllValue(0xa1,0x3,0x1); // FCLK=202.8MHz
Uart_Printf("nandflash test!\n");
while(1)
{
Uart_Printf("Press '1' to K9F1208_Program()!!!\n");
Uart_Printf("Press '2' to K9F1208_Erase()!!!\n");
Uart_Printf("Press '3' to K9F1208_PrintBadBlockNum()!!!\n");
Uart_Printf("Press '4' to K9F1208_PrintBlock()!!!\n");
Uart_Printf("Press '5' to TestECC()!!!\n");
//接收串口字符
key = Uart_Getch();
switch(key)
{
case '1':
K9F1208_Program();//调用K9F1208_Program函数
key = 0;
break;
case '2':
K9F1208_Erase();//调用K9F1208_Erase函数
key = 0;
break;
case '3':
K9F1208_PrintBadBlockNum();//调用K9F1208_PrintBadBlockNum函数
key = 0;
break;
case '4':
K9F1208_PrintBlock();//调用K9F1208_PrintBlock函数
key = 0;
break;
case '5':
TestECC();//调用TestECC函数
key = 0;
break;
default:
key = 0;
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -