Introduction
The tcDspStorageProxy class is used to provide an interface to an underlying device derived from the tcDspStorageBase class. This is useful for using a small portion of a large-sector device for something like a FAT filesystem.
Using a device in this manner can cause multiple read-modify-write cycles, slowing performance and potentially wearing out the device prematurely. This can be mitigated by inserting an instance of tcDspStorageCache between the device and tcDspStorageProxy.
- See also:
- MityDSP::tcDspStorageBase Class Reference
-
MityDSP::tcDspStorageProxy Class Reference
Example
This is a simple example of tcDspStorageProxy creation and usage:
{
tcDspBankSelect *MyClass::mpBankSel;
tcDspFlash *MyClass::mpFlash;
tcDspStorageCache *MyClass::mpCache;
tcDspStorageProxy *MyClass::mpProxy;
tcDspConfig *lpConfig;
tsDevInfo device;
mpBankSel = new tcDspBankSelect((void*)0xB0000004);
mpFlash = new tcDspFlash((void *)0x90000000, mpBankSel);
lpConfig = tcDspConfig::GetInstance(mpFlash);
mpCache = new tcDspStorageCache(mpFlash, 4);
mpProxy = new tcDspStorageProxy(mpCache, (void *)lpConfig->GetAppDataOffset(),
lpConfig->GetAppDataSize());
rv = RegisterFATDriver((RAWREAD)tcDspStorageBase::readDispatch,
(RAWWRITE)tcDspStorageBase::writeDispatch,
(GETTIME)NULL, &device, "C", (void *)mpProxy);
...
}