xref: /third_party/FatFs/documents/doc/sfatfs.html (revision e6865dcd)
1e6865dcdSopenharmony_ci<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2e6865dcdSopenharmony_ci<html lang="en">
3e6865dcdSopenharmony_ci<head>
4e6865dcdSopenharmony_ci<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5e6865dcdSopenharmony_ci<meta http-equiv="Content-Style-Type" content="text/css">
6e6865dcdSopenharmony_ci<link rel="up" title="FatFs" href="../00index_e.html">
7e6865dcdSopenharmony_ci<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfatfs.html">
8e6865dcdSopenharmony_ci<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
9e6865dcdSopenharmony_ci<title>FatFs - FATFS</title>
10e6865dcdSopenharmony_ci</head>
11e6865dcdSopenharmony_ci
12e6865dcdSopenharmony_ci<body>
13e6865dcdSopenharmony_ci
14e6865dcdSopenharmony_ci<div class="para">
15e6865dcdSopenharmony_ci<h2>FATFS</h2>
16e6865dcdSopenharmony_ci<p>The <tt>FATFS</tt> structure (filesystem 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 of the structure is done by volume mount process whenever necessary. Application program <em>must not</em> modify any member in this structure, or the FAT volume will be collapsed.</p>
17e6865dcdSopenharmony_ci<pre>
18e6865dcdSopenharmony_ci<span class="k">typedef</span> <span class="k">struct</span> {
19e6865dcdSopenharmony_ci    BYTE    fs_type;      <span class="c">/* FAT type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */</span>
20e6865dcdSopenharmony_ci    BYTE    pdrv;         <span class="c">/* Hosting physical drive of this volume */</span>
21e6865dcdSopenharmony_ci    BYTE    n_fats;       <span class="c">/* Number of FAT copies (1,2) */</span>
22e6865dcdSopenharmony_ci    BYTE    wflag;        <span class="c">/* win[] flag (b0:win[] is dirty) */</span>
23e6865dcdSopenharmony_ci    BYTE    fsi_flag;     <span class="c">/* FSINFO flags (b7:Disabled, b0:Dirty) */</span>
24e6865dcdSopenharmony_ci    WORD    id;           <span class="c">/* Volume mount ID */</span>
25e6865dcdSopenharmony_ci    WORD    n_rootdir;    <span class="c">/* Number of root directory entries (FAT12/16) */</span>
26e6865dcdSopenharmony_ci    WORD    csize;        <span class="c">/* Sectors per cluster */</span>
27e6865dcdSopenharmony_ci<span class="k">#if</span> FF_MAX_SS != FF_MIN_SS
28e6865dcdSopenharmony_ci    WORD    ssize;        <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
29e6865dcdSopenharmony_ci<span class="k">#endif</span>
30e6865dcdSopenharmony_ci<span class="k">#if</span> FF_FS_EXFAT
31e6865dcdSopenharmony_ci    BYTE*   dirbuf;       <span class="c">/* Directory entry block scratchpad buffer */</span>
32e6865dcdSopenharmony_ci<span class="k">#endif</span>
33e6865dcdSopenharmony_ci<span class="k">#if</span> FF_FS_REENTRANT
34e6865dcdSopenharmony_ci    FF_SYNC_t sobj;       <span class="c">/* Identifier of sync object */</span>
35e6865dcdSopenharmony_ci<span class="k">#endif</span>
36e6865dcdSopenharmony_ci<span class="k">#if</span> !FF_FS_READONLY
37e6865dcdSopenharmony_ci    DWORD   last_clust;   <span class="c">/* FSINFO: Last allocated cluster (0xFFFFFFFF if invalid) */</span>
38e6865dcdSopenharmony_ci    DWORD   free_clust;   <span class="c">/* FSINFO: Number of free clusters (0xFFFFFFFF if invalid) */</span>
39e6865dcdSopenharmony_ci<span class="k">#endif</span>
40e6865dcdSopenharmony_ci<span class="k">#if</span> FF_FS_RPATH
41e6865dcdSopenharmony_ci    DWORD   cdir;         <span class="c">/* Cluster number of current directory (0:root) */</span>
42e6865dcdSopenharmony_ci<span class="k">#if</span> FF_FS_EXFAT
43e6865dcdSopenharmony_ci    DWORD   cdc_scl;      <span class="c">/* Containing directory start cluster (invalid when cdir is 0) */</span>
44e6865dcdSopenharmony_ci    DWORD   cdc_size;     <span class="c">/* b31-b8:Size of containing directory, b7-b0: Chain status */</span>
45e6865dcdSopenharmony_ci    DWORD   cdc_ofs;      <span class="c">/* Offset in the containing directory (invalid when cdir is 0) */</span>
46e6865dcdSopenharmony_ci<span class="k">#endif</span>
47e6865dcdSopenharmony_ci<span class="k">#endif</span>
48e6865dcdSopenharmony_ci    DWORD   n_fatent;     <span class="c">/* Number of FAT entries (Number of clusters + 2) */</span>
49e6865dcdSopenharmony_ci    DWORD   fsize;        <span class="c">/* Sectors per FAT */</span>
50e6865dcdSopenharmony_ci    LBA_t   volbase;      <span class="c">/* Volume base LBA */</span>
51e6865dcdSopenharmony_ci    LBA_t   fatbase;      <span class="c">/* FAT base LBA */</span>
52e6865dcdSopenharmony_ci    LBA_t   dirbase;      <span class="c">/* Root directory base (LBA|Cluster) */</span>
53e6865dcdSopenharmony_ci    LBA_t   database;     <span class="c">/* Data base LBA */</span>
54e6865dcdSopenharmony_ci    LBA_t   winsect;      <span class="c">/* Sector LBA appearing in the win[] */</span>
55e6865dcdSopenharmony_ci    BYTE    win[FF_MAX_SS]; <span class="c">/* Disk access window for directory, FAT (and file data at tiny cfg) */</span>
56e6865dcdSopenharmony_ci} FATFS;
57e6865dcdSopenharmony_ci</pre>
58e6865dcdSopenharmony_ci</div>
59e6865dcdSopenharmony_ci
60e6865dcdSopenharmony_ci<p class="foot"><a href="../00index_e.html">Return</a></p>
61e6865dcdSopenharmony_ci</body>
62e6865dcdSopenharmony_ci</html>
63