DCMD_SDMMC_CARD_REGISTER

Read a card register

Synopsis:

#include <hw/dcmd_sim_sdmmc.h>

#define DCMD_SDMMC_CARD_REGISTER   __DIOTF(_DCMD_CAM, _SIM_SDMMC + 4, struct _sdmmc_card_register)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device
dcmd DCMD_SDMMC_CARD_REGISTER
dev_data_ptr A pointer to a SDMMC_CARD_REGISTER structure that's followed by a buffer
n_bytes sizeof(SDMMC_CARD_REGISTER) plus the size of the buffer
dev_info_ptr NULL

Description:

The command reads a card register. The SDMMC_CARD_REGISTER structure is defined as follows:

typedef struct _sdmmc_card_register {
        uint32_t                action;
        uint32_t                type;
        uint32_t                address;
        uint32_t                length;
        uint32_t                rsvd[2];
/*      uint8_t                 data[ length ]; variable length data */
} SDMMC_CARD_REGISTER;

The members include:

action
The action to take; currently only SDMMC_CR_ACTION_READ is supported.
type
The register you want to read; one of:
  • SDMMC_REG_TYPE_CID — card ID
  • SDMMC_REG_TYPE_CSD — card-specific data
  • SDMMC_REG_TYPE_EXT_CSD — extended card-specific data (MMC devices only)
  • SDMMC_REG_TYPE_SCR — SD configuration register (SD devices only)

It's set to one of the following on return:

  • SDMMC_CARD_TYPE_UNKNOWN
  • SDMMC_CARD_TYPE_MMC
  • SDMMC_CARD_TYPE_SD
address
Not used.
length
Not used.

Input:

Set the action and type members.

Output:

The filled-in structure.

See also:

devctl() in the QNX Neutrino C Library Reference