Introduction
The tcDspAta class is used for low-level reading and writing to ATA storage devices such as disk drives or CompactFlash cards. Filesystems and data cache must be provided at a higher level, although these routines may be used for simple read/write access to a device.
- See also:
- MityDSP::tcDspAta Class Reference
Example
This is a simple example of tcDspAta creation and usage:
{
const unsigned int gnCF_BASE_ADDRESS = 0xB0000500;
const int gnCF_DEVICE = 0;
tcDspAta *mpDiskAccess;
char lpBuffer[1024];
int bytes;
mpDiskAccess = new tcDspAta((void *)gnCF_BASE_ADDRESS, gnCF_DEVICE);
tcDspError::report(<strong>FILE</strong>, <strong>LINE</strong>,
status,
"CompactFlash Disk Size is %.1f KB",
mpDiskAccess->getSizeKB());
bytes = mpDiskAccess->read(7, 0, (void *)lpBuffer, sizeof(lpBuffer));
...
bytes = mpDiskAccess->write((void *)0x800, (void *)lpBuffer, 512);
...
}