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.
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; // create ATA access to compact flash device mpDiskAccess = new tcDspAta((void *)gnCF_BASE_ADDRESS, gnCF_DEVICE); tcDspError::report(__FILE__, __LINE__, status, "CompactFlash Disk Size is %.1f KB", mpDiskAccess->getSizeKB()); // read 1K of data from sector 7 bytes = mpDiskAccess->read(7, 0, (void *)lpBuffer, sizeof(lpBuffer)); // do something application-specific ... // write 512 bytes to disk, at an offset of 2K into the disk bytes = mpDiskAccess->write((void *)0x800, (void *)lpBuffer, 512); ... }