SdFat
|
FAT file structures. More...
Classes | |
struct | biosParmBlock |
BIOS parameter block. More... | |
struct | directoryEntry |
FAT short directory entry. More... | |
struct | fat32_boot |
Boot sector for a FAT32 volume. More... | |
struct | fat32_fsinfo |
FSINFO sector for a FAT32 volume. More... | |
struct | fat_boot |
Boot sector for a FAT12/FAT16 volume. More... | |
struct | longDirectoryEntry |
FAT long directory entry. More... | |
struct | masterBootRecord |
Master Boot Record. More... | |
struct | partitionTable |
MBR partition table entry. More... | |
Typedefs | |
typedef struct biosParmBlock | bpb_t |
typedef struct directoryEntry | dir_t |
typedef struct fat32_boot | fat32_boot_t |
typedef struct fat32_fsinfo | fat32_fsinfo_t |
typedef struct fat_boot | fat_boot_t |
typedef struct longDirectoryEntry | ldir_t |
typedef struct masterBootRecord | mbr_t |
typedef struct partitionTable | part_t |
Functions | |
static uint8_t | DIR_IS_FILE (const dir_t *dir) |
static uint8_t | DIR_IS_FILE_OR_SUBDIR (const dir_t *dir) |
static uint8_t | DIR_IS_HIDDEN (const dir_t *dir) |
static uint8_t | DIR_IS_LONG_NAME (const dir_t *dir) |
static uint8_t | DIR_IS_SUBDIR (const dir_t *dir) |
static uint8_t | DIR_IS_SYSTEM (const dir_t *dir) |
static uint16_t | FAT_DATE (uint16_t year, uint8_t month, uint8_t day) |
static uint8_t | FAT_DAY (uint16_t fatDate) |
static uint8_t | FAT_HOUR (uint16_t fatTime) |
static uint8_t | FAT_MINUTE (uint16_t fatTime) |
static uint8_t | FAT_MONTH (uint16_t fatDate) |
static uint8_t | FAT_SECOND (uint16_t fatTime) |
static uint16_t | FAT_TIME (uint8_t hour, uint8_t minute, uint8_t second) |
static uint16_t | FAT_YEAR (uint16_t fatDate) |
Variables | |
const uint8_t | BOOTSIG0 = 0X55 |
const uint8_t | BOOTSIG1 = 0XAA |
const uint8_t | DIR_ATT_ARCHIVE = 0X20 |
const uint8_t | DIR_ATT_DEFINED_BITS = 0X3F |
const uint8_t | DIR_ATT_DIRECTORY = 0X10 |
const uint8_t | DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY) |
const uint8_t | DIR_ATT_HIDDEN = 0X02 |
const uint8_t | DIR_ATT_LONG_NAME = 0X0F |
const uint8_t | DIR_ATT_LONG_NAME_MASK = 0X3F |
const uint8_t | DIR_ATT_READ_ONLY = 0X01 |
const uint8_t | DIR_ATT_SYSTEM = 0X04 |
const uint8_t | DIR_ATT_VOLUME_ID = 0X08 |
const uint8_t | DIR_NAME_0XE5 = 0X05 |
const uint8_t | DIR_NAME_DELETED = 0XE5 |
const uint8_t | DIR_NAME_FREE = 0X00 |
const uint8_t | DIR_NT_LC_BASE = 0X08 |
const uint8_t | DIR_NT_LC_EXT = 0X10 |
const uint8_t | EXTENDED_BOOT_SIG = 0X29 |
const uint16_t | FAT12EOC = 0XFFF |
const uint16_t | FAT12EOC_MIN = 0XFF8 |
const uint16_t | FAT16EOC = 0XFFFF |
const uint16_t | FAT16EOC_MIN = 0XFFF8 |
const uint32_t | FAT32EOC = 0X0FFFFFFF |
const uint32_t | FAT32EOC_MIN = 0X0FFFFFF8 |
const uint32_t | FAT32MASK = 0X0FFFFFFF |
const uint16_t | FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1 |
const uint16_t | FAT_DEFAULT_TIME = (1 << 11) |
const uint32_t | FSINFO_LEAD_SIG = 0x41615252 |
const uint32_t | FSINFO_STRUCT_SIG = 0x61417272 |
const uint8_t | LDIR_NAME1_DIM = 5 |
const uint8_t | LDIR_NAME2_DIM = 6 |
const uint8_t | LDIR_NAME3_DIM = 2 |
const uint8_t | LDIR_ORD_LAST_LONG_ENTRY = 0X40 |
FAT file structures.
Copyright (c) 2011-2018 Bill Greiman This file is part of the SdFat library for SD memory cards.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
typedef struct biosParmBlock bpb_t |
Type name for biosParmBlock
typedef struct directoryEntry dir_t |
Type name for directoryEntry
typedef struct fat32_boot fat32_boot_t |
Type name for FAT32 Boot Sector
typedef struct fat32_fsinfo fat32_fsinfo_t |
Type name for FAT32 FSINFO Sector
typedef struct fat_boot fat_boot_t |
Type name for FAT Boot Sector
typedef struct longDirectoryEntry ldir_t |
Type name for longDirectoryEntry
typedef struct masterBootRecord mbr_t |
Type name for masterBootRecord
typedef struct partitionTable part_t |
Type name for partitionTable
|
inlinestatic |
Directory entry is for a file
[in] | dir | Pointer to a directory entry. |
|
inlinestatic |
Directory entry is for a file or subdirectory
[in] | dir | Pointer to a directory entry. |
|
inlinestatic |
Directory entry is hidden
[in] | dir | Pointer to a directory entry. |
|
inlinestatic |
Directory entry is part of a long name
[in] | dir | Pointer to a directory entry. |
|
inlinestatic |
Directory entry is for a subdirectory
[in] | dir | Pointer to a directory entry. |
|
inlinestatic |
Directory entry is system type
[in] | dir | Pointer to a directory entry. |
|
inlinestatic |
date field for FAT directory entry
[in] | year | [1980,2107] |
[in] | month | [1,12] |
[in] | day | [1,31] |
|
inlinestatic |
day part of FAT directory date field
[in] | fatDate | Date in packed dir format. |
|
inlinestatic |
hour part of FAT directory time field
[in] | fatTime | Time in packed dir format. |
|
inlinestatic |
minute part of FAT directory time field
[in] | fatTime | Time in packed dir format. |
|
inlinestatic |
month part of FAT directory date field
[in] | fatDate | Date in packed dir format. |
|
inlinestatic |
second part of FAT directory time field Note second/2 is stored in packed time.
[in] | fatTime | Time in packed dir format. |
|
inlinestatic |
time field for FAT directory entry
[in] | hour | [0,23] |
[in] | minute | [0,59] |
[in] | second | [0,59] |
|
inlinestatic |
year part of FAT directory date field
[in] | fatDate | Date in packed dir format. |
const uint8_t BOOTSIG0 = 0X55 |
Value for byte 510 of boot block or MBR
const uint8_t BOOTSIG1 = 0XAA |
Value for byte 511 of boot block or MBR
const uint8_t DIR_ATT_ARCHIVE = 0X20 |
Old DOS archive bit for backup support
const uint8_t DIR_ATT_DEFINED_BITS = 0X3F |
defined attribute bits
const uint8_t DIR_ATT_DIRECTORY = 0X10 |
Entry is for a directory
const uint8_t DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY) |
Mask for file/subdirectory tests
const uint8_t DIR_ATT_HIDDEN = 0X02 |
File should e hidden in directory listings
const uint8_t DIR_ATT_LONG_NAME = 0X0F |
Test value for long name entry. Test is (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME.
const uint8_t DIR_ATT_LONG_NAME_MASK = 0X3F |
Test mask for long name entry
const uint8_t DIR_ATT_READ_ONLY = 0X01 |
file is read-only
const uint8_t DIR_ATT_SYSTEM = 0X04 |
Entry is for a system file
const uint8_t DIR_ATT_VOLUME_ID = 0X08 |
Directory entry contains the volume label
const uint8_t DIR_NAME_0XE5 = 0X05 |
escape for name[0] = 0XE5
const uint8_t DIR_NAME_DELETED = 0XE5 |
name[0] value for entry that is free after being "deleted"
const uint8_t DIR_NAME_FREE = 0X00 |
name[0] value for entry that is free and no allocated entries follow
const uint8_t DIR_NT_LC_BASE = 0X08 |
Filename base-name is all lower case
const uint8_t DIR_NT_LC_EXT = 0X10 |
Filename extension is all lower case.
const uint8_t EXTENDED_BOOT_SIG = 0X29 |
Value for bootSignature field int FAT/FAT32 boot sector
const uint16_t FAT12EOC = 0XFFF |
FAT12 end of chain value used by Microsoft.
const uint16_t FAT12EOC_MIN = 0XFF8 |
Minimum value for FAT12 EOC. Use to test for EOC.
const uint16_t FAT16EOC = 0XFFFF |
FAT16 end of chain value used by Microsoft.
const uint16_t FAT16EOC_MIN = 0XFFF8 |
Minimum value for FAT16 EOC. Use to test for EOC.
const uint32_t FAT32EOC = 0X0FFFFFFF |
FAT32 end of chain value used by Microsoft.
const uint32_t FAT32EOC_MIN = 0X0FFFFFF8 |
Minimum value for FAT32 EOC. Use to test for EOC.
const uint32_t FAT32MASK = 0X0FFFFFFF |
Mask a for FAT32 entry. Entries are 28 bits.
const uint16_t FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1 |
Default date for file timestamps is 1 Jan 2000
const uint16_t FAT_DEFAULT_TIME = (1 << 11) |
Default time for file timestamp is 1 am
const uint32_t FSINFO_LEAD_SIG = 0x41615252 |
Lead signature for a FSINFO sector
const uint32_t FSINFO_STRUCT_SIG = 0x61417272 |
Struct signature for a FSINFO sector
const uint8_t LDIR_NAME1_DIM = 5 |
Dimension of first name field in long directory entry
const uint8_t LDIR_NAME2_DIM = 6 |
Dimension of first name field in long directory entry
const uint8_t LDIR_NAME3_DIM = 2 |
Dimension of first name field in long directory entry
const uint8_t LDIR_ORD_LAST_LONG_ENTRY = 0X40 |
Ord mast that indicates the entry is the last long dir entry in a set of long dir entries. All valid sets of long dir entries must begin with an entry having this mask.