Updated: October 28, 2024 |
Send a manufacturer command to the device
#include <hw/dcmd_sim_sdmmc.h> #define DCMD_SDMMC_MAN_CMD __DIOTF(_DCMD_CAM, _SIM_SDMMC + 13, struct _sdmmc_man_cmd)
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 |
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:
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.
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.
devctl() in the QNX Neutrino C Library Reference