Share via


SDReadWriteRegistersDirect (Compact 2013)

3/26/2014

This function reads from or writes to the registers of a secure digital input output (SDIO) card.

Syntax

SD_API_STATUS SDReadWriteRegistersDirect(
  SD_DEVICE_HANDLE hDevice,
  SD_IO_TRANSFER_TYPE ReadWrite,
  UCHAR Function,
  DWORD Address,
  BOOLEAN ReadAfterWrite,
  PUCHAR pBuffer,
  ULONG BufferLength
);

Parameters

  • hDevice
    [in] Handle to a secure digital (SD) bus device.
  • ReadWrite
    [in] Value that indicates whether to read from or write to the registers of an SDIO card. A value of SD_IO_READ indicates a read operation. A value of SD_IO_WRITE indicates a write operation.
  • Function
    [in] Function number.
  • Address
    [in] Starting register address for the read or write operation.
  • ReadAfterWrite
    [in] Value that indicates whether to perform a read operation following a write operation. If set to TRUE, a read is performed following a write operation. The read data is returned in pBuffer.
  • pBuffer
    [in, out] Buffer to hold register data.
  • BufferLength
    [in] Number of bytes to read or write.

Return Value

A return value of type SD_API_STATUS indicates success or failure.

Remarks

Direct I/O is intended for simple register access and requires a significant amount of overhead for each byte transferred. The preferred method for transferring large amounts of data is through the extended I/O command.

Requirements

Header

sdcardddk.h

Library

sdcardlib.lib

See Also

Reference

Secure Digital (SD) Card Driver Functions