rt-thread/bsp/stm32_radio/spi_flash.h

27 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef SPI_FLASH_H_INCLUDED
#define SPI_FLASH_H_INCLUDED
/*
user for AT45DB161.
copy form : http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=737106
thanks to gxlujd.
*/
#define AT45DB_BUFFER_1_WRITE 0x84 /* 写入第一缓冲区 */
#define AT45DB_BUFFER_2_WRITE 0x87 /* 写入第二缓冲区 */
#define AT45DB_BUFFER_1_READ 0xD4 /* 读取第一缓冲区 */
#define AT45DB_BUFFER_2_READ 0xD6 /* 读取第二缓冲区 */
#define AT45DB_B1_TO_MM_PAGE_PROG_WITH_ERASE 0x83 /* 将第一缓冲区的数据写入主存储器(擦除模式)*/
#define AT45DB_B2_TO_MM_PAGE_PROG_WITH_ERASE 0x86 /* 将第二缓冲区的数据写入主存储器(擦除模式)*/
#define AT45DB_MM_PAGE_TO_B1_XFER 0x53 /* 将主存储器的指定页数据加载到第一缓冲区 */
#define AT45DB_MM_PAGE_TO_B2_XFER 0x55 /* 将主存储器的指定页数据加载到第二缓冲区 */
#define AT45DB_PAGE_ERASE 0x81 /* 页删除每页512/528字节 */
#define AT45DB_SECTOR_ERASE 0x7C /* 扇区擦除每扇区128K字节*/
#define AT45DB_READ_STATE_REGISTER 0xD7 /* 读取状态寄存器 */
#define AT45DB_MM_PAGE_READ 0xD2 /* 读取主储存器的指定页 */
#define AT45DB_MM_PAGE_PROG_THRU_BUFFER1 0x82 /* 通过缓冲区写入主储存器 */
extern void rt_hw_spi_flash_init(void);
#endif /* SPI_FLASH_H_INCLUDED */