flash_lib.h

来自「FreeScale imx21开发板Nand flash烧写程序」· C头文件 代码 · 共 74 行

H
74
字号
/*****************************************************************************
** flash_lib.h
**
** Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
**
** This file contains copyrighted material. Use of this file is
** restricted by the provisions of a Freescale Software License
** Agreement, which has either been electronically accepted by
** you or has been expressly executed between the parties.
**
** Description: Explanation for the usage of this file.
**
** Revision History:
** -----------------
*****************************************************************************/

/*!
 * @file flash_lib.h
 *
 * @brief the RAM Kernel flash library header file.
 *
 * @ingroup RAM Kernel
 */
#ifndef _FLASH_LIB_H_
#define _FLASH_LIB_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*****************************************************************************
* <Includes>
*****************************************************************************/

/*****************************************************************************
* <Macros>
*****************************************************************************/
#define FLASH_MODEL_MAX		128

/*****************************************************************************
* <Typedefs>
*****************************************************************************/
typedef enum 
{
	FLASH_PRG_BOUNDARY,
	FLASH_PRG_UNBOUNDARY,
} FLASH_PRG_MODE;

typedef enum 
{
	FILE_FORMAT_NORMAL,
	FILE_FORMAT_NB0
}FLASH_FILE_FORMAT;

/*!
 * flash library function declarations
 */
/* flash initial function */
extern s16 atk_flash_lib_initial(void);
/* flash erase with from addr to addr+size */
extern s16 atk_flash_lib_erase(u32 addr, u32 size);
/* flash read from addr with size of pcount, and put data into buffer */
extern s16 atk_flash_lib_read(u32 addr, u8 *buffer, u32 *pcount);
/* flash program function */
extern s16 atk_flash_lib_program(u32 addr, const u8 *buffer, 
		u32 *pcount, u16 *pcsum, u8 mode,u8 file_format);
extern void atk_flash_get_model(u8 *fmodel, u32 *len);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _FLASH_LIB_H_ */

⌨️ 快捷键说明

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