次の方法で共有


SDCardInfoQuery (Windows CE 5.0)

Send Feedback

This function retrieves specific card information.

SD_API_STATUS SDCardInfoQuery(  SD_DEVICE_HANDLEhHandle,
  SD_INFO_TYPEInfoType,
  PVOIDpCardInfo,
  ULONGStructureSize);

Parameters

  • hHandle
    [in] Handle to an SD bus device.
  • InfoType
    [in] Card information to retrieve.
  • pCardInfo
    [in, out] Pointer to a buffer to receive card information.
  • StructureSize
    [in] Size of the buffer pointed to by pCardInfo, in bytes.

The following table shows the valid values for InfoType and pCardInfo.

InfoType value pCardInfo value type Description
SD_INFO_REGISTER_CID SD_PARSED_REGISTER_CID Returns the parsed contents of the CID register. The raw CID data is made available at the end of the structure, SD_PARSED_REGISTER_CID.
SD_INFO_REGISTER_CSD SD_PARSED_REGISTER_CSD Returns the parsed contents of the CSD register. The raw CSD data is made available at the end of the structure, SD_PARSED_REGISTER_CSD.
SD_INFO_REGISTER_RCA SD_CARD_RCA Returns the RCA register of the card.
SD_INFO_CARD_INTERFACE SD_CARD_INTERFACE Returns information about the physical interface of the SD card.
SD_INFO_SDIO SDIO_CARD_INFO Returns information on an SDIO card.
SD_INFO_CARD_STATUS SD_CARD_STATUS Retrieves the SD card status by issuing SD command 13 to the card. This will cause the function call to block and must not be used in bus request or interrupt callback routines.
SD_INFO_HOST_IF_CAPABILITIES SD_CARD_INTERFACE Returns the host interface capabilities in a card interface structure. The ClockRate member indicates the maximum clock rate. The InterfaceMode member defines the highest bus width of which the host is capable.
SD_INFO_HOST_BLOCK_CAPABILITY SD_HOST_BLOCK_CAPABILITY Checks whether the requested block capabilities are supported by the host controller driver. The structure passed will be updated with block capabilities that closely match those requested.

Return Values

Returns a value of type SD_API_STATUS that indicates success or failure.

Remarks

For the CSD and CID registers, this function performs full parsing of the register data. Data for these registers is returned to the client driver in the structure, SD_PARSED_REGISTER_XXX.

From the parsed structure, the client driver is able, for example, to obtain the StructureSize of a memory card without having to extract several bit fields from the raw register data.

For both CSD and CID registers, all 128 bits of raw register data is included within the parsed register structure.

In addition to accessing register data, this function can also return information about the physical interface of a card, and its current status.

The interface query can be performed by passing an InfoType value of SD_INFO_CARD_INTERFACE**.** The query returns information describing the physical connection used to access the card, including the clock rate, and whether the interface is 1-bit or 4-bit.

The card status is obtained by passing an InfoType value of SD_INFO_CARD_STATUS. This will return the 32-bit status word for the peripheral card. This query internally performs a synchronous bus request to obtain the card status. Because of this, the card status query must not be performed within the callback of an asynchronous bus request.

This function can also be used to query SDIO information for SDIO clients, and to query information about a host.

SD register data is retrieved either as a portion of the response by a bus request or as separate data buffers from a bus request. The high-bit byte varies depending on the method of retrieval. If register data is retrieved through a response by a bus request, the high-bit is in the highest byte. For example, byte 5 contains bit 47 and byte 0 contains bit 0. If register data is retrieved using a data buffer, the high-bit is stored in the lowest byte.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Sdcardddk.h.
Link Library: Sdcardlib.lib.

See Also

Secure Digital Card Driver Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.