📄 file.html
字号:
- Sector size is 512 bytes- 2 fats management- 512 entries in the root directory<HR><A NAME="fat_fputc"></A><H3> fat_fputc </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_fputc">fat_fputc</A> ( Byte d ) </PRE></TD></TABLE><P>Write one byte to file<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> d: data byte to writereturn:</PRE></TD></TABLE><H4> Note </H4><P>As this function is called very often it must be short and optimizedin execution time<HR><A NAME="fat_fputc"></A><H3> fat_fputc </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_fputc">fat_fputc</A> ( Byte d ) </PRE></TD></TABLE><P>Write one byte to file<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> d: data byte to writereturn:</PRE></TD></TABLE><H4> Note </H4><P>As this function is called very often it must be short and optimizedin execution time<HR><A NAME="fat_free_space"></A><H3> fat_free_space </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE><A HREF="#fat_st_free_space">fat_st_free_space</A> <A HREF="#fat_free_space">fat_free_space</A> ( void ) </PRE></TD></TABLE><P>Get free space<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> return: number of free cluster</PRE></TD></TABLE><H4> Note </H4><P><P><HR><A NAME="fat_fseek"></A><H3> fat_fseek </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_fseek">fat_fseek</A> ( Int32 offset ) </PRE></TD></TABLE><P>Change file pointer of an openned file<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> offset: relative signed seek offset in file*return: seek status: - OK: seek done - KO: out of file seek</PRE></TD></TABLE><H4> Note </H4><P>In read mode, seek is done with byte boundaryIn write mode, seek is done with sector boundary<HR><A NAME="fat_fseek"></A><H3> fat_fseek </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_fseek">fat_fseek</A> ( Int32 offset ) </PRE></TD></TABLE><P>Change file pointer of an openned file<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> offset: relative signed seek offset in file*return: seek status: - OK: seek done - KO: out of file seek</PRE></TD></TABLE><H4> Note </H4><P>In read mode, seek is done with byte boundaryIn write mode, seek is done with sector boundary<HR><A NAME="fat_fseek_abs"></A><H3> fat_fseek_abs </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_fseek_abs">fat_fseek_abs</A> ( Uint32 offset ) </PRE></TD></TABLE><P>Move ahead file read pointer of an openned file<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> offset: absolute seek offset in file*return:</PRE></TD></TABLE><HR><A NAME="fat_fseek_abs"></A><H3> fat_fseek_abs </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_fseek_abs">fat_fseek_abs</A> ( Uint32 offset ) </PRE></TD></TABLE><P>Move ahead file read pointer of an openned file<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> offset: absolute seek offset in file*return:</PRE></TD></TABLE><HR><A NAME="fat_get_clusters"></A><H3> fat_get_clusters </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_get_clusters">fat_get_clusters</A> ( <A HREF="#fat_st_clust_chain">fat_st_clust_chain</A> xdata * chain , Byte nb_frag ) </PRE></TD></TABLE><P>Prepare a list of the file clusters:chain[n].cluster contains the starting cluster number of a fragmentchain[n].number contains the number of contiguous clusters in fragment<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> chain: allocation list address nb_frag: maximum number of fragment *return: - OK: allocation done - KO: allocation done but truncated: file too much fragmented</PRE></TD></TABLE><H4> Note </H4><P>File cluster list is limited by the nb_frag parameter.If memory is too much fragmented, file may not be fully played.Last list item always has single cluster<HR><A NAME="fat_get_clusters"></A><H3> fat_get_clusters </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_get_clusters">fat_get_clusters</A> ( <A HREF="#fat_st_clust_chain">fat_st_clust_chain</A> xdata * chain , Byte nb_frag ) </PRE></TD></TABLE><P>Prepare a list of the file clusters:chain[n].cluster contains the starting cluster number of a fragmentchain[n].number contains the number of contiguous clusters in fragment<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> chain: allocation list address nb_frag: maximum number of fragment *return: - OK: allocation done - KO: allocation done but truncated: file too much fragmented</PRE></TD></TABLE><H4> Note </H4><P>File cluster list is limited by the nb_frag parameter.If memory is too much fragmented, file may not be fully played.Last list item always has single cluster<HR><A NAME="fat_get_dir_entry"></A><H3> fat_get_dir_entry </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_get_dir_entry">fat_get_dir_entry</A> ( <A HREF="#fat_st_dir_entry">fat_st_dir_entry</A> xdata * entry ) </PRE></TD></TABLE><P>Get from directory all information about a directory or file entry<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> entry: directory entry structure*return:</PRE></TD></TABLE><H4> Note </H4><P>This function reads directly datas from sectorsIt automaticaly computes difference between LFN and normal entries<HR><A NAME="fat_get_dir_file_list"></A><H3> fat_get_dir_file_list </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_get_dir_file_list">fat_get_dir_file_list</A> ( Byte id ) </PRE></TD></TABLE><P>Give information about the directory :- total number of entries- number of deleted entries- number of filtered entries (filter is done by checking id value)- total number of clusters used by the directory<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> id: file extension to select*return:</PRE></TD></TABLE><H4> Example </H4><PRE></PRE><H4> Note </H4><P><P><HR><A NAME="fat_get_dir_file_list"></A><H3> fat_get_dir_file_list </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>void <A HREF="#fat_get_dir_file_list">fat_get_dir_file_list</A> ( Byte id ) </PRE></TD></TABLE><P>Give information about the directory :- total number of entries- number of deleted entries- number of filtered entries (filter is done by checking id value)- total number of clusters used by the directory<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> id: file extension to select*return:</PRE></TD></TABLE><H4> Example </H4><PRE></PRE><H4> Note </H4><P><P><HR><A NAME="fat_get_free_clusters"></A><H3> fat_get_free_clusters </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_get_free_clusters">fat_get_free_clusters</A> ( bit init ) </PRE></TD></TABLE><P>Prepare a list of the free clusters:chain[n].cluster contains the starting cluster number of a fragmentchain[n].number contains the number of contiguous clusters in fragment<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>*return: - OK: allocation done - KO: allocation cannot be done : no free cluster</PRE></TD></TABLE><H4> Note </H4><P>Free cluster list is limited by the nb_frag parameter.If memory is too much fragmented, created file may be limited in size.Last list item always has single cluster<HR><A NAME="fat_get_name"></A><H3> fat_get_name </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>char pdata * <A HREF="#fat_get_name">fat_get_name</A> ( void ) </PRE></TD></TABLE><P>Return the address of the file name string<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>*return:</PRE></TD></TABLE><HR><A NAME="fat_get_name"></A><H3> fat_get_name </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>char pdata * <A HREF="#fat_get_name">fat_get_name</A> ( void ) </PRE></TD></TABLE><P>Return the address of the file name string<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>*return:</PRE></TD></TABLE><HR><A NAME="fat_get_root_directory"></A><H3> fat_get_root_directory </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_get_root_directory">fat_get_root_directory</A> ( Byte id ) </PRE></TD></TABLE><P>Select first available file/dir in root diretory<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> id: file extension to select*return: - OK: file available - KO: no requested file found - KO: low_level memory error</PRE></TD></TABLE><H4> Note </H4><P>Fill all the cache information for the first time<HR><A NAME="fat_get_root_directory"></A><H3> fat_get_root_directory </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_get_root_directory">fat_get_root_directory</A> ( Byte id ) </PRE></TD></TABLE><P>Select first available file/dir in root diretory<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> id: file extension to select*return: - OK: file available - KO: no requested file found - KO: low_level memory error</PRE></TD></TABLE><H4> Note </H4><P>Fill all the cache information for the first time<HR><A NAME="fat_goto_next"></A><H3> fat_goto_next </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_goto_next">fat_goto_next</A> ( void ) </PRE></TD></TABLE><P>Fetch the next dir/file info in cache<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>*return: - OK: next file available - KO: last file reached - KO: low_level memory error</PRE></TD></TABLE><HR><A NAME="fat_goto_next"></A><H3> fat_goto_next </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_goto_next">fat_goto_next</A> ( void ) </PRE></TD></TABLE><P>Fetch the next dir/file info in cache<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>*return: - OK: next file available - KO: last file reached - KO: low_level memory error</PRE></TD></TABLE><HR><A NAME="fat_goto_parentdir"></A><H3> fat_goto_parentdir </H3><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#D6E8FF" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE>bit <A HREF="#fat_goto_parentdir">fat_goto_parentdir</A> ( Byte id ) </PRE></TD></TABLE><P>Go to the parent directory<P><TABLE BORDER="0" WIDTH="100 %" BGCOLOR="#FFD0D0" CELLPADDING="6"><TR> <TD VALIGN=MIDDLE><PRE> id: file extension to select*return:</PRE></TD></TABLE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -