MityDSP Documentation Index
tcDspAta

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;
// create ATA access to compact flash device
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());
// 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);
...
}

  
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.