main.c

来自「优龙板的nand flash驱动程序」· C语言 代码 · 共 50 行

C
50
字号
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
#include "timer.h"
#include "mmu.h"
#define FCLK 200000000
#define HCLK (FCLK/2)
#define PCLK (HCLK/2)
#define UCLK 48000000
#define U32  unsigned int
U32	Console_Uart = 0;
U32	Console_Baud = 115200;
void Isr_Init(void);
//void NandFlashInit (void);
//void NandFlashStatusRep(void);
//void NandFlash_Test( void );
//void K9S1208_Program(void);
void K9S1208_PrintBlock(void);
void K9S1208_Program(void);
void Main (void)
{	MMU_Init();
	SetClockDivider(1, 1);
	SetSysFclk(DFT_FCLK_VAL);       
	Port_Init();
	Isr_Init();
	Uart_Select(Console_Uart);
	Uart_Init(0, Console_Baud);
   
while( 1 )
{
K9S1208_Program();
K9S1208_PrintBlock();
//NandFlashInit(); //NAND FLASH 初始化
//NandFlashStatusRep(); //读取NAND FLASH 的信息
//NandFlash_Test(); //NAND FLASH 实验函数
getch();
}
}

void Isr_Init(void)
{
  //  pISR_UNDEF  = (U32)HaltUndef;
    //pISR_SWI    = (U32)HaltSwi;
    //pISR_PABORT = (U32)HaltPabort;
    //pISR_DABORT = (U32)HaltDabort;
    rINTMOD = 0x0;	  // All=IRQ mode
    rINTMSK = BIT_ALLMSK;	  // All interrupt is masked.        
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?