Get card-specific data
#include <hw/dcmd_sim_mmcsd.h> #define DCMD_MMCSD_GET_CSD __DIOTF(_DCMD_CAM, _SIM_MMCSD + 2, struct _mmcsd_csd)
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening the device |
dcmd | DCMD_MMCSD_GET_CSD |
dev_data_ptr | A pointer to a MMCSD_CSD structure (see below) |
n_bytes | sizeof(MMCSD_CSD) |
dev_info_ptr | NULL |
This command gets card-specific data.
None.
A filled-in MMCSD_CSD structure:
typedef struct _mmc_csd_ext { uint32_t hs_max_dtr; uint32_t sectors; uint8_t erase_grp_def; uint8_t hc_erase_group_size; uint8_t hc_wp_grp_size; uint8_t user_wp; } MMC_CSD_EXT; typedef struct _mmcsd_csd { uint32_t flags; uint8_t rsvd[4]; union { struct { uint8_t csd_structure; /* CSD structure */ uint8_t taac; uint8_t nsac; uint8_t tran_speed; uint16_t ccc; uint8_t read_bl_len; uint8_t read_bl_partial; uint8_t write_blk_misalign; uint8_t read_blk_misalign; uint8_t dsr_imp; union { struct { uint16_t c_size; uint8_t vdd_r_curr_min; uint8_t vdd_r_curr_max; uint8_t vdd_w_curr_min; uint8_t vdd_w_curr_max; uint8_t c_size_mult; } csd_ver1; struct { uint32_t c_size; } csd_ver2; }csd; uint8_t erase_blk_en; uint8_t sector_size; uint8_t wp_grp_size; uint8_t wp_grp_enable; uint8_t r2w_factor; uint8_t write_bl_len; uint8_t write_bl_partial; uint8_t file_format_grp; uint8_t copy; uint8_t perm_write_protect; uint8_t tmp_write_protect; uint8_t file_format; } sd_csd; struct { uint8_t csd_structure; /* CSD structure */ uint8_t mmc_prot; uint8_t taac; uint8_t nsac; uint8_t tran_speed; uint16_t ccc; uint8_t read_bl_len; uint8_t read_bl_partial; uint8_t write_blk_misalign; uint8_t read_blk_misalign; uint8_t dsr_imp; uint16_t c_size; uint8_t vdd_r_curr_min; uint8_t vdd_r_curr_max; uint8_t vdd_w_curr_min; uint8_t vdd_w_curr_max; uint8_t c_size_mult; union { struct { /* MMC system specification version 3.1 */ uint8_t erase_grp_size; uint8_t erase_grp_mult; } mmc_v31; struct { /* MMC system specification version 2.2 */ uint8_t sector_size; uint8_t erase_grp_size; } mmc_v22; } erase; MMC_CSD_EXT ext_csd; uint8_t wp_grp_size; uint8_t wp_grp_enable; uint8_t r2w_factor; uint8_t write_bl_len; uint8_t write_bl_partial; /* uint8_t file_format_grp; */ uint8_t copy; uint8_t perm_write_protect; uint8_t tmp_write_protect; uint8_t ecc; } mmc_csd; } csd; pid_t pid; /* Store PID of driver process for this device */ uint8_t csd_version; /* CSD structure version */ uint8_t mmcprot_version; /* MMC proto version */ uint8_t type; /* card type, MMC or SD for now */ } MMCSD_CSD;
devctl() in the QNX Neutrino C Library Reference