?? zlg_ffs.h
字號:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: ZLG_FFS.h
** Last modified Date: 2004-09-17
** Last Version: 1.0
** Descriptions: header file of the specific codes for LPC2200 target boards
** Every project should include a copy of this file, user may modify it as needed
**------------------------------------------------------------------------------------------------------
** Created by: Chenmingji
** Created date: 2004-02-02
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#ifndef __ZLG_FFS_H
#define __ZLG_FFS_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _FLASH_DRIVER
{
uint16 BytsPerSec; /* 每扇區字節數 */
uint16 SecsPreBlock; /* 每塊扇區數 */
uint32 SecPreDisk; /* 扇區總數 */
uint32 BlockPreDisk; /* 塊總數 */
uint8 *BufA; /* 臨時緩沖區 */
void *Index; /* 低層驅動所需參數的存儲位置 */
uint8 (* SectorRead)(void *Index, void *Buf, uint32 SecIndex); /* 讀扇區數據 */
uint8 (* ExSectorRead)(void *Index, void *Buf, uint32 SecIndex); /* 讀扇區擴展數據 */
uint8 (* SectorWrite)(void *Index, void *Buf, uint32 SecIndex); /* 寫扇區數據 */
uint8 (* ExSectorWrite)(void *Index, void *Buf, uint32 SecIndex); /* 寫扇區擴展數據 */
uint8 (* BlockErase)(void *Index, uint32 SecIndex); /* 塊擦除 */
// uint8 (* SecCopy)(void *Index, uint32 SourSecIndex, uint32 DestSecIndex); /* 扇區拷貝 */
uint8 (* BlockCheck)(void *Index, uint32 BlockIndex); /* 初始有效扇區檢測 */
uint8 (* SectorCheck)(void *Index, void *Buf, uint32 SecIndex); /* 讀扇區數據 */
uint8 (* ExSectorCheck)(void *Index, void *Buf, uint32 SecIndex); /* 讀扇區擴展數據 */
}FlashDriver;
typedef struct _FFS_DISK
{
const FlashDriver *Drive; /* 底層驅動信息 */
uint32 BlockSum; /* 有效塊數 */
uint32 *VBlockInfo; /* 邏輯塊到物理塊的映射表 */
uint32 *BlockEaseSum; /* 物理塊擦除計數 */
uint8 *BlockState; /* 物理塊狀態 */
}FFSDisk;
#ifdef IN_ZLG_FFS
#endif
#ifndef IN_ZLG_FFS
extern uint16 ZLG_FFS(uint8 Cammand, void *Parameter);
/*********************************************************************************************************
** 函數名稱: ZLG_FFS
** 功能描述: nand flash在ZLG/FS中的驅動
**
** 輸 入: Cammand:define DISK_INIT: 初始化,必須實現
** define DISK_CLOSE: 關閉,必須實現
** define DISK_READ_SECTOR: 讀扇區,必須實現
** define DISK_WRITE_SECTOR: 寫扇區,必須實現
** define DISK_DRIVER_VER: 查看驅動程序接口版本號,必須實現
** define DISK_CHECK_CMD: 查看命令是否實現,必須實現
** define DISK_LOW_FORMAT: 低級格式化,可選命令
** define DISK_FREE_SECTOR: 釋放扇區,可選命令
** define DISK_GET_SECTOR_NUMBER: 獲得設備總扇區數,可選命令
** define DISK_GET_BYTES_PER_SECTOR: 獲得每扇區字節數,可選命令
** define DISK_CHECK_CHANGE: 查看介質是否改變,可選命令
** define DISK_GET_SECTORS_PER_BLOCK:獲取每塊扇區數,可選命令
** define DISK_READ_BLOCK: 讀數據塊,可選命令
** define DISK_WRITE_BLOCK: 寫數據塊,可選命令
** Parameter: 剩余參數,其中Parameter->RsvdForLow用于存儲驅動程序支持的物理設備相關信息,
** 如使用的資源等。使用它可以使一個驅動支持多個物理設備。
** 輸 出: DISK_READ_OK: 讀扇區完成
** DISK_READ_NOT_OK: 讀扇區失敗
** DISK_WRITE_OK: 寫扇區完成
** DISK_WRITE_NOT_OK: 寫扇區失敗
** DISK_INIT_OK: 初始化完成
** DISK_INIT_NOT_OK: 初始化失敗
** DISK_FALSE: 真
** DISK_TRUE: 假
** BAD_DISK_COMMAND: 無效的命令
********************************************************************************************************/
#endif
#ifdef __cplusplus
}
#endif
#endif
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -