MityDSP Documentation Index
tcDspFlash

Introduction

The tcDspFlash class may be used to write to and read from a Flash memory device. The tcDspFlash class probes the device, determines its geometry, and provides a common interface for accessing CFI-compliant flash devices.

See also:
MityDSP::tcDspFlash Class Reference
MityDSP::tcDspBankSelect Class Reference

Example

This is a simple example of tcDspFlash creation and usage:

{
const unsigned int FLASH_BASE_ADDR = 0x90000000;
const unsigned int BANK_SEL_ADDR = 0xB0000004;
// Initialize the tcDspBankSelector object for the flash device
tcDspBankSelect* mpBankSel = new tcDspBankSelect((void*)BANK_SEL_ADDR);
// Use the factory to obtain a base class pointer to the flash device
tcDspFlash* mpFlash = new tcDspFlash((void *)FLASH_BASE_ADDR, mpBankSel);
tcDspError::report(<strong>FILE</strong>, <strong>LINE</strong>, status,
"FLASH Device Size is %.1f KB",
mpFlash->getSizeKB());
// Can now access the flash as needed
mnLen = 0x100;
for (int i=0; i<mnLen; i++) mpBuffer[i] = i;
mpFlash->read(0x00002000, mpBuffer, mnLen);
:
:
newLen = mnLen + 0x200;
for (int i=mnLen; i<newLen; i++) mpBuffer[i] = i;
mpFlash->write(0x00004000, mpBuffer, newLen);
:
}

  
Generated on Mon Apr 22 2013 11:33:02 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.