Sector cache.
More...
#include <FsCache.h>
◆ FsCache()
◆ cacheBuffer()
uint8_t * FsCache::cacheBuffer |
( |
| ) |
|
|
inline |
- Returns
- Cache buffer address.
◆ cacheSafeRead() [1/2]
bool FsCache::cacheSafeRead |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst |
|
) |
| |
|
inline |
Cache safe read of a sector.
- Parameters
-
[in] | sector | Logical sector to be read. |
[out] | dst | Pointer to the location that will receive the data. |
- Returns
- true for success or false for failure.
◆ cacheSafeRead() [2/2]
bool FsCache::cacheSafeRead |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst, |
|
|
size_t |
count |
|
) |
| |
|
inline |
Cache safe read of multiple sectors.
- Parameters
-
[in] | sector | Logical sector to be read. |
[in] | count | Number of sectors to be read. |
[out] | dst | Pointer to the location that will receive the data. |
- Returns
- true for success or false for failure.
◆ cacheSafeWrite() [1/2]
bool FsCache::cacheSafeWrite |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
src |
|
) |
| |
|
inline |
Cache safe write of a sectors.
- Parameters
-
[in] | sector | Logical sector to be written. |
[in] | src | Pointer to the location of the data to be written. |
- Returns
- true for success or false for failure.
◆ cacheSafeWrite() [2/2]
bool FsCache::cacheSafeWrite |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
src, |
|
|
size_t |
count |
|
) |
| |
|
inline |
Cache safe write of multiple sectors.
- Parameters
-
[in] | sector | Logical sector to be written. |
[in] | src | Pointer to the location of the data to be written. |
[in] | count | Number of sectors to be written. |
- Returns
- true for success or false for failure.
◆ clear()
uint8_t * FsCache::clear |
( |
| ) |
|
|
inline |
- Returns
- Clear the cache and returns a pointer to the cache.
◆ dirty()
Set current sector dirty.
◆ init()
Initialize the cache.
- Parameters
-
[in] | blockDev | Block device for this cache. |
◆ invalidate()
void FsCache::invalidate |
( |
| ) |
|
|
inline |
Invalidate current cache sector.
◆ isCached() [1/2]
bool FsCache::isCached |
( |
uint32_t |
sector | ) |
const |
|
inline |
Check if a sector is in the cache.
- Parameters
-
[in] | sector | Sector to checked. |
- Returns
- true if the sector is cached.
◆ isCached() [2/2]
bool FsCache::isCached |
( |
uint32_t |
sector, |
|
|
size_t |
count |
|
) |
| |
|
inline |
Check if the cache contains a sector from a range.
- Parameters
-
[in] | sector | Start sector of the range. |
[in] | count | Number of sectors in the range. |
- Returns
- true if a sector in the range is cached.
◆ isDirty()
bool FsCache::isDirty |
( |
| ) |
|
|
inline |
◆ prepare()
uint8_t * FsCache::prepare |
( |
uint32_t |
sector, |
|
|
uint8_t |
option |
|
) |
| |
Prepare cache to access sector.
- Parameters
-
[in] | sector | Sector to read. |
[in] | option | mode for cached sector. |
- Returns
- Address of cached sector.
◆ sector()
uint32_t FsCache::sector |
( |
| ) |
|
|
inline |
- Returns
- Logical sector number for cached sector.
◆ setMirrorOffset()
void FsCache::setMirrorOffset |
( |
uint32_t |
offset | ) |
|
|
inline |
Set the offset to the second FAT for mirroring.
- Parameters
-
[in] | offset | Sector offset to second FAT. |
◆ sync()
Write current sector if dirty.
- Returns
- true for success or false for failure.
◆ CACHE_FOR_READ
const uint8_t FsCache::CACHE_FOR_READ = 0 |
|
static |
◆ CACHE_FOR_WRITE
◆ CACHE_OPTION_NO_READ
const uint8_t FsCache::CACHE_OPTION_NO_READ = 4 |
|
static |
Sync existing sector but do not read new sector.
◆ CACHE_RESERVE_FOR_WRITE
const uint8_t FsCache::CACHE_RESERVE_FOR_WRITE |
|
static |
Initial value:=
static const uint8_t CACHE_STATUS_DIRTY
Definition: FsCache.h:40
static const uint8_t CACHE_OPTION_NO_READ
Definition: FsCache.h:47
Reserve cache sector for write - do not read from sector device.
◆ CACHE_STATUS_DIRTY
const uint8_t FsCache::CACHE_STATUS_DIRTY = 1 |
|
static |
◆ CACHE_STATUS_MASK
const uint8_t FsCache::CACHE_STATUS_MASK |
|
static |
Initial value:=
static const uint8_t CACHE_STATUS_MIRROR_FAT
Definition: FsCache.h:42
Cache sector status bits
◆ CACHE_STATUS_MIRROR_FAT
const uint8_t FsCache::CACHE_STATUS_MIRROR_FAT = 2 |
|
static |
Cashed sector is FAT entry and must be mirrored in second FAT.
The documentation for this class was generated from the following files:
- ArduinoSdFat/libraries/SdFat/src/common/FsCache.h
- ArduinoSdFat/libraries/SdFat/src/common/FsCache.cpp