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.
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; // create access to FLASH mpBankSel = new tcDspBankSelect((void*)0xB0000004); mpFlash = new tcDspFlash((void *)0x90000000, mpBankSel); // point to configuration data (to get user data offset) lpConfig = tcDspConfig::GetInstance(mpFlash); // create a cache and insert it in front of the FLASH object mpCache = new tcDspStorageCache(mpFlash, 4); // create a 512-byte sector proxy and insert in front of cache mpProxy = new tcDspStorageProxy(mpCache, (void *)lpConfig->GetAppDataOffset(), lpConfig->GetAppDataSize()); // use the proxy just like the underlying device... // for instance... rv = RegisterFATDriver((RAWREAD)tcDspStorageBase::readDispatch, (RAWWRITE)tcDspStorageBase::writeDispatch, (GETTIME)NULL, &device, "C", (void *)mpProxy); ... }