Repetier-Firmware
0.91
|
Access FAT16 and FAT32 volumes on SD and SDHC cards. More...
#include <SdFat.h>
Public Member Functions | |
SdVolume () | |
cache_t * | cacheClear () |
bool | init (Sd2Card *dev) |
bool | init (Sd2Card *dev, uint8_t part) |
uint8_t | blocksPerCluster () const |
uint32_t | blocksPerFat () const |
uint32_t | clusterCount () const |
uint8_t | clusterSizeShift () const |
uint32_t | dataStartBlock () const |
uint8_t | fatCount () const |
uint32_t | fatStartBlock () const |
uint8_t | fatType () const |
int32_t | freeClusterCount () |
uint32_t | rootDirEntryCount () const |
uint32_t | rootDirStart () const |
Sd2Card * | sdCard () |
bool | dbgFat (uint32_t n, uint32_t *v) |
Private Member Functions | |
cache_t * | cacheAddress () |
uint32_t | cacheBlockNumber () |
bool | allocContiguous (uint32_t count, uint32_t *curCluster) |
uint8_t | blockOfCluster (uint32_t position) const |
uint32_t | clusterStartBlock (uint32_t cluster) const |
bool | 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 |
bool | readBlock (uint32_t block, uint8_t *dst) |
bool | writeBlock (uint32_t block, const uint8_t *dst) |
Static Private Member Functions | |
static cache_t * | cacheFetch (uint32_t blockNumber, uint8_t options) |
static cache_t * | cacheFetchData (uint32_t blockNumber, uint8_t options) |
static cache_t * | cacheFetchFat (uint32_t blockNumber, uint8_t options) |
static void | cacheInvalidate () |
static bool | cacheSync () |
static bool | cacheWriteData () |
static bool | cacheWriteFat () |
Private Attributes | |
uint32_t | allocSearchStart_ |
uint8_t | blocksPerCluster_ |
uint32_t | blocksPerFat_ |
uint32_t | clusterCount_ |
uint8_t | clusterSizeShift_ |
uint32_t | dataStartBlock_ |
uint8_t | fatCount_ |
uint32_t | fatStartBlock_ |
uint8_t | fatType_ |
uint16_t | rootDirEntryCount_ |
uint32_t | rootDirStart_ |
Static Private Attributes | |
static const uint8_t | CACHE_STATUS_DIRTY = 1 |
static const uint8_t | CACHE_STATUS_FAT_BLOCK = 2 |
static const uint8_t | CACHE_STATUS_MASK = CACHE_STATUS_DIRTY | CACHE_STATUS_FAT_BLOCK |
static const uint8_t | CACHE_OPTION_NO_READ = 4 |
static uint8_t const | CACHE_FOR_READ = 0 |
static uint8_t const | CACHE_FOR_WRITE = CACHE_STATUS_DIRTY |
static uint8_t const | CACHE_RESERVE_FOR_WRITE = CACHE_STATUS_DIRTY | CACHE_OPTION_NO_READ |
static cache_t | cacheBuffer_ |
static uint32_t | cacheBlockNumber_ |
static uint32_t | cacheFatOffset_ |
static uint8_t | cacheStatus_ |
static Sd2Card * | sdCard_ |
Friends | |
class | SdBaseFile |
Access FAT16 and FAT32 volumes on SD and SDHC cards.
bool allocContiguous | ( | uint32_t | count, |
uint32_t * | curCluster | ||
) | [private] |
uint8_t blockOfCluster | ( | uint32_t | position | ) | const [inline, private] |
uint8_t blocksPerCluster | ( | ) | const [inline] |
uint32_t blocksPerFat | ( | ) | const [inline] |
cache_t* cacheAddress | ( | ) | [inline, private] |
uint32_t cacheBlockNumber | ( | ) | [inline, private] |
cache_t* cacheClear | ( | ) | [inline] |
Clear the cache and returns a pointer to the cache. Used by the WaveRP recorder to do raw write to the SD card. Not for normal apps.
static cache_t* cacheFetch | ( | uint32_t | blockNumber, |
uint8_t | options | ||
) | [static, private] |
static cache_t* cacheFetchData | ( | uint32_t | blockNumber, |
uint8_t | options | ||
) | [static, private] |
static cache_t* cacheFetchFat | ( | uint32_t | blockNumber, |
uint8_t | options | ||
) | [static, private] |
static void cacheInvalidate | ( | ) | [static, private] |
static bool cacheSync | ( | ) | [static, private] |
static bool cacheWriteData | ( | ) | [static, private] |
static bool cacheWriteFat | ( | ) | [static, private] |
uint32_t clusterCount | ( | ) | const [inline] |
uint8_t clusterSizeShift | ( | ) | const [inline] |
uint32_t clusterStartBlock | ( | uint32_t | cluster | ) | const [private] |
uint32_t dataStartBlock | ( | ) | const [inline] |
bool dbgFat | ( | uint32_t | n, |
uint32_t * | v | ||
) | [inline] |
Debug access to FAT table
[in] | n | cluster number. |
[out] | v | value of entry |
uint8_t fatCount | ( | ) | const [inline] |
bool fatGet | ( | uint32_t | cluster, |
uint32_t * | value | ||
) | [private] |
bool fatPut | ( | uint32_t | cluster, |
uint32_t | value | ||
) | [private] |
bool fatPutEOC | ( | uint32_t | cluster | ) | [inline, private] |
uint32_t fatStartBlock | ( | ) | const [inline] |
uint8_t fatType | ( | ) | const [inline] |
bool freeChain | ( | uint32_t | cluster | ) | [private] |
int32_t freeClusterCount | ( | ) |
Initialize a FAT volume. Try partition one first then try super floppy format.
[in] | dev | The Sd2Card where the volume is located. |
bool isEOC | ( | uint32_t | cluster | ) | const [inline, private] |
bool readBlock | ( | uint32_t | block, |
uint8_t * | dst | ||
) | [inline, private] |
uint32_t rootDirEntryCount | ( | ) | const [inline] |
uint32_t rootDirStart | ( | ) | const [inline] |
bool writeBlock | ( | uint32_t | block, |
const uint8_t * | dst | ||
) | [inline, private] |
friend class SdBaseFile [friend] |
uint32_t allocSearchStart_ [private] |
uint8_t blocksPerCluster_ [private] |
uint32_t blocksPerFat_ [private] |
uint8_t const CACHE_FOR_READ = 0 [static, private] |
uint8_t const CACHE_FOR_WRITE = CACHE_STATUS_DIRTY [static, private] |
const uint8_t CACHE_OPTION_NO_READ = 4 [static, private] |
uint8_t const CACHE_RESERVE_FOR_WRITE = CACHE_STATUS_DIRTY | CACHE_OPTION_NO_READ [static, private] |
const uint8_t CACHE_STATUS_DIRTY = 1 [static, private] |
const uint8_t CACHE_STATUS_FAT_BLOCK = 2 [static, private] |
const uint8_t CACHE_STATUS_MASK = CACHE_STATUS_DIRTY | CACHE_STATUS_FAT_BLOCK [static, private] |
uint32_t cacheBlockNumber_ [static, private] |
cache_t cacheBuffer_ [static, private] |
uint32_t cacheFatOffset_ [static, private] |
uint8_t cacheStatus_ [static, private] |
uint32_t clusterCount_ [private] |
uint8_t clusterSizeShift_ [private] |
uint32_t dataStartBlock_ [private] |
uint8_t fatCount_ [private] |
uint32_t fatStartBlock_ [private] |
uint8_t fatType_ [private] |
uint16_t rootDirEntryCount_ [private] |
uint32_t rootDirStart_ [private] |