Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
ExFatPartition Class Reference

Access exFat partitions on raw file devices. More...

#include <ExFatPartition.h>

Inherited by ExFatVolume.

Public Member Functions

 ExFatPartition ()
 
uint32_t bytesPerCluster () const
 
uint8_t bytesPerClusterShift () const
 
uint16_t bytesPerSector () const
 
uint8_t bytesPerSectorShift () const
 
uint8_t * cacheClear ()
 
uint32_t clusterCount () const
 
uint32_t clusterHeapStartSector () const
 
uint32_t fatLength () const
 
uint32_t fatStartSector () const
 
uint8_t fatType () const
 
uint32_t freeClusterCount ()
 
bool init (BlockDevice *dev, uint8_t part)
 
bool isBusy ()
 
uint32_t rootDirectoryCluster () const
 
uint32_t rootLength ()
 
uint32_t sectorsPerCluster () const
 
uint32_t blocksPerCluster () __attribute__((deprecated))
 
uint8_t sectorsPerClusterShift () const
 
void checkUpcase (print_t *pr)
 
bool printDir (print_t *pr, ExFatFile *file)
 
void dmpBitmap (print_t *pr)
 
void dmpCluster (print_t *pr, uint32_t cluster, uint32_t offset, uint32_t count)
 
void dmpFat (print_t *pr, uint32_t start, uint32_t count)
 
void dmpSector (print_t *pr, uint32_t sector)
 
bool printVolInfo (print_t *pr)
 
void printFat (print_t *pr)
 
void printUpcase (print_t *pr)
 

Private Member Functions

uint32_t bitmapFind (uint32_t cluster, uint32_t count)
 
bool bitmapModify (uint32_t cluster, uint32_t count, bool value)
 
uint8_t * bitmapCacheGet (uint32_t sector, uint8_t option)
 
void cacheInit (BlockDevice *dev)
 
bool cacheSync ()
 
void dataCacheDirty ()
 
void dataCacheInvalidate ()
 
uint8_t * dataCacheGet (uint32_t sector, uint8_t option)
 
uint32_t dataCacheSector ()
 
bool dataCacheSync ()
 
uint32_t clusterMask () const
 
uint32_t clusterStartSector (uint32_t cluster)
 
uint8_t * dirCache (DirPos_t *pos, uint8_t options)
 
int8_t dirSeek (DirPos_t *pos, uint32_t offset)
 
uint8_t fatGet (uint32_t cluster, uint32_t *value)
 
bool fatPut (uint32_t cluster, uint32_t value)
 
uint32_t chainSize (uint32_t cluster)
 
bool freeChain (uint32_t cluster)
 
uint16_t sectorMask () const
 
bool syncDevice ()
 
bool cacheSafeRead (uint32_t sector, uint8_t *dst)
 
bool cacheSafeWrite (uint32_t sector, const uint8_t *src)
 
bool cacheSafeRead (uint32_t sector, uint8_t *dst, size_t count)
 
bool cacheSafeWrite (uint32_t sector, const uint8_t *src, size_t count)
 
bool readSector (uint32_t sector, uint8_t *dst)
 
bool writeSector (uint32_t sector, const uint8_t *src)
 

Private Attributes

FsCache m_bitmapCache
 
FsCache m_dataCache
 
uint32_t m_bitmapStart
 
uint32_t m_fatStartSector
 
uint32_t m_fatLength
 
uint32_t m_clusterHeapStartSector
 
uint32_t m_clusterCount
 
uint32_t m_rootDirectoryCluster
 
uint32_t m_clusterMask
 
uint32_t m_bytesPerCluster
 
BlockDevicem_blockDev
 
uint8_t m_fatType = 0
 
uint8_t m_sectorsPerClusterShift
 

Static Private Attributes

static const uint8_t m_bytesPerSectorShift = 9
 
static const uint16_t m_bytesPerSector = 512
 
static const uint16_t m_sectorMask = 0x1FF
 

Friends

class ExFatFile
 

Detailed Description

Access exFat partitions on raw file devices.

Constructor & Destructor Documentation

◆ ExFatPartition()

ExFatPartition::ExFatPartition ( )
inline

Member Function Documentation

◆ bitmapCacheGet()

uint8_t * ExFatPartition::bitmapCacheGet ( uint32_t  sector,
uint8_t  option 
)
inlineprivate

◆ bitmapFind()

uint32_t ExFatPartition::bitmapFind ( uint32_t  cluster,
uint32_t  count 
)
private

◆ bitmapModify()

bool ExFatPartition::bitmapModify ( uint32_t  cluster,
uint32_t  count,
bool  value 
)
private

◆ blocksPerCluster()

uint32_t ExFatPartition::blocksPerCluster ( )
inline

◆ bytesPerCluster()

uint32_t ExFatPartition::bytesPerCluster ( ) const
inline
Returns
the number of bytes in a cluster.

◆ bytesPerClusterShift()

uint8_t ExFatPartition::bytesPerClusterShift ( ) const
inline
Returns
the power of two for bytesPerCluster.

◆ bytesPerSector()

uint16_t ExFatPartition::bytesPerSector ( ) const
inline
Returns
the number of bytes in a sector.

◆ bytesPerSectorShift()

uint8_t ExFatPartition::bytesPerSectorShift ( ) const
inline
Returns
the power of two for bytesPerSector.

◆ cacheClear()

uint8_t * ExFatPartition::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.

◆ cacheInit()

void ExFatPartition::cacheInit ( BlockDevice dev)
inlineprivate

◆ cacheSafeRead() [1/2]

bool ExFatPartition::cacheSafeRead ( uint32_t  sector,
uint8_t *  dst 
)
inlineprivate

◆ cacheSafeRead() [2/2]

bool ExFatPartition::cacheSafeRead ( uint32_t  sector,
uint8_t *  dst,
size_t  count 
)
inlineprivate

◆ cacheSafeWrite() [1/2]

bool ExFatPartition::cacheSafeWrite ( uint32_t  sector,
const uint8_t *  src 
)
inlineprivate

◆ cacheSafeWrite() [2/2]

bool ExFatPartition::cacheSafeWrite ( uint32_t  sector,
const uint8_t *  src,
size_t  count 
)
inlineprivate

◆ cacheSync()

bool ExFatPartition::cacheSync ( )
inlineprivate

◆ chainSize()

uint32_t ExFatPartition::chainSize ( uint32_t  cluster)
private

◆ checkUpcase()

void ExFatPartition::checkUpcase ( print_t pr)

◆ clusterCount()

uint32_t ExFatPartition::clusterCount ( ) const
inline
Returns
the cluster count for the partition.

◆ clusterHeapStartSector()

uint32_t ExFatPartition::clusterHeapStartSector ( ) const
inline
Returns
the cluster heap start sector.

◆ clusterMask()

uint32_t ExFatPartition::clusterMask ( ) const
inlineprivate

◆ clusterStartSector()

uint32_t ExFatPartition::clusterStartSector ( uint32_t  cluster)
inlineprivate

◆ dataCacheDirty()

void ExFatPartition::dataCacheDirty ( )
inlineprivate

◆ dataCacheGet()

uint8_t * ExFatPartition::dataCacheGet ( uint32_t  sector,
uint8_t  option 
)
inlineprivate

◆ dataCacheInvalidate()

void ExFatPartition::dataCacheInvalidate ( )
inlineprivate

◆ dataCacheSector()

uint32_t ExFatPartition::dataCacheSector ( )
inlineprivate

◆ dataCacheSync()

bool ExFatPartition::dataCacheSync ( )
inlineprivate

◆ dirCache()

uint8_t * ExFatPartition::dirCache ( DirPos_t pos,
uint8_t  options 
)
private

◆ dirSeek()

int8_t ExFatPartition::dirSeek ( DirPos_t pos,
uint32_t  offset 
)
private

◆ dmpBitmap()

void ExFatPartition::dmpBitmap ( print_t pr)

◆ dmpCluster()

void ExFatPartition::dmpCluster ( print_t pr,
uint32_t  cluster,
uint32_t  offset,
uint32_t  count 
)

◆ dmpFat()

void ExFatPartition::dmpFat ( print_t pr,
uint32_t  start,
uint32_t  count 
)

◆ dmpSector()

void ExFatPartition::dmpSector ( print_t pr,
uint32_t  sector 
)

◆ fatGet()

uint8_t ExFatPartition::fatGet ( uint32_t  cluster,
uint32_t *  value 
)
private

◆ fatLength()

uint32_t ExFatPartition::fatLength ( ) const
inline
Returns
the FAT length in sectors

◆ fatPut()

bool ExFatPartition::fatPut ( uint32_t  cluster,
uint32_t  value 
)
private

◆ fatStartSector()

uint32_t ExFatPartition::fatStartSector ( ) const
inline
Returns
the FAT start sector number.

◆ fatType()

uint8_t ExFatPartition::fatType ( ) const
inline
Returns
Type FAT_TYPE_EXFAT for exFAT partition or zero for error.

◆ freeChain()

bool ExFatPartition::freeChain ( uint32_t  cluster)
private

◆ freeClusterCount()

uint32_t ExFatPartition::freeClusterCount ( )
Returns
the free cluster count.

◆ init()

bool ExFatPartition::init ( BlockDevice dev,
uint8_t  part 
)

Initialize a exFAT partition.

Parameters
[in]devThe blockDevice for the partition.
[in]partThe 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 ExFatPartition::isBusy ( )
inline

Check for BlockDevice busy.

Returns
true if busy else false.

◆ printDir()

bool ExFatPartition::printDir ( print_t pr,
ExFatFile file 
)

◆ printFat()

void ExFatPartition::printFat ( print_t pr)

◆ printUpcase()

void ExFatPartition::printUpcase ( print_t pr)

◆ printVolInfo()

bool ExFatPartition::printVolInfo ( print_t pr)

◆ readSector()

bool ExFatPartition::readSector ( uint32_t  sector,
uint8_t *  dst 
)
inlineprivate

◆ rootDirectoryCluster()

uint32_t ExFatPartition::rootDirectoryCluster ( ) const
inline
Returns
the root directory start cluster number.

◆ rootLength()

uint32_t ExFatPartition::rootLength ( )
Returns
the root directory length.

◆ sectorMask()

uint16_t ExFatPartition::sectorMask ( ) const
inlineprivate

◆ sectorsPerCluster()

uint32_t ExFatPartition::sectorsPerCluster ( ) const
inline
Returns
the number of sectors in a cluster.

◆ sectorsPerClusterShift()

uint8_t ExFatPartition::sectorsPerClusterShift ( ) const
inline
Returns
the power of two for sectors per cluster.

◆ syncDevice()

bool ExFatPartition::syncDevice ( )
inlineprivate

◆ writeSector()

bool ExFatPartition::writeSector ( uint32_t  sector,
const uint8_t *  src 
)
inlineprivate

Friends And Related Symbol Documentation

◆ ExFatFile

friend class ExFatFile
friend

ExFatFile allowed access to private members.

Member Data Documentation

◆ m_bitmapCache

FsCache ExFatPartition::m_bitmapCache
private

◆ m_bitmapStart

uint32_t ExFatPartition::m_bitmapStart
private

◆ m_blockDev

BlockDevice* ExFatPartition::m_blockDev
private

◆ m_bytesPerCluster

uint32_t ExFatPartition::m_bytesPerCluster
private

◆ m_bytesPerSector

const uint16_t ExFatPartition::m_bytesPerSector = 512
staticprivate

◆ m_bytesPerSectorShift

const uint8_t ExFatPartition::m_bytesPerSectorShift = 9
staticprivate

◆ m_clusterCount

uint32_t ExFatPartition::m_clusterCount
private

◆ m_clusterHeapStartSector

uint32_t ExFatPartition::m_clusterHeapStartSector
private

◆ m_clusterMask

uint32_t ExFatPartition::m_clusterMask
private

◆ m_dataCache

FsCache ExFatPartition::m_dataCache
private

◆ m_fatLength

uint32_t ExFatPartition::m_fatLength
private

◆ m_fatStartSector

uint32_t ExFatPartition::m_fatStartSector
private

◆ m_fatType

uint8_t ExFatPartition::m_fatType = 0
private

◆ m_rootDirectoryCluster

uint32_t ExFatPartition::m_rootDirectoryCluster
private

◆ m_sectorMask

const uint16_t ExFatPartition::m_sectorMask = 0x1FF
staticprivate

◆ m_sectorsPerClusterShift

uint8_t ExFatPartition::m_sectorsPerClusterShift
private

The documentation for this class was generated from the following files: