MityDSP Documentation Index
tcDspMmc

Introduction

The tcDspMmc class is used to provide access to a standard MultiMedia card storage device via the MityDSP generic SPI interface. An instance of the tcDspSpi class, and an output latch selector and ID must be provided in the constructor.

See also:
MityDSP::tcDspSpi Class Reference
MityDSP::tcDspMmc Class Reference

Example

This is a simple example of tcDspMmc creation and usage:

{
unsigned int gnSPI_BASE_ADDR = 0xB0000200;
int bytes, myLatchID = 1;
char lpBuffer[1024];
tcDspOutputLatch MyClass::mpOutputLatch;
tcDspSpi *MyClass::mpSpi;
tcDspMmc *MyClass::mpMmc;
// create access to the SPI
mpSpi = new tcDspSpi((void *)gnSPI_BASE_ADDR);
// create access to MMC on SPI with provided CS latch
mpMmc = new tcDspMmc(mpSpi, mpOutputLatch, myLatchID);
tcDspError::report(<strong>FILE</strong>, <strong>LINE</strong>, status,
"MMC Device Size is %.1f KB",
mpMmc->getSizeKB());
// read 1K of data from sector 7
bytes = mpMmc->read(7, 0, (void *)lpBuffer, sizeof(lpBuffer));
// do something application-specific
...
// write 512 bytes to disk, at an offset of 2K into the MMC
bytes = mpMmc->write((void *)0x800, (void *)lpBuffer, 512);
...
}

  
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.