📄 rwsec.h
字号:
/*******************************************************************************
(C) Copyright 2006, RAE Systems Inc. All rights reserved
----------------- File Information ---------------------------------------------
File Name: RWSEC.H
Last Modify Date: 9/19/2006
Discription: Cache management header file
---------------- Important Notes -----------------------------------------------
----------------- Rivision History ---------------------------------------------
Version: V1.00
Last Modify Date: 9/17/2006
Discription: Initial version, imported from ZLG_FS V1.00, derived from FAT.H
*******************************************************************************/
#ifndef __RWSEC_H__
#define __RWSEC_H__
#ifndef DISK_CACHE_SIZE
// Cache size(byte), should be the maximum sector bytes
#define DISK_CACHE_SIZE 512
#endif
#ifndef MAX_DISK_CACHES
#define MAX_DISK_CACHES 2 // Cache number
#endif
/* Cache flags definition */
#define CACHE_READED 0x02
#define CACHE_WRITED 0x01
/* File system cache data structure */
typedef struct _Disk_Cache
{
INT8U Drive; // Logical disk number
INT8U Flag; // Flags
INT16U RW_ID; // Write/Read ID, used for cache release
// INT8U Lock; // Lock sector?
INT32U SecIndex; // Sector index of cached
INT8U buf[DISK_CACHE_SIZE]; // Buffer
} Disk_cache;
extern Disk_cache DiskCache[MAX_DISK_CACHES]; /* Disk cache */
extern void CacheInit(void);
extern void CloseSec(INT8U Drive, INT32U Index);
extern void CacheWriteBack2(INT16U Index);
extern void CacheWriteBack(INT8U Drive, INT32U Index);
extern void AllCacheWriteBack(void);
extern INT16U GetCache(void);
extern INT8U *OpenSec(INT8U Drive, INT32U Index);
extern INT8U ReadSec(INT8U Drive, INT32U Index);
extern void WriteSec(INT8U Drive, INT32U Index);
#endif /* #ifndef __RWSEC_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -