sfatfs.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <meta http-equiv="Content-Style-Type" content="text/css">
  6. <link rel="up" title="FatFs" href="../00index_e.html">
  7. <link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfatfs.html">
  8. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  9. <title>FatFs - FATFS</title>
  10. </head>
  11. <body>
  12. <div class="para">
  13. <h2>FATFS</h2>
  14. <p>The <tt>FATFS</tt> structure (file system object) holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with <tt>f_mount</tt> function. Initialization is done on first API call after <tt>f_mount</tt> function or media change. Application program must not modify any member in this structure, or any data on the FAT volume can be collapsed.</p>
  15. <pre>
  16. <span class="k">typedef</span> <span class="k">struct</span> {
  17. BYTE fs_type; <span class="c">/* File system type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */</span>
  18. BYTE drv; <span class="c">/* Physical drive number */</span>
  19. BYTE n_fats; <span class="c">/* Number of FAT copies (1,2) */</span>
  20. BYTE wflag; <span class="c">/* win[] flag (b0:win[] is dirty) */</span>
  21. BYTE fsi_flag; <span class="c">/* FSINFO flags (b7:Disabled, b0:Dirty) */</span>
  22. WORD id; <span class="c">/* File system mount ID */</span>
  23. WORD n_rootdir; <span class="c">/* Number of root directory entries (FAT12/16) */</span>
  24. WORD csize; <span class="c">/* Sectors per cluster */</span>
  25. <span class="k">#if</span> _MAX_SS != _MIN_SS
  26. WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
  27. <span class="k">#endif</span>
  28. <span class="k">#if _FS_EXFAT</span>
  29. BYTE* dirbuf; <span class="c">/* Directory entry block scratchpad buffer */</span>
  30. <span class="k">#endif</span>
  31. <span class="k">#if</span> _FS_REENTRANT
  32. _SYNC_t sobj; <span class="c">/* Identifier of sync object */</span>
  33. <span class="k">#endif</span>
  34. <span class="k">#if</span> !_FS_READONLY
  35. DWORD last_clust; <span class="c">/* FSINFO: Last allocated cluster (0xFFFFFFFF if invalid) */</span>
  36. DWORD free_clust; <span class="c">/* FSINFO: Number of free clusters (0xFFFFFFFF if invalid) */</span>
  37. <span class="k">#endif</span>
  38. <span class="k">#if</span> _FS_RPATH
  39. DWORD cdir; <span class="c">/* Cluster number of current directory (0:root) */</span>
  40. <span class="k">#if _FS_EXFAT</span>
  41. DWORD cdc_scl; <span class="c">/* Containing directory start cluster (invalid when cdir is 0) */</span>
  42. DWORD cdc_size; <span class="c">/* b31-b8:Size of containing directory, b7-b0: Chain status */</span>
  43. DWORD cdc_ofs; <span class="c">/* Offset in the containing directory (invalid when cdir is 0) */</span>
  44. <span class="k">#endif</span>
  45. <span class="k">#endif</span>
  46. DWORD n_fatent; <span class="c">/* Number of FAT entries (Number of clusters + 2) */</span>
  47. DWORD fsize; <span class="c">/* Sectors per FAT */</span>
  48. DWORD volbase; <span class="c">/* Volume base LBA */</span>
  49. DWORD fatbase; <span class="c">/* FAT base LBA */</span>
  50. DWORD dirbase; <span class="c">/* Root directory base (LBA|Cluster) */</span>
  51. DWORD database; <span class="c">/* Data base LBA */</span>
  52. DWORD winsect; <span class="c">/* Sector LBA appearing in the win[] */</span>
  53. BYTE win[_MAX_SS]; <span class="c">/* Disk access window for directory, FAT (and file data at tiny cfg) */</span>
  54. } FATFS;
  55. </pre>
  56. </div>
  57. <p class="foot"><a href="../00index_e.html">Return</a></p>
  58. </body>
  59. </html>