DCMD_MMCSD_CARD_REGISTER

Read a card register

Synopsis:

#include <hw/dcmd_sim_mmcsd.h>

#define DCMD_MMCSD_CARD_REGISTER   __DIOTF(_DCMD_CAM, _SIM_MMCSD + 4, struct _mmcsd_card_register)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device
dcmd DCMD_MMCSD_CARD_REGISTER
dev_data_ptr A pointer to an MMCSD_CARD_REGISTER structure, followed by additional data
n_bytes sizeof(MMCSD_CARD_REGISTER) plus the size of the additional data
dev_info_ptr NULL

Description:

This command reads a card register.

The MMCSD_CARD_REGISTER structure is defined as follows:

typedef struct _mmcsd_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 */
} MMCSD_CARD_REGISTER;

The members include:

action
The action to take. The only currently defined action is:
  • MMCSD_CR_ACTION_READ — read the register
type
The type of register to read; one of the following:
  • MMCSD_REG_TYPE_CID — card ID
  • MMCSD_REG_TYPE_CSD — card-specific data
  • MMCSD_REG_TYPE_EXT_CSD — extended card-specific data (MMC devices only)
  • MMCSD_REG_TYPE_SCR — SD Configuration Register (SD devices only)
address
Not used.
length
Not used.

Input:

Set the action and type members as necessary.

Output:

The type member is set to a CARD_TYPE_* on return.

See also:

devctl() in the QNX Neutrino C Library Reference