Access FAT16 and FAT32 partitions on raw file devices.
More...
#include <FatPartition.h>
Inherited by FatVolume.
|
| bool | cacheSafeRead (uint32_t sector, uint8_t *dst) |
| |
| bool | cacheSafeRead (uint32_t sector, uint8_t *dst, size_t count) |
| |
| bool | cacheSafeWrite (uint32_t sector, const uint8_t *dst) |
| |
| bool | cacheSafeWrite (uint32_t sector, const uint8_t *dst, size_t count) |
| |
| bool | readSector (uint32_t sector, uint8_t *dst) |
| |
| bool | syncDevice () |
| |
| bool | writeSector (uint32_t sector, const uint8_t *src) |
| |
| void | setFreeClusterCount (int32_t value) |
| |
| void | updateFreeClusterCount (int32_t change) |
| |
| void | setFreeClusterCount (int32_t value) |
| |
| void | updateFreeClusterCount (int32_t change) |
| |
| cache_t * | cacheFetchFat (uint32_t sector, uint8_t options) |
| |
| bool | cacheSync () |
| |
| cache_t * | cacheFetchFat (uint32_t sector, uint8_t options) |
| |
| bool | cacheSync () |
| |
| cache_t * | cacheFetchData (uint32_t sector, uint8_t options) |
| |
| void | cacheInvalidate () |
| |
| bool | cacheSyncData () |
| |
| cache_t * | cacheAddress () |
| |
| uint32_t | cacheSectorNumber () |
| |
| void | cacheDirty () |
| |
| bool | allocateCluster (uint32_t current, uint32_t *next) |
| |
| bool | allocContiguous (uint32_t count, uint32_t *firstCluster) |
| |
| uint8_t | sectorOfCluster (uint32_t position) const |
| |
| uint32_t | clusterStartSector (uint32_t cluster) const |
| |
| int8_t | fatGet (uint32_t cluster, uint32_t *value) |
| |
| bool | fatPut (uint32_t cluster, uint32_t value) |
| |
| bool | fatPutEOC (uint32_t cluster) |
| |
| bool | freeChain (uint32_t cluster) |
| |
| bool | isEOC (uint32_t cluster) const |
| |
Access FAT16 and FAT32 partitions on raw file devices.
◆ FatPartition()
| FatPartition::FatPartition |
( |
| ) |
|
|
inline |
◆ allocateCluster()
| bool FatPartition::allocateCluster |
( |
uint32_t |
current, |
|
|
uint32_t * |
next |
|
) |
| |
|
private |
◆ allocContiguous()
| bool FatPartition::allocContiguous |
( |
uint32_t |
count, |
|
|
uint32_t * |
firstCluster |
|
) |
| |
|
private |
◆ blocksPerCluster()
| uint8_t FatPartition::blocksPerCluster |
( |
| ) |
|
|
inline |
◆ bytesPerCluster()
| uint16_t FatPartition::bytesPerCluster |
( |
| ) |
const |
|
inline |
- Returns
- Number of bytes in a cluster.
◆ bytesPerClusterShift()
| uint8_t FatPartition::bytesPerClusterShift |
( |
| ) |
const |
|
inline |
- Returns
- The shift count required to multiply by bytesPerCluster.
◆ bytesPerSector()
| uint16_t FatPartition::bytesPerSector |
( |
| ) |
const |
|
inline |
- Returns
- Number of bytes per sector.
◆ bytesPerSectorShift()
| uint8_t FatPartition::bytesPerSectorShift |
( |
| ) |
const |
|
inline |
- Returns
- The shift count required to multiply by bytesPerCluster.
◆ cacheAddress()
| cache_t * FatPartition::cacheAddress |
( |
| ) |
|
|
inlineprivate |
◆ cacheClear()
| uint8_t * FatPartition::cacheClear |
( |
| ) |
|
|
inline |
Clear the cache and returns a pointer to the cache. Not for normal apps.
- Returns
- A pointer to the cache buffer or zero if an error occurs.
◆ cacheDirty()
| void FatPartition::cacheDirty |
( |
| ) |
|
|
inlineprivate |
◆ cacheFetchData()
| cache_t * FatPartition::cacheFetchData |
( |
uint32_t |
sector, |
|
|
uint8_t |
options |
|
) |
| |
|
inlineprivate |
◆ cacheFetchFat() [1/2]
| cache_t * FatPartition::cacheFetchFat |
( |
uint32_t |
sector, |
|
|
uint8_t |
options |
|
) |
| |
|
inlineprivate |
◆ cacheFetchFat() [2/2]
| cache_t * FatPartition::cacheFetchFat |
( |
uint32_t |
sector, |
|
|
uint8_t |
options |
|
) |
| |
|
inlineprivate |
◆ cacheInvalidate()
| void FatPartition::cacheInvalidate |
( |
| ) |
|
|
inlineprivate |
◆ cacheSafeRead() [1/2]
| bool FatPartition::cacheSafeRead |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst |
|
) |
| |
|
inlineprivate |
◆ cacheSafeRead() [2/2]
| bool FatPartition::cacheSafeRead |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst, |
|
|
size_t |
count |
|
) |
| |
|
inlineprivate |
◆ cacheSafeWrite() [1/2]
| bool FatPartition::cacheSafeWrite |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
dst |
|
) |
| |
|
inlineprivate |
◆ cacheSafeWrite() [2/2]
| bool FatPartition::cacheSafeWrite |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
dst, |
|
|
size_t |
count |
|
) |
| |
|
inlineprivate |
◆ cacheSectorNumber()
| uint32_t FatPartition::cacheSectorNumber |
( |
| ) |
|
|
inlineprivate |
◆ cacheSync() [1/2]
| bool FatPartition::cacheSync |
( |
| ) |
|
|
inlineprivate |
◆ cacheSync() [2/2]
| bool FatPartition::cacheSync |
( |
| ) |
|
|
inlineprivate |
◆ cacheSyncData()
| bool FatPartition::cacheSyncData |
( |
| ) |
|
|
inlineprivate |
◆ clusterCount()
| uint32_t FatPartition::clusterCount |
( |
| ) |
const |
|
inline |
- Returns
- The total number of clusters in the volume.
◆ clusterStartSector()
| uint32_t FatPartition::clusterStartSector |
( |
uint32_t |
cluster | ) |
const |
|
inlineprivate |
◆ dataStartSector()
| uint32_t FatPartition::dataStartSector |
( |
| ) |
const |
|
inline |
- Returns
- The logical sector number for the start of file data.
◆ dbgFat()
| int8_t FatPartition::dbgFat |
( |
uint32_t |
n, |
|
|
uint32_t * |
v |
|
) |
| |
|
inline |
Debug access to FAT table
- Parameters
-
| [in] | n | cluster number. |
| [out] | v | value of entry |
- Returns
- -1 error, 0 EOC, else 1.
◆ dmpDirSector()
| void FatPartition::dmpDirSector |
( |
print_t * |
pr, |
|
|
uint32_t |
sector |
|
) |
| |
◆ dmpFat()
| void FatPartition::dmpFat |
( |
print_t * |
pr, |
|
|
uint32_t |
start, |
|
|
uint32_t |
count |
|
) |
| |
◆ dmpRootDir()
| void FatPartition::dmpRootDir |
( |
print_t * |
pr | ) |
|
◆ dmpSector()
| void FatPartition::dmpSector |
( |
print_t * |
pr, |
|
|
uint32_t |
sector, |
|
|
uint8_t |
bits = 8 |
|
) |
| |
◆ fatCount()
| uint8_t FatPartition::fatCount |
( |
| ) |
const |
|
inline |
- Returns
- The number of File Allocation Tables.
◆ fatGet()
| int8_t FatPartition::fatGet |
( |
uint32_t |
cluster, |
|
|
uint32_t * |
value |
|
) |
| |
|
private |
◆ fatPut()
| bool FatPartition::fatPut |
( |
uint32_t |
cluster, |
|
|
uint32_t |
value |
|
) |
| |
|
private |
◆ fatPutEOC()
| bool FatPartition::fatPutEOC |
( |
uint32_t |
cluster | ) |
|
|
inlineprivate |
◆ fatStartSector()
| uint32_t FatPartition::fatStartSector |
( |
| ) |
const |
|
inline |
- Returns
- The logical sector number for the start of the first FAT.
◆ fatType()
| uint8_t FatPartition::fatType |
( |
| ) |
const |
|
inline |
- Returns
- The FAT type of the volume. Values are 12, 16 or 32.
◆ freeChain()
| bool FatPartition::freeChain |
( |
uint32_t |
cluster | ) |
|
|
private |
◆ freeClusterCount()
| int32_t FatPartition::freeClusterCount |
( |
| ) |
|
Volume free space in clusters.
- Returns
- Count of free clusters for success or -1 if an error occurs.
◆ init()
| bool FatPartition::init |
( |
BlockDevice * |
dev, |
|
|
uint8_t |
part = 1 |
|
) |
| |
Initialize a FAT partition.
- Parameters
-
| [in] | dev | BlockDevice for this partition. |
| [in] | part | The partition to be used. Legal values for part are 1-4 to use the corresponding partition on a device formatted with a MBR, Master Boot Record, or zero if the device is formatted as a super floppy with the FAT boot sector in sector zero. |
- Returns
- true for success or false for failure.
◆ isBusy()
| bool FatPartition::isBusy |
( |
| ) |
|
|
inline |
Check for BlockDevice busy.
- Returns
- true if busy else false.
◆ isEOC()
| bool FatPartition::isEOC |
( |
uint32_t |
cluster | ) |
const |
|
inlineprivate |
◆ readSector()
| bool FatPartition::readSector |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst |
|
) |
| |
|
inlineprivate |
◆ rootDirEntryCount()
| uint16_t FatPartition::rootDirEntryCount |
( |
| ) |
const |
|
inline |
- Returns
- The number of entries in the root directory for FAT16 volumes.
◆ rootDirStart()
| uint32_t FatPartition::rootDirStart |
( |
| ) |
const |
|
inline |
- Returns
- The logical sector number for the start of the root directory on FAT16 volumes or the first cluster number on FAT32 volumes.
◆ sectorMask()
| uint16_t FatPartition::sectorMask |
( |
| ) |
const |
|
inline |
- Returns
- Mask for sector offset.
◆ sectorOfCluster()
| uint8_t FatPartition::sectorOfCluster |
( |
uint32_t |
position | ) |
const |
|
inlineprivate |
◆ sectorsPerCluster()
| uint8_t FatPartition::sectorsPerCluster |
( |
| ) |
const |
|
inline |
- Returns
- The volume's cluster size in sectors.
◆ sectorsPerClusterShift()
| uint8_t FatPartition::sectorsPerClusterShift |
( |
| ) |
const |
|
inline |
- Returns
- The shift count required to multiply by sectorsPerCluster.
◆ sectorsPerFat()
| uint32_t FatPartition::sectorsPerFat |
( |
| ) |
const |
|
inline |
- Returns
- The number of sectors in one FAT.
◆ setFreeClusterCount() [1/2]
| void FatPartition::setFreeClusterCount |
( |
int32_t |
value | ) |
|
|
inlineprivate |
◆ setFreeClusterCount() [2/2]
| void FatPartition::setFreeClusterCount |
( |
int32_t |
value | ) |
|
|
inlineprivate |
◆ syncDevice()
| bool FatPartition::syncDevice |
( |
| ) |
|
|
inlineprivate |
◆ updateFreeClusterCount() [1/2]
| void FatPartition::updateFreeClusterCount |
( |
int32_t |
change | ) |
|
|
inlineprivate |
◆ updateFreeClusterCount() [2/2]
| void FatPartition::updateFreeClusterCount |
( |
int32_t |
change | ) |
|
|
inlineprivate |
◆ volumeSectorCount()
| uint32_t FatPartition::volumeSectorCount |
( |
| ) |
const |
|
inline |
- Returns
- The number of sectors in the volume
◆ writeSector()
| bool FatPartition::writeSector |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
src |
|
) |
| |
|
inlineprivate |
◆ FatFile
FatFile allowed access to private members.
◆ m_allocSearchStart
| uint32_t FatPartition::m_allocSearchStart |
|
private |
◆ m_blockDev
◆ m_bytesPerSector
| const uint16_t FatPartition::m_bytesPerSector = 512 |
|
staticprivate |
◆ m_bytesPerSectorShift
| const uint8_t FatPartition::m_bytesPerSectorShift = 9 |
|
staticprivate |
◆ m_cache
◆ m_clusterSectorMask
| uint8_t FatPartition::m_clusterSectorMask |
|
private |
◆ m_dataStartSector
| uint32_t FatPartition::m_dataStartSector |
|
private |
◆ m_fatCache
◆ m_fatStartSector
| uint32_t FatPartition::m_fatStartSector |
|
private |
◆ m_fatType
| uint8_t FatPartition::m_fatType = 0 |
|
private |
◆ m_freeClusterCount
| int32_t FatPartition::m_freeClusterCount |
|
private |
◆ m_lastCluster
| uint32_t FatPartition::m_lastCluster |
|
private |
◆ m_rootDirEntryCount
| uint16_t FatPartition::m_rootDirEntryCount |
|
private |
◆ m_rootDirStart
| uint32_t FatPartition::m_rootDirStart |
|
private |
◆ m_sectorMask
| const uint16_t FatPartition::m_sectorMask = 0x1FF |
|
staticprivate |
◆ m_sectorsPerCluster
| uint8_t FatPartition::m_sectorsPerCluster |
|
private |
◆ m_sectorsPerClusterShift
| uint8_t FatPartition::m_sectorsPerClusterShift |
|
private |
◆ m_sectorsPerFat
| uint32_t FatPartition::m_sectorsPerFat |
|
private |
The documentation for this class was generated from the following files: