⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wosfs.h

📁 一款基于FPGA的对于VGA实现全彩控制的程序
💻 H
字号:
// file: wosfs.h
//
// the WAY Oversimplified Filing System
//
// 2000 September 8
//
// An even more simplified file system code
// than 
//
// Proposed API for storage subsystem.
//Comments solicited.
//
// These are the API call for an overly simple
// filing system, which should be sufficient for
// our MP3 demonstration.
// 
// All routines return an int, which is 0 for
// success and <0 for failure.
// 
// It is presumed that there is exactly
// one OSFS on a computer.
// 
// The file system supports a single
// directory with named, byte-oriented
// files, and a "write-once-read-many" model.
// (That is, bytes can only be added to the
// very end of the very last file.)
// 
// ==================

#include "nios.h"
// |
// | Define range of flash memory to be
// | treated as the file system. You can
// | override this with a compile-time -D option.
// |

#ifndef nk_wosfs_flash_begin
	#define nk_wosfs_flash_begin (nasys_main_flash + 0x400000)
#endif

#ifndef nk_wosfs_flash_end
	#define nk_wosfs_flash_end (nasys_main_flash + 0x600000)
#endif

#define nk_wosfs_file_name_size 32
#define nk_wosfs_signature ((long) 0x89674523)

typedef struct
	{
	long signature;
	long file_count;
	} ns_wosfs_volume_header;

typedef struct
	{
	char name[nk_wosfs_file_name_size];
	long location;
	long file_length;
	} ns_wosfs_directory_entry;

long nr_wosfst_get_file_count(void);
void nr_wosfs_get_directory_entry(long file_index,ns_wosfs_directory_entry *de_out);
long nr_wosfs_get_directory_entry_by_name(char *file_name,ns_wosfs_directory_entry *de_out);
void nr_wosfs_read(long file_index,long offset,long length,void *data_out);
int nr_wosfs_string_match(char *a, char *b); // return 1 if match


⌨️ 快捷键说明

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