at45db161.h

来自「at45db161b SPI 接口FLASH ROM驱动,已经在ADS下调试通过」· C头文件 代码 · 共 188 行

H
188
字号
/**--------------文件信息--------------------------------------------------------------------------------
**文   件   名: at45db161.c
**创   建   人: winfeng
**最后修改日期: 2005年7月4日
**描     述: 存储器驱动程序
**         
**--------------历史版本信息----------------------------------------------------------------------------
** 创建人: winfeng
** 版 本: v1.0
** 日 期: 2005年7月4日
** 描 述: 原始版本
**
**--------------当前版本修订------------------------------------------------------------------------------
** 修改人: 
** 日 期: 
** 描 述: 
**
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#define READ_CNT 10000

#define SPICE0 ((uint32)1<<7)     //P0.7
#define SPICE1 ((uint32)1<<25)     //P1.25 

#ifndef IN_AT45DB161
extern uint8 page_read(uint16 page,uint16 paddr,uint16 number,uint8 *dp);
/*********************************************************************************************************
** Function name:         InitialiseSPI
**
** Descriptions:         Initialize the SPI
**
** input parameters:     速率分频值
** Returned value:         1 OK 0 NOT OK
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern   uint8 InitialiseSPI(uint8 Fdiv);
    /*********************************************************************************************************
** Function name:         status_read
**
** Descriptions:         status read AT45DB161
**
** input parameters:     none
** Returned value:         状态字
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern   uint8 status_read(void);
/*********************************************************************************************************
** Function name:         page_erase
**
** Descriptions:         页擦除
**
** input parameters:     uint16 page :页编号 
** Returned value:         0 失败 1 成功
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 page_erase(uint16 page);
/*********************************************************************************************************
** Function name:         block_erase
**
** Descriptions:         块擦除
**
** input parameters:     uint16 block :块编号
** Returned value:         0 失败 1 成功
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint8 flash_block_erase(uint16 block);
/*********************************************************************************************************
** Function name:         flash_page_write
**
** Descriptions:         port funtion flash_page_write
**
** input parameters:     page:扇区编号 dp :源数据指针 num:数据个数
                  
** Returned value:         0 失败 1 成功
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/08/23
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern   uint8   flash_page_write(uint16 page,uint16 num,uint8 * dp);
/*********************************************************************************************************
** Function name:         page_erase
**
** Descriptions:         页擦除
**
** input parameters:     uint16 page :页编号 
** Returned value:         0 失败 1 成功
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern   uint8 flash_page_erase(uint16 page);
/*********************************************************************************************************
** Function name:         flash_read
**
** Descriptions:         port funtion flash_read
**
** input parameters:     uint32 addr: flash addr uint16 number:欲读数据个数
                  uint8 *dp:目的数据指针
** Returned value:         0 失败 1 成功
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/

extern void flash_read(uint32 addr,uint16 number,uint8 *dp);
/*********************************************************************************************************
** Function name:         flash_write
**
** Descriptions:         port funtion flash_write
**
** input parameters:     uint32 addr: flash addr uint16 number:欲读数据个数
                  uint8 *sp:源数据指针
** Returned value:         0 失败 1 成功
**       
** Used global variables:   None
** Calling modules:         None
**
** Created by:           winfeng
** Created Date:         2005/07/12
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void flash_write(uint32 addr,uint16 number,uint8 *sp);
#endif
/**************************************************************************************
*******************   end of file********************************************************
***************************************************************************************/
/********************/ 

⌨️ 快捷键说明

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