📄 nor_flash.h
字号:
/*-----------------------------------------------------------------------------
* File: nor_flash.h
*-----------------------------------------------------------------------
* (C) Copyright 2001 Metrowerks Corp.
* ALL RIGHTS RESERVED .
*
* THIS IS CONFIDENTIAL PROPRIETARY SOURCE CODE OF METROWERKS CORP.
*
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
*-----------------------------------------------------------------------
*
* Description:
* This file contains the defines for NOR Flash 16bit (S29WSxxxN MirrorBit Flash Family )
*
* History:
*
* 23-Oct-2004 ZeldaL Initial version
*-----------------------------------------------------------------------------*/
#ifndef FLASH_H_H
#define FLASH_H_H
#define FLASH_RESET_CODE_LEN 2048
/* Return codes from flash_status */
#define STATUS_READY 0 /* ready for action */
#define STATUS_BUSY 1 /* operation in progress */
#define STATUS_ERSUSP 2 /* erase suspended */
#define STATUS_TIMEOUT 3 /* operation timed out */
#define STATUS_ERROR 4 /* unclassified but unhappy status */
// Mask status return code
#define MASK_STATUS_ERSUSP 0x0040 /* erase suspended */
#define MASK_STATUS_READY 0 /* ready for action */
#define MASK_STATUS_TIMEOUT 0x0020 /* operation timed out */
#define LED_BLINK_COUNT 100
#define FLASH_MANUFACTURE_ID 0x0001
#define FLASH_DEV_ID 0x227E
#define FC_UNLOCK1 0x00AA
#define FC_UNLOCK2 0x0055
#define FC_ERASE_SETUP 0x0080
#define FC_SECTOR_ERASE 0x0030
#define FC_ALL_SECTORS_ERASE 0x0010
#define FC_PROGRAM 0x00A0
#define FC_RESET 0x00F0
#define FC_DEV_ID 0x0090
#define FC_BUFFER_PROGRAM 0x0025
#define FC_BUFFER_PROGRAM_CONFIRM 0x0029
#define FA_BYTE_UNLOCK_1 0xAAA
#define FA_BYTE_UNLOCK_2 0x555
#define FA_BYTE_COMMAND 0xAAA
#define FA_WORD_UNLOCK_1 0xAAA //(0x555 < 1)
#define FA_WORD_UNLOCK_2 0x554 // (0x2AA < 1)
#define FA_WORD_COMMAND 0xAAA //(0x555 < 1)
#define FS_ERASE_DONE 0x00FF
#define FLASH_BYTE_1 1
#define FLASH_BYTES_2 2
#define MAX_ERR 5
#define ERASE_POLL_LIMIT 0x10000000
//#define ERASE_POLL_LIMIT 0x01000000 after orig
//#define PROGRAM_POLL_LIMIT 0x10000 orig
#define PROGRAM_POLL_LIMIT 0x100
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -