DCMD_SDMMC_MAN_CMD

Updated: April 19, 2023

Send a manufacturer command to the device

Synopsis:

#include <hw/dcmd_sim_sdmmc.h>

#define DCMD_SDMMC_MAN_CMD	__DIOTF(_DCMD_CAM, _SIM_SDMMC + 13, struct _sdmmc_man_cmd)

Arguments to devctl():

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

Description:

This is a manufacturer command opcode that allows you to specify one of four specific manufacturer commands to send to the device. The meaning, expected input data, and output data for the specific command are defined by the manufacturer.

The SDMMC_MAN_CMD structure is defined as follows:

typedef struct _sdmmc_man_cmd {
        uint32_t                 flags;
        uint32_t                 arg;
        uint16_t                 blklen;
        uint16_t                 blkcnt;
/*      uint8_t                  data[0];        variable-length data */
} SDMMC_MAN_CMD;

The members include:

flags
On input, the flags needed to indicate:
  • the specific command to send, one of SDMMC_MANCMD_CMD1, SDMMC_MANCMD_CMD2, SDMMC_MANCMD_CMD3, or SDMMC_MANCMD_CMD4
  • whether this command has data, either SDMMC_MANCMD_ADTC if yes or SDMMC_MANCMD_AC if no
  • the data direction, either SDMMC_MANCMD_READ for reading or SDMMC_MANCMD_WRITE for writing
  • the response type, either SDMMC_MANCMD_R1 for R1 or SDMMC_MANCMD_R1b for R1b
  • whether there is a chained command, which is indicated by SDMMC_MANCMD_NEXT
The following masks can be used to extract individual bits:
  • SDMMC_MANCMD_TYPE for the bit that indicates whether the command has data
  • SDMMC_MANCMD_DIR for the data direction
  • SDMMC_MANCMD_RSP for the response type
arg
Additional command arguments, as defined by the manufacturer.
blklen
The length of the data field that follows this structure.
blkcnt
The number of data blocks.

Input:

Fill in the flags, arg, blklen, and blkcnt members. Any data that is to be sent to the device must be written into the data field that follows the command structure. The format of the data (i.e., the number of blocks and their contents) is specific to the exact manufacturer command being issued.

Output:

The buffer that data points to is filled with the response, and blklen is set to its length and blkcnt is set to the number of data blocks it contains. The contents and format of the data are manufacturer-specific.

See also:

devctl() in the QNX Neutrino C Library Reference