file_sect_server.h

来自「能够在单片机等小型处理器上使用的fat16文件系统」· C头文件 代码 · 共 47 行

H
47
字号
#ifndef _SECT_SERVER_H
#define _SECT_SERVER_H
#include"file_header.h"
//#include"init.h"
#define PHYSICAL_BLOCK_SIZE     512 
// This small bootrecord will be in memory as long as the program is running
typedef struct 
{
	uchar valid;
	uchar fat_copies;
	uint root_directory_entries;
	uint number_of_sectors;
	uint sectors_per_fat;
	ulong total_sectors;
	uint reserved_sectors;
	uint hidden_sectors;
	uchar sectors_per_cluster;
} bootrecord_small;

// This is a global 512-byte buffer. 
// Sect_Read() puts data in this buffer.
// Sect_Write() gets data from this buffer.
extern char Scratch[];
// File space
//extern char *VFILE;
// Permanent copy of important fields from bootrecord:
extern bootrecord_small MBR;
#define Sect_Block_Size() ((unsigned)PHYSICAL_BLOCK_SIZE)


unsigned int Sect_Read(unsigned long sector);
void Sect_Write(unsigned long sector);
void Sect_Validate(void);
void Sect_Init(void);
unsigned Sect_Root_Dir(void) ;
unsigned Sect_Root_Dir_Last(void);
unsigned Sect_File_Data(void);
unsigned Sect_Fat1(void);
unsigned Sect_Fat2(void);
void Sect_Write_Multi_Fat(unsigned long sector);
unsigned long Sect_Sectors(void);
unsigned long Sect_Sectors(void);

#endif


⌨️ 快捷键说明

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