typedef enum
{
BUFFER_1 = 0,
BUFFER_2
}E_Ext_FlashBuffer;
typedef enum
{
BUSYING = 0,
NOT_BUSY
}E_Ext_FlashBusy;
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* For AT45DB161D , SPI Flash supported commands */
/*---------------------------------------------*/
/* erase instructions */
/*---------------------------------------------*/
/* chip erase instruction */
#define CMD_CHIP_ERASE_FIRST_CMD 0xC7
#define CMD_CHIP_ERASE_SECOND_CMD 0x94
#define CMD_CHIP_ERASE_THIRD_CMD 0x80
#define CMD_CHIP_ERASE_FOUR_CMD 0x9A
/* sector erase instruction */
#define CMD_SECTOR_ERASE 0x7C
/* block erase instruction */
#define CMD_BLOCK_ERASE 0x50
/* page erase instruction */
#define CMD_PAGE_ERASE 0x81
/*---------------------------------------------*/
/* write instructions */
/*---------------------------------------------*/
/* write to buffer 1 instruction */
#define CMD_BUFFER_1_WRITE 0x84
/* write to buffer 2 instruction */
#define CMD_BUFFER_2_WRITE 0x87
/* write buffer 1 to main memory page in build-in erase mode */
#define CMD_B1_TO_MM_PAGE_WITH_ERASE 0x83
/* write buffer 2 to main memory page in build-in erase mode */
#define CMD_B2_TO_MM_PAGE_WITH_ERASE 0x86
/* write buffer 1 to main memory page in non-erase mode */
#define CMD_B1_TO_MM_PAGE_NO_ERASE 0x88
/* write buffer 2 to main memory page in non-erase mode */
#define CMD_B2_TO_MM_PAGE_NO_ERASE 0x89
/*---------------------------------------------*/
/* read instructions */
/*---------------------------------------------*/
/* read main memory page to buffer 1 */
#define CMD_MM_PAGE_TO_B1 0x53
/* read main memory page to buffer 2 */
#define CMD_MM_PAGE_TO_B2 0x55
/* read main memory page to SRAM buffer directly */
#define CMD_MM_PAGE_TO_DATA_DIRECT 0xD2
/* read to array in SRAM from buffer 1 of ext flash , high frequency mode */
#define CMD_B1_HIGH_FREQ_READ 0xD4
/* read to array in SRAM from buffer 2 of ext flash , high frequency mode */
#define CMD_B2_HIGH_FREQ_READ 0xD6
/* read to array in SRAM from buffer 1 of ext flash , low frequency mode */
#define CMD_B1_LOW_FREQ_READ 0xD1
/* read to array in SRAM from buffer 1 of ext flash , low frequency mode */
#define CMD_B2_LOW_FREQ_READ 0xD3
/* Read identification */
#define CMD_READ_ID 0x9F
/* Read Status Register instruction */
#define CMD_READ_STATUS 0xD7
/*---------------------------------------------*/
/* other value or status defines */
/*---------------------------------------------*/
/* busying flag in Status Register */
#define WRITE_BUSYING_FLAG 0x80 /* Write busy flag */
/* dummy write value */
#define DUMMY_WRITE_BYTE 0x00
/* buffer array define */
#define EXT_FLASH_PAGE_SIZE 528
/* page nums define */
#define EXT_FLASH_PAGE_NUMS 4096
红牛板Flash驱动AT45D161D--命令及资源定义
最新推荐文章于 2021-11-27 17:01:00 发布