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

📄 at25256.h

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 H
字号:
//*---------------------------------------------------------------------------
//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
//*---------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*---------------------------------------------------------------------------
//* File Name           : at25256.h
//* Object              : AT25256 SPI EEPROM Memory Description File
//* Translator          : ARM Software Development Toolkit V2.5
//*
//* 1.0 09/06/01 PF     : Creation
//*---------------------------------------------------------------------------

#ifndef at25256_h
#define at25256_h

/*--------------------*/
/* Command Definition */
/*--------------------*/

#define AT25_WREN_CMD           0x06        /* Set Write Enable Latch */
#define AT25_WRDI_CMD           0x04        /* Reset Write Enable Latch */
#define AT25_RDSR_CMD           0x05        /* Read Status Register */
#define AT25_WRSR_CMD           0x01        /* Write Status Register */
#define AT25_READ_CMD           0x03        /* Read Data from Memory Array */
#define AT25_WRITE_CMD          0x02        /* Write Data to Memory Array */

#define AT25_STATUS         0x00        /* Status Register */

/*-----------------*/
/* Size Definition */
/*-----------------*/
#define AT25256_SIZE        32768   /* 32,768x8 */

#define AT25_STATUS_MASK_READY      0x01        /* Status Register ready/busy mask */
#define AT25_BUSY                   0x1         /* RDY bit of SR = 0x1 */
#define AT25_READY                  0x0         /* RDY bit of SR = 0x0 */

#define AT25_STATUS_MASK_WREN       0x02        /* Status Register WREN mask */
#define AT25_WREN                   0x2         /* WEN of SR = 0x1 */


/* --------------------------------------- */
/* SPI Eeprom device Prototyping Functions */
/* --------------------------------------- */
extern u_int at25_open ( void ) ;
extern u_char at25_read_status ( void ) ;
extern u_int at25_wait_ready ( void ) ;

extern void at25_write_status_reg ( u_char status_reg_value ) ;
extern void at25_write_byte ( u_short address, u_char byte ) ;
extern void at25_write_page ( u_short address, u_int nb_bytes, u_char *buffer ) ;
extern void at25_read_byte ( u_short address, u_char *read_data ) ;
extern void at25_read_page ( u_short address, u_int nb_bytes, u_char *buffer ) ;


#endif /* at25256_h */

⌨️ 快捷键说明

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