Nut/OS  5.0.5
API Reference
PHAT32 Support

PHAT32 specific routines. More...

Collaboration diagram for PHAT32 Support:

Defines

#define PHAT32CMASK   0x0FFFFFFF

Functions

uint32_t Phat32FreeClusters (NUTDEVICE *dev)
 Counts the number of free clusters in a fat32 volume, fast version.
int Phat32GetClusterLink (NUTDEVICE *dev, uint32_t clust, uint32_t *link)
 Get link value of a specified cluster.
int Phat32SetClusterLink (NUTDEVICE *dev, uint32_t clust, uint32_t link)
 Set link value of a specified cluster.
int Phat32ReleaseChain (NUTDEVICE *dev, uint32_t first)
 Release a cluster chain.

Detailed Description

PHAT32 specific routines.


Define Documentation


Function Documentation

uint32_t Phat32FreeClusters ( NUTDEVICE dev)

Counts the number of free clusters in a fat32 volume, fast version.

Parameters:
devSpecifies the file system device.
Returns:
The number of free clusters.

References _NUTDEVICE::dev_dcb, PHAT32CMASK, PHATEOC, PhatSectorBufferRelease(), PhatSectorLoad(), rc, _PHATSECTBUF::sect_data, _PHATVOL::vol_buf, _PHATVOL::vol_last_clust, _PHATVOL::vol_sectsz, and _PHATVOL::vol_tab_sect.

Here is the call graph for this function:

int Phat32GetClusterLink ( NUTDEVICE dev,
uint32_t  clust,
uint32_t link 
)

Get link value of a specified cluster.

Parameters:
devSpecifies the file system device.
clustGet the link of this cluster.
linkPointer to a variable which will receive the link.
Returns:
0 on success or -1 on failure.

References _NUTDEVICE::dev_dcb, PHAT32CMASK, PHATEOC, PhatSectorBufferRelease(), PhatSectorLoad(), _PHATSECTBUF::sect_data, and _PHATVOL::vol_buf.

Referenced by Phat32ReleaseChain(), PhatFilePosSet(), PhatFileRead(), and PhatFileWrite().

Here is the call graph for this function:

int Phat32SetClusterLink ( NUTDEVICE dev,
uint32_t  clust,
uint32_t  link 
)

Set link value of a specified cluster.

Parameters:
devSpecifies the file system device.
clustThis cluster will be linked.
linkLink to this cluster.
Returns:
0 on success or -1 on failure.

References _NUTDEVICE::dev_dcb, PHAT32CMASK, PhatSectorBufferRelease(), PhatSectorLoad(), _PHATSECTBUF::sect_data, _PHATSECTBUF::sect_dirty, _PHATVOL::vol_buf, and _PHATVOL::vol_tab_sect.

Referenced by AllocFirstCluster(), and Phat32ReleaseChain().

Here is the call graph for this function:

int Phat32ReleaseChain ( NUTDEVICE dev,
uint32_t  first 
)

Release a cluster chain.

Parameters:
devSpecifies the file system device.
firstFirst cluster of the chain to release.
Returns:
0 on success or -1 on failure.

References _NUTDEVICE::dev_dcb, PHAT32CMASK, Phat32GetClusterLink(), Phat32SetClusterLink(), PHATEOC, and _PHATVOL::vol_numfree.

Referenced by PhatDirReleaseChain().

Here is the call graph for this function: