SdFat
|
Block cache. More...
#include <FatVolume.h>
Public Member Functions | |
cache_t * | block () |
void | dirty () |
void | init (FatVolume *vol) |
void | invalidate () |
bool | isDirty () |
uint32_t | lbn () |
cache_t * | read (uint32_t lbn, uint8_t option) |
bool | sync () |
Static Public Attributes | |
static const uint8_t | CACHE_FOR_READ = 0 |
static const uint8_t | CACHE_FOR_WRITE = CACHE_STATUS_DIRTY |
static const uint8_t | CACHE_OPTION_NO_READ = 4 |
static const uint8_t | CACHE_RESERVE_FOR_WRITE = CACHE_STATUS_DIRTY | CACHE_OPTION_NO_READ |
static const uint8_t | CACHE_STATUS_DIRTY = 1 |
static const uint8_t | CACHE_STATUS_MASK = CACHE_STATUS_DIRTY | CACHE_STATUS_MIRROR_FAT |
static const uint8_t | CACHE_STATUS_MIRROR_FAT = 2 |
Block cache.
|
inline |
|
inline |
Set current block dirty.
|
inline |
|
inline |
Invalidate current cache block.
|
inline |
|
inline |
cache_t * FatCache::read | ( | uint32_t | lbn, |
uint8_t | option | ||
) |
Read a block into the cache.
[in] | lbn | Block to read. |
[in] | option | mode for cached block. |
Copyright (c) 2011-2018 Bill Greiman This file is part of the SdFat library for SD memory cards.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bool FatCache::sync | ( | ) |
Write current block if dirty.
|
static |
Cache block for read.
|
static |
Cache block for write.
|
static |
Sync existing block but do not read new block.
|
static |
Reserve cache block for write - do not read from block device.
|
static |
Cached block is dirty
|
static |
Cache block status bits
|
static |
Cashed block is FAT entry and must be mirrored in second FAT.