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;
mpSpi = new tcDspSpi((void *)gnSPI_BASE_ADDR);
mpMmc = new tcDspMmc(mpSpi, mpOutputLatch, myLatchID);
tcDspError::report(<strong>FILE</strong>, <strong>LINE</strong>,
status,
"MMC Device Size is %.1f KB",
mpMmc->getSizeKB());
bytes = mpMmc->read(7, 0, (void *)lpBuffer, sizeof(lpBuffer));
...
bytes = mpMmc->write((void *)0x800, (void *)lpBuffer, 512);
...
}