Kinetis Bootloader  2.0.0
Common bootloader for Kinetis devices
Fat_dir_entry

Data Structures

union  fat_directory_entry_t
 FAT filesystem directory entry. More...
 
struct  fat_directory_entry_t.entry
 Standard file or directory entry with a short name. More...
 
struct  fat_directory_entry_t.longName
 Long file name directory entry. More...
 

Enumerations

enum  _fat_directory_attributes {
  kReadOnlyAttribute = 0x01,
  kHiddenAttribute = 0x02,
  kSystemAttribute = 0x04,
  kVolumeIdAttribute = 0x08,
  kDirectoryAttribute = 0x10,
  kArchiveAttribute = 0x20,
  kLongNameAttribute = kReadOnlyAttribute | kHiddenAttribute | kSystemAttribute | kVolumeIdAttribute,
  kLastLongNameEntry = 0x40,
  kFreeEntryMarkerByte = 0xe5,
  kReadOnlyAttribute = 0x01,
  kHiddenAttribute = 0x02,
  kSystemAttribute = 0x04,
  kVolumeIdAttribute = 0x08,
  kDirectoryAttribute = 0x10,
  kArchiveAttribute = 0x20,
  kLongNameAttribute = kReadOnlyAttribute | kHiddenAttribute | kSystemAttribute | kVolumeIdAttribute,
  kLastLongNameEntry = 0x40,
  kFreeEntryMarkerByte = 0xe5
}
 FAT filesystem directory entry attributes. More...
 
enum  _fat_directory_attributes {
  kReadOnlyAttribute = 0x01,
  kHiddenAttribute = 0x02,
  kSystemAttribute = 0x04,
  kVolumeIdAttribute = 0x08,
  kDirectoryAttribute = 0x10,
  kArchiveAttribute = 0x20,
  kLongNameAttribute = kReadOnlyAttribute | kHiddenAttribute | kSystemAttribute | kVolumeIdAttribute,
  kLastLongNameEntry = 0x40,
  kFreeEntryMarkerByte = 0xe5,
  kReadOnlyAttribute = 0x01,
  kHiddenAttribute = 0x02,
  kSystemAttribute = 0x04,
  kVolumeIdAttribute = 0x08,
  kDirectoryAttribute = 0x10,
  kArchiveAttribute = 0x20,
  kLongNameAttribute = kReadOnlyAttribute | kHiddenAttribute | kSystemAttribute | kVolumeIdAttribute,
  kLastLongNameEntry = 0x40,
  kFreeEntryMarkerByte = 0xe5
}
 FAT filesystem directory entry attributes. More...
 

Usage Information


Data Structure Documentation

union fat_directory_entry_t

FAT filesystem directory entry.

This union can represent either a standard file or directory entry, or a long file name entry.

The upper 2 bits of the attribute byte are reserved and should always be set to 0 when a file is created and never modify or look at it after that.

The ntReserved field must be set to 0 when file is created and never modified or look at it after that.

The creationTimeTenths field actually contains a count of tenths of a second. The granularity of the seconds part of the creationTime is two seconds so this field is a count of tenths of a second and its valid value range is 0-199 inclusive.

Note that there is no last access time, only a date. This is the date of last read or write. In the case of a write, this should be set to the same date as DIR_WrtDate.

The firstClusterHigh field will always be 0 for a FAT12 or FAT16 volume.

Note that file creation is considered a write.

Data Fields
struct fat_directory_entry_t entry Standard file or directory entry with a short name.
struct fat_directory_entry_t entry Standard file or directory entry with a short name.
struct fat_directory_entry_t longName Long file name directory entry.
struct fat_directory_entry_t longName Long file name directory entry.
struct fat_directory_entry_t.entry

Standard file or directory entry with a short name.

Data Fields
uint8_t attributes File attributes.
uint16_t creationDate Date file was created.
uint16_t creationTime Time file was created.
uint8_t creationTimeTenths Millisecond stamp at file creation time.
uint32_t fileSize This file's size in bytes.
uint16_t firstClusterHigh High two bytes of this entry's first cluster number.
uint16_t firstClusterLow Low two bytes of this entry's first cluster number.
uint16_t lastAccessDate Last access date.
uint8_t name[11] Short file name.
uint8_t ntReserved Reserved.
uint16_t writeDate Date of last write.
uint16_t writeTime Time of last write.
struct fat_directory_entry_t.longName

Long file name directory entry.

Data Fields
uint8_t attributes Must be set to kLongNameAttribute.
uint8_t checksum Checksum of the short file name.
uint8_t entryType Should be 0 for long file name directory entries.
uint16_t firstClusterLow Must be set to 0 for compatibility.
wchar_t name1[5] Characters 1-5 of the long name.
wchar_t name2[6] Characters 6-11 of the long name.
wchar_t name3[2] Character 12-13 of the long name.
uint8_t order Order of this long file name entry. May be masked with kLastLongNameEntry.

Enumeration Type Documentation

FAT filesystem directory entry attributes.

Enumerator
kReadOnlyAttribute 

Read only.

kHiddenAttribute 

Hidden.

kSystemAttribute 

System.

kVolumeIdAttribute 

Volume ID.

kDirectoryAttribute 

Directory.

kArchiveAttribute 

Archive.

kLongNameAttribute 

Attribute value to identify a long file name entry.

kLastLongNameEntry 

Marker flag for long name entry order field to indicate the final long name entry.

kFreeEntryMarkerByte 

The first name byte is set to this value to mark a directory entry as free.

kReadOnlyAttribute 

Read only.

kHiddenAttribute 

Hidden.

kSystemAttribute 

System.

kVolumeIdAttribute 

Volume ID.

kDirectoryAttribute 

Directory.

kArchiveAttribute 

Archive.

kLongNameAttribute 

Attribute value to identify a long file name entry.

kLastLongNameEntry 

Marker flag for long name entry order field to indicate the final long name entry.

kFreeEntryMarkerByte 

The first name byte is set to this value to mark a directory entry as free.

FAT filesystem directory entry attributes.

Enumerator
kReadOnlyAttribute 

Read only.

kHiddenAttribute 

Hidden.

kSystemAttribute 

System.

kVolumeIdAttribute 

Volume ID.

kDirectoryAttribute 

Directory.

kArchiveAttribute 

Archive.

kLongNameAttribute 

Attribute value to identify a long file name entry.

kLastLongNameEntry 

Marker flag for long name entry order field to indicate the final long name entry.

kFreeEntryMarkerByte 

The first name byte is set to this value to mark a directory entry as free.

kReadOnlyAttribute 

Read only.

kHiddenAttribute 

Hidden.

kSystemAttribute 

System.

kVolumeIdAttribute 

Volume ID.

kDirectoryAttribute 

Directory.

kArchiveAttribute 

Archive.

kLongNameAttribute 

Attribute value to identify a long file name entry.

kLastLongNameEntry 

Marker flag for long name entry order field to indicate the final long name entry.

kFreeEntryMarkerByte 

The first name byte is set to this value to mark a directory entry as free.