📄 m29w160b.h
字号:
#ifndef __m29w160b_h
#define __m29w160b_h
#include "dm.h"
/* flash commands data */
#define FIRST_DATA 0xAA
#define SECOND_DATA 0x55
#define PROGRAM_COMMAND 0xA0
#define ERASE_SETUP 0x80
#define CHIP_ERASE 0x10
#define BLOCK_ERASE 0x30
#define UNLOCK_BYPASS 0x20
#define UNLOCK_BYPASS_PROGRAM 0xA0
#define UNLOCK_BYPASS_RESET1 0x90
#define UNLOCK_BYPASS_RESET2 0x00
#define PROTECT_SETUP 0x60
#define PROTECT_CMD 0x60
#define PROTECT_VERIFY 0x40
#define UNPROTECT_SETUP 0x60
#define UNPROTECT_CMD 0x60
#define UNPROTECT_VERIFY 0x40
#define READ_RESET 0xF0
/* flash protection status */
#define BLK_PROTECTED 0x0001
#define BLK_UNPROTECTED 0x0000
/* flash protection offset */
#define PROTECT_OFFSET 0x02
#define UNPROTECT_OFFSET 0x42
/* flash commands address */
#define FIRST_ADDR 0x555
#define SECOND_ADDR 0x2AA
#define THIRD_ADDR 0x555
#define FOURTH_ADDR 0x555
#define FIFTH_ADDR 0x2AA
#define SIXTH_ADDR 0x555
/* status data bit 7, 6, 5 */
#define DATA_POLLING_BIT 0x80
#define TOGGLE_BIT 0x40
#define ERROR_BIT 0x20
#define ERASE_TIMER_BIT 0x08
/* base address of boot flash */
#define BFLASH_BASE ((volatile unsigned short *)0x00000000)
/* size of boot flash (by 16-bit) */
#define BFLASH_SIZE (0x100000)
/* number of blocks in boot flash */
#define BFLASH_BLKNUM (35)
/* function prototypes */
int BfBlockProtect (unsigned int);
int BfChipProtect (void);
int BfChipUnprotect (void);
int BfDataToggle (void);
int BfBlockErase (unsigned int);
int BfProgram (unsigned int, unsigned int, unsigned short *);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -