xiaoxiang781216 commented on code in PR #8922: URL: https://github.com/apache/nuttx/pull/8922#discussion_r1152243523
########## drivers/mmcsd/mmcsd_sdio.h: ########## @@ -41,11 +68,11 @@ #define MMCSD_CMD8VOLTAGE_SHIFT (8) /* Bits 8-11: Supply voltage */ #define MMCSD_CMD8VOLTAGE_MASK ((uint32_t)0x0f << MMCSD_CMD8VOLTAGE_SHIFT) -# define MMCSD_CMD8VOLTAGE_27 ((uint32_t)0x01 << MMCSD_CMD8VOLTAGE_SHIFT) /* 2.7-3.6V */ +#define MMCSD_CMD8VOLTAGE_27 ((uint32_t)0x01 << MMCSD_CMD8VOLTAGE_SHIFT) /* 2.7-3.6V */ #define MMCSD_CMD8ECHO_SHIFT (0) /* Bits 0-7: Check pattern */ #define MMCSD_CMD8ECHO_MASK ((uint32_t)0xff << MMCSD_CMD8ECHO_SHIFT) -# define MMCSD_CMD8CHECKPATTERN ((uint32_t)0xaa << MMCSD_CMD8ECHO_SHIFT) Review Comment: why remove the Indentation? ########## drivers/mmcsd/mmcsd_sdio.h: ########## @@ -32,6 +32,33 @@ * Pre-processor Definitions ****************************************************************************/ +/* CMD6 (MMC_SWITCH) argument + * MMC_SWITCH argument format: + * + * [31:26] Always 0 + * [25:24] Access Mode + * [23:16] Location of target Byte in EXT_CSD + * [15:08] Value Byte + * [07:03] Always 0 + * [02:00] Command Set + */ +#define MMCSD_CMD6_BUSWIDTH_RWSHIFT (16) +#define MMCSD_CMD6_BUSWIDTH_RW ((uint32_t)0xb7 << MMCSD_CMD6_BUSWIDTH_RWSHIFT) /* R/W */ + +#define MMCSD_CMD6_WRITE_BYTE_SHIFT (24) + +#define MMCSD_CMD6_MODE_CMD_SET ((uint32_t)0x00 << MMCSD_CMD6_WRITE_BYTE_SHIFT) /* Change the command set */ Review Comment: add intent ########## drivers/mmcsd/mmcsd_sdio.h: ########## @@ -32,6 +32,33 @@ * Pre-processor Definitions ****************************************************************************/ +/* CMD6 (MMC_SWITCH) argument + * MMC_SWITCH argument format: + * + * [31:26] Always 0 + * [25:24] Access Mode + * [23:16] Location of target Byte in EXT_CSD + * [15:08] Value Byte + * [07:03] Always 0 + * [02:00] Command Set + */ +#define MMCSD_CMD6_BUSWIDTH_RWSHIFT (16) +#define MMCSD_CMD6_BUSWIDTH_RW ((uint32_t)0xb7 << MMCSD_CMD6_BUSWIDTH_RWSHIFT) /* R/W */ Review Comment: add intent ########## drivers/mmcsd/mmcsd_sdio.h: ########## @@ -32,6 +32,33 @@ * Pre-processor Definitions ****************************************************************************/ +/* CMD6 (MMC_SWITCH) argument + * MMC_SWITCH argument format: + * + * [31:26] Always 0 + * [25:24] Access Mode + * [23:16] Location of target Byte in EXT_CSD + * [15:08] Value Byte + * [07:03] Always 0 + * [02:00] Command Set + */ +#define MMCSD_CMD6_BUSWIDTH_RWSHIFT (16) +#define MMCSD_CMD6_BUSWIDTH_RW ((uint32_t)0xb7 << MMCSD_CMD6_BUSWIDTH_RWSHIFT) /* R/W */ + +#define MMCSD_CMD6_WRITE_BYTE_SHIFT (24) + +#define MMCSD_CMD6_MODE_CMD_SET ((uint32_t)0x00 << MMCSD_CMD6_WRITE_BYTE_SHIFT) /* Change the command set */ +#define MMCSD_CMD6_MODE_SET_BITS ((uint32_t)0x01 << MMCSD_CMD6_WRITE_BYTE_SHIFT) /* Set bits which are 1 in value */ +#define MMCSD_CMD6_MODE_CLEAR_BITS ((uint32_t)0x02 << MMCSD_CMD6_WRITE_BYTE_SHIFT) /* Clear bits which are 1 in value */ +#define MMCSD_CMD6_MODE_WRITE_BYTE ((uint32_t)0x03 << MMCSD_CMD6_WRITE_BYTE_SHIFT) /* Set target to value */ + +#define MMCSD_CMD6_BUS_WIDTH_SHIFT (8) +#define MMCSD_CMD6_BUS_WIDTH_1 ((uint32_t)0x00 << MMCSD_CMD6_BUS_WIDTH_SHIFT) /* Card is in 1 bit mode */ Review Comment: ditto -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org