Partager via


SDSetCardFeature (Windows CE 5.0)

Send Feedback

This function sets various SDIO card features in a thread-safe manner.

SD_API_STATUS SDSetCardFeature(SD_DEVICE_HANDLEhDevice,
  SD_SET_FEATURE_TYPECardFeature,
  PVOIDpCardInfo,
  ULONGStructureSize);

Parameters

  • hDevice
    [in] Handle to an SD bus device.
  • CardFeature
    [in] Card feature to set.
  • pCardInfo
    [in] Buffer containing new data for the feature.
  • StructureSize
    [in] Size of the pCardInfo structure.

The following table shows the possible values for the CardFeature and pCardInfo parameters.

CardFeature value Description
SD_IO_FUNCTION_ENABLE Enables the current function. The SD_IO_FUNCTION_ENABLE_INFO value defines a retry interval and maximum retry count to check for correct function activation.
SD_IO_FUNCTION_DISABLE Disables the current function.
SD_IO_FUNCTION_SET_BLOCK_SIZE Sets the block size for the IO_RW_EXTENDED command.
SD_SET_DATA_TRANSFER_CLOCKS Sets the current read/write data access delay used by a host controller driver when calculating an appropriate read or write data timeout. This value is optional, and a client driver can rely on the host controller driver to implement proper timeouts.
SD_SET_CARD_INTERFACE Allows a client driver to set the bus width and clock rate for a card. The client driver should first query the host interface capabilities The ClockRate field will be modified by the host controller driver to reflect the actual clock rate used. The client driver should not assume that it can set an exact clock rate.

Return Values

A return value of type SD_API_STATUS indicates the success or failure.

Remarks

This function is provided to set various SDIO card features in a thread-safe manner. SDIO cards utilize shared register sets between functions. This requires that the register state be preserved between functions that can be controlled in separate thread contexts. This function can block by issuing synchronous bus request.

Note   This function must not be called from a bus request callback.

Windows Mobile Remarks

The following table shows additonal values that the CardFeature and pCardInfo parameters can be set to for Windows Mobile-based devices.

CardFeatureValue Description
SD_SET_CLOCK_STATE_DURING_IDLE Sets the clock state during the idle state.
SD_IS_SOFT_BLOCK_AVAILABLE Determines if Soft-Block is available in the SD bus driver.
SD_SOFT_BLOCK_ALWAYS_ON Always use Soft-Block. This value is for testing purposes only.
SD_SOFT_BLOCK_ENABLE Enables use of Soft-Block.
SD_CARD_SELECT_REQUEST Requests the card to be selected.
SD_CARD_DESELECT_REQUEST Requests the card to be deselected.
SD_CARD_FORCE_RESET Forces the card to be reset.
SD_IO_FUNCTION_HIGH_POWER Selects high power mode for function.
SD_IO_FUNCTION_LOW_POWER Selects low power mode for function.
SD_INFO_POWER_CONTROL_STATE Retrieves the power state of a function.

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.