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

📄 mx2_nand.h

📁 mx21的NAND Flash Bootloader源代码
💻 H
字号:
/*************************************************************************Title:   	Filename:   $Header:$Hardware:   MX21Summay:License:    The contents of this file are subject to the Mozilla Public            License Version 1.1 (the "License"); you may not use this file            except in compliance with the License. You may obtain a copy of            the License at http://www.mozilla.org/MPL/Author:   Company:    Motorola Suzhou Design Center====================Change Log========================$Log:$********************************************************************************////@file 	mx2_nand.h///@brief	head file of MX21 NAND Flash Control low level.#ifndef MX_mx2_nand_INCLUDE_01072003#define MX_mx2_nand_INCLUDE_01072003//<<<<<Include//>>>>>Include//<<<<<Macro#define ECC_EN 0x8#define SP_EN  0x4#define NAND_FLASH_CONFIG2_INT 0x8000#define NAND_FLASH_CONFIG2_FCMD 0x1#define NAND_FLASH_CONFIG2_FADD 0x2#define NAND_FLASH_CONFIG2_FDI  0x4#define ERR_TIME_OUT -1#define ERR_VERIFY   -2#define CONFIG2_SET_FDO_PAGE_OUT() _reg_NFC_NF_CONFIG2=0x8; #define CONFIG2_SET_FDO_ID() 	  _reg_NFC_NF_CONFIG2=0x10#define CONFIG2_SET_FDO_STATUS()  _reg_NFC_NF_CONFIG2=0x20;#define CONFIG1_SET_READ() do{ _reg_NFC_NF_CONFIG1|=0x2; _reg_NFC_NF_CONFIG1&=~0x1;}while(0)#define CONFIG1_SET_WRITE() do{ _reg_NFC_NF_CONFIG1&=~0x2; _reg_NFC_NF_CONFIG1|=0x1;}while(0)#ifdef _STANDALONE_#define WAIT(condition, timeout_usec) while(condition);#else#define WAIT(condition, timeout_usec) while(condition);#endif#ifndef NAND_CMD_READ0	#define NAND_CMD_READ0              0x0#endif#ifndef NAND_CMD_READ1	#define NAND_CMD_READ1              0x1#endif#ifndef NAND_CMD_RESET	#define NAND_CMD_RESET              0xFF#endif#define NAND_CMD_PAGE_PROG                  0x80#define NAND_CMD_PAGE_PROG_CONFIRM_TRUE     0x10#define NAND_CMD_PAGE_PROG_CONFIRM_DUMMY    0x11 #define NAND_CMD_BLOCK_ERASE                0x60#define NAND_CMD_BLOCK_ERASE_CONFIRM        0xD0#define NAND_CMD_READ_STATUS                0x70#define NAND_CMD_READ_ID                    0x90#define NAND_FLASH_BLOCK_NUMBER             4096*64#define NAND_FLASH_PAGE_PER_BLOCK  			32#define NAND_FLASH_PAGE_MAIN_SIZE           512#define	NAND_FLASH_PAGE_SPARE_SIZE			16			//<<<<<Public Structure#ifdef _STANDALONE_typedef unsigned int u32;typedef unsigned short u16;typedef unsigned char u8;#endif//>>>>>Public Structure//<<<<<Public Function Declearation///Preset()extern void Preset();///NAND_Command()extern u32 NAND_Command(u16 command);///NAND_SendAddress()extern u32 NAND_SendAddress(u32 addr,int cycle);///NAND_Read_OnePage()extern u32 NAND_Read_OnePage(int page, char * mainbuff, char * parabuf);///NAND_Read_OOB()extern u32 NAND_Read_OOB(int col, int page, char *parabuff,int count);///NAND_ReadID()extern u32 NAND_ReadID(u32 * ID);///NAND_ReadStatus()extern u32 NAND_ReadStatus(u32 * status);///NAND_Write_OnePage();extern u32 NAND_Write_OnePage(u32 page, char * mainbuff, char* parabuff );///NAND_Erase();extern u32 NAND_Erase(u32 page);//>>>>>Public Function Declearation//<<<<<Public Gobal Variable Declearation//>>>>>Public Gobal Variable Declearation#endif

⌨️ 快捷键说明

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