Share via


SDSetCardFeature

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

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

Syntax

SD_API_STATUS SDSetCardFeature(
  SD_DEVICE_HANDLE hDevice,
  SD_SET_FEATURE_TYPE CardFeature,
  PVOID pCardInfo,
  ULONG StructureSize
);

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.

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_FORCE_UTILIZATION

Always use Soft-Block. This value is for testing purposes only.

SD_SOFT_BLOCK_DEFAULT_UTILIZATION

Always use hardware multi-block operation if supported by the card, otherwise use 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_IS_FAST_PATH_AVAILABLE

Determines if Fast-Path is available in the SD bus driver.

SD_FAST_PATH_DISABLE

Disables the use of Fast-Path. This value is for testing purposes only.

SD_FAST_PATH_ENABLE

Enables the use of Fast-Path.

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.

SD_SET_CARD_INTERFACE_EX

Applies to Windows Embedded CE 6.0 R2

Allows a client driver to set the bus width, clock rate, and enable high speed 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. Note that this value is an extension for SD_CARD_INTERFACE.

SD_SET_SWITCH_FUNCTION

Applies to Windows Embedded CE 6.0 R2

Sets the SD card switch function.

SD_DMA_ALLOC_PHYS_MEM

Applies to Windows Embedded CE 6.0 R2

Allows a client driver to allocate a physical buffer with the given size and to take advantage of using direct memory access (DMA).

SD_DMA_FREE_PHYS_MEM

Applies to Windows Embedded CE 6.0 R2

Allows a client driver to free the DMA buffer that was allocated using SD_DMA_ALLOC_PHYS_MEM.

Return Value

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.

Requirements

Header sdcardddk.h
Library sdcardlib.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

Secure Digital Card Driver Functions