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

📄 fat_h.h

📁 用at91sam7s64+ucos写的mp3播放程序
💻 H
字号:
/*
************************************************************************
Module:  	   music_cntl.h                                    
Description:   function declaration and macro define
			    
History:                                                      
			   1.0    2004.9.20     Chanjl Create the Module
			   

copyright   (C)  Wuxi Intech Technology Co, .Ltd., 2005
************************************************************************
*/
#ifndef _FAT_H_H__
#define _FAT_H_H__

#include "type.h"
#include "fat.h"


#ifdef  FAT_GLOBAL
	#define FAT_EXN 
#else
	#define FAT_EXN extern
#endif



FAT_EXN INT16U	gl_sector_size;
FAT_EXN Uint32  fat_ptr_fats;
FAT_EXN Uint32  fat_ptr_rdir; 
FAT_EXN Uint32  fat_ptr_data; 
FAT_EXN Byte    fat_cluster_size; 
FAT_EXN Uint16  fat_sector_size;
FAT_EXN Uint16  fat_root_entries;

FAT_EXN Byte    fat_type_id;
FAT_EXN Byte    fat_2_is_present;
FAT_EXN Uint32  fat32_root_cluster;
FAT_EXN Uint32  fat_count_of_clusters;
FAT_EXN Uint32  fat_fat_size;
FAT_EXN Uint16  fat_max_cluster_number;

//FAT_EXN Uint32  fat32_root_cluster;
 
FAT_EXN Uint32    fat_global_id;
FAT_EXN Byte    fat_nb_clust;
FAT_EXN Byte    dir_is_root;
FAT_EXN Byte    fat_open_mode;
FAT_EXN Byte    flag_end_disk_file;
FAT_EXN Union32 fat_file_size;
FAT_EXN Uint32  fat_dclust_byte_count;/* byte counter in directory sector */
FAT_EXN Uint16  fat_dchain_index;     /* the number of the fragment of the dir, in fact
                                            the index of the table in the cluster chain */
FAT_EXN Byte    fat_dchain_nb_clust;  /* the offset of the cluster from 
											the first cluster of the dir fragment */
FAT_EXN Uint16  fat_dir_list_index;   /* index of current entry in dir list */
FAT_EXN Uint16  fat_dir_list_last;    /* index of last entry in dir list */
FAT_EXN Uint16  fat_dir_all_count;    /* count of all entry in dir */
FAT_EXN Uint32  fat_dir_current_sect; /* sector of selected entry in dir list */
FAT_EXN Uint32  fat_dir_current_offs; /* entry offset from fat_dir_current_sect */
FAT_EXN char    ext[3];                 /* file extension (limited to 3 characters) */
FAT_EXN Byte    fat_last_clust_index; /* index of the last cluster in file chain */
FAT_EXN Byte    fat_last_dir_clust;
FAT_EXN Uint32  fat_fclust_byte_count;/* byte counter in file cluster */
FAT_EXN Byte    fat_fchain_index;
FAT_EXN Byte    fat_fchain_nb_clust;
FAT_EXN Uint32  fat_current_file_size;   /*  number of bytes to seek in one cluster */
FAT_EXN Uint32  fat_dir_sector_offset;
FAT_EXN Uint16  fat_sector_flag; 
FAT_EXN Byte    fat_no_file  ;    /* flag of have no file/dir in current directory */
FAT_EXN Byte    fat_close_flag;
FAT_EXN Uint32  fat_spare_size;
FAT_EXN Uint16  fat_buf_count;
FAT_EXN Union16 fat_sector_count;
FAT_EXN Uint32  fat32_write_open_count;
FAT_EXN Byte    lfn_name[130];
FAT_EXN fat_st_clust_chain     fclusters[MAX_FILE_FRAGMENT_NUMBER];
FAT_EXN fat_st_clust_chain     dclusters[MAX_DIR_FRAGMENT_NUMBER];
FAT_EXN fat_st_cache   fat_cache;     /* The cache structure, see the .h for more info */

//in fat_top var
FAT_EXN fat_st_info   	fat_fsave[MAX_SUBDIR_DEPTH];
FAT_EXN Byte    		fat_fsave_index;
FAT_EXN Byte    		fat_fsave_type;
FAT_EXN Uint32  		fat32_rpt_start_byte_count;
FAT_EXN Uint32  		fat32_rpt_end_byte_count;
FAT_EXN Byte            fat_fsave_read_handle;



/******************************************************************************
* PURPOSE : 
* FAT fs functions
******************************************************************************/
FAT_EXN  Byte           fat_initialize (void);
FAT_EXN  void           fat_goto_rootdir(void);
FAT_EXN  Byte           fat_get_dir(Uint32);
FAT_EXN  Byte           fat_goto_next (void);
FAT_EXN  Byte           fat_goto_prev (void);
FAT_EXN  Byte           fat_goto_last (void);
FAT_EXN  Byte           fat_goto_first (void);
FAT_EXN  Byte           fat_goto_parentdir (void);
FAT_EXN  Byte           fat_goto_subdir (void);
	
FAT_EXN  Byte           fat_dirdelete (void);
FAT_EXN  Byte           fat_dircreate(char chDirName[11]);
	
FAT_EXN  Byte           fat_fopen (byte);
FAT_EXN  void           fat_fclose (void);
FAT_EXN  Byte           fat_fcreate (Uint32);
FAT_EXN  void           fat_fdelete (void);      
FAT_EXN  Byte           fat_feof (void);
FAT_EXN  void           fat_format(void);
FAT_EXN  void           fat_fgetsector(void);
FAT_EXN  Byte           fat_fputsector(void);
	
FAT_EXN  Uint32         fat_check_ext (void);
	
FAT_EXN  void           fat_fseek_abs (Uint32);
FAT_EXN  void 		    fat_account_spare_size(void) ;

//in fat_top
FAT_EXN  byte 			fat_search_file(Uint16 index);
FAT_EXN  byte 			fat_search_save_file(void);
FAT_EXN  void 			fat_save_file_info(byte selMode);
	
	
	/* system call */
FAT_EXN  Byte           fat_dir_seek (Uint32);
FAT_EXN  void           fat_get_dir_entry (fat_st_dir_entry  *);
FAT_EXN  byte           fat_get_clusters (fat_st_clust_chain  *, Byte);
FAT_EXN  byte           fat_set_clusters (fat_st_clust_chain  *, Byte);
FAT_EXN  void           fat_scan_dir(Byte);
FAT_EXN  Byte           fat_create_file_name(void);
FAT_EXN  void           fat_dgetsector (void);
FAT_EXN  Byte           fat_create_entry(Uint32);
FAT_EXN  void           fat_update_fats(Byte,fat_st_clust_chain  *);
FAT_EXN  void           fat_dir_update_fats(Byte,fat_st_clust_chain  *);
FAT_EXN  void           fat_wr_fat(void);
FAT_EXN  void           fat_fgetsector (void);  
FAT_EXN  void           fat_phy_fats(fat_st_clust_chain  *, Uint16, byte);     
FAT_EXN  void           fat12_phy_fats(fat_st_clust_chain  *, Uint16, byte);
FAT_EXN  void           fat16_phy_fats(fat_st_clust_chain  *, Uint16, byte);
FAT_EXN  void           fat32_phy_fats(fat_st_clust_chain  *, Uint16, byte);
FAT_EXN  void           fat_phy_del(void);
FAT_EXN  void           fat_read_sector( Uint32 );
FAT_EXN  void           fat_write_sector( Uint32 );  


FAT_EXN  byte           fat_seek_lrc(uchar *pByBuffer);

#endif

⌨️ 快捷键说明

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