10.07.2015 Views

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>ATAWriteSectors -- Write logical drive sector(s)Description:Prototype:Inputs:Returns:Notes:This function writes one or more 512 byte sectors from a memory buffer onto the card or disk.short ATAWriteSectors(ATADvr iodvr, ulong sector, void *buffer, short count);ATADvr see following notesiodvr pointer to the physical device driversector first LBA sector to write*buffer pointer to memory containing data to writecount number of ATA_SECTOR_SIZE sectors to writeReturns-zero for success or ATA error bitsUse multi-sector writes for best performanceATA functions – Additional NotesInputs:Returns:typedef short (*ATADvr)(void *);All of the functions in the ATA group make use of an anonymous structure pointer of typeATADvr to translate from generic ATA operations to actual device I/O. This first parameter to allof the ATA functions must contain a valid ATADvr pointer from at least one call to anXXGetDriver() function. () function.All of the ATA functions return zero to indicate success, or a nonzero value to indicate some typeof failure. The exact interpretation of the failure code varies depending on the physical device,but for the CompactFlash, the bits in the lower byte identify one or more of the following errors,and the upper byte may contain extended error codes that are not documented here, but can befound in the card or disk manufacturers ATA technical manuals.0x80 card busy0x40 card not ready0x20 data request failure0x10 extended error request failed0x04 no media present0x0F operation failed to complete0x03 invalid argumentPERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.4 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!