STM3210C_EVAL BSP User Manual: STM3210C EVAL SD Private Defines

STM3210C_EVAL BSP

STM3210C_EVAL BSP User Manual
STM3210C EVAL SD Private Defines

Defines

#define SD_DUMMY_BYTE   0xFF
#define SD_MAX_FRAME_LENGTH   17 /* Lenght = 16 + 1 */
#define SD_CMD_LENGTH   6
#define SD_MAX_TRY   100 /* Number of try */
#define SD_CSD_STRUCT_V1   0x2 /* CSD struct version V1 */
#define SD_CSD_STRUCT_V2   0x1 /* CSD struct version V2 */
#define SD_TOKEN_START_DATA_SINGLE_BLOCK_READ   0xFE /* Data token start byte, Start Single Block Read */
 Start Data tokens: Tokens (necessary because at nop/idle (and CS active) only 0xff is on the data/command line)
#define SD_TOKEN_START_DATA_MULTIPLE_BLOCK_READ   0xFE /* Data token start byte, Start Multiple Block Read */
#define SD_TOKEN_START_DATA_SINGLE_BLOCK_WRITE   0xFE /* Data token start byte, Start Single Block Write */
#define SD_TOKEN_START_DATA_MULTIPLE_BLOCK_WRITE   0xFD /* Data token start byte, Start Multiple Block Write */
#define SD_TOKEN_STOP_DATA_MULTIPLE_BLOCK_WRITE   0xFD /* Data toke stop byte, Stop Multiple Block Write */
#define SD_CMD_GO_IDLE_STATE   0 /* CMD0 = 0x40 */
 Commands: CMDxx = CMD-number | 0x40.
#define SD_CMD_SEND_OP_COND   1 /* CMD1 = 0x41 */
#define SD_CMD_SEND_IF_COND   8 /* CMD8 = 0x48 */
#define SD_CMD_SEND_CSD   9 /* CMD9 = 0x49 */
#define SD_CMD_SEND_CID   10 /* CMD10 = 0x4A */
#define SD_CMD_STOP_TRANSMISSION   12 /* CMD12 = 0x4C */
#define SD_CMD_SEND_STATUS   13 /* CMD13 = 0x4D */
#define SD_CMD_SET_BLOCKLEN   16 /* CMD16 = 0x50 */
#define SD_CMD_READ_SINGLE_BLOCK   17 /* CMD17 = 0x51 */
#define SD_CMD_READ_MULT_BLOCK   18 /* CMD18 = 0x52 */
#define SD_CMD_SET_BLOCK_COUNT   23 /* CMD23 = 0x57 */
#define SD_CMD_WRITE_SINGLE_BLOCK   24 /* CMD24 = 0x58 */
#define SD_CMD_WRITE_MULT_BLOCK   25 /* CMD25 = 0x59 */
#define SD_CMD_PROG_CSD   27 /* CMD27 = 0x5B */
#define SD_CMD_SET_WRITE_PROT   28 /* CMD28 = 0x5C */
#define SD_CMD_CLR_WRITE_PROT   29 /* CMD29 = 0x5D */
#define SD_CMD_SEND_WRITE_PROT   30 /* CMD30 = 0x5E */
#define SD_CMD_SD_ERASE_GRP_START   32 /* CMD32 = 0x60 */
#define SD_CMD_SD_ERASE_GRP_END   33 /* CMD33 = 0x61 */
#define SD_CMD_UNTAG_SECTOR   34 /* CMD34 = 0x62 */
#define SD_CMD_ERASE_GRP_START   35 /* CMD35 = 0x63 */
#define SD_CMD_ERASE_GRP_END   36 /* CMD36 = 0x64 */
#define SD_CMD_UNTAG_ERASE_GROUP   37 /* CMD37 = 0x65 */
#define SD_CMD_ERASE   38 /* CMD38 = 0x66 */
#define SD_CMD_SD_APP_OP_COND   41 /* CMD41 = 0x69 */
#define SD_CMD_APP_CMD   55 /* CMD55 = 0x77 */
#define SD_CMD_READ_OCR   58 /* CMD55 = 0x79 */

Enumerations

enum  SD_Answer_type {
  SD_ANSWER_R1_EXPECTED, SD_ANSWER_R1B_EXPECTED, SD_ANSWER_R2_EXPECTED, SD_ANSWER_R3_EXPECTED,
  SD_ANSWER_R4R5_EXPECTED, SD_ANSWER_R7_EXPECTED
}
 SD ansewer format. More...
enum  SD_Error {
  SD_R1_NO_ERROR = (0x00), SD_R1_IN_IDLE_STATE = (0x01), SD_R1_ERASE_RESET = (0x02), SD_R1_ILLEGAL_COMMAND = (0x04),
  SD_R1_COM_CRC_ERROR = (0x08), SD_R1_ERASE_SEQUENCE_ERROR = (0x10), SD_R1_ADDRESS_ERROR = (0x20), SD_R1_PARAMETER_ERROR = (0x40),
  SD_R2_NO_ERROR = 0x00, SD_R2_CARD_LOCKED = 0x01, SD_R2_LOCKUNLOCK_ERROR = 0x02, SD_R2_ERROR = 0x04,
  SD_R2_CC_ERROR = 0x08, SD_R2_CARD_ECC_FAILED = 0x10, SD_R2_WP_VIOLATION = 0x20, SD_R2_ERASE_PARAM = 0x40,
  SD_R2_OUTOFRANGE = 0x80, SD_DATA_OK = (0x05), SD_DATA_CRC_ERROR = (0x0B), SD_DATA_WRITE_ERROR = (0x0D),
  SD_DATA_OTHER_ERROR = (0xFF)
}
 SD reponses and error flags. More...

Define Documentation

#define SD_CMD_APP_CMD   55 /* CMD55 = 0x77 */

Definition at line 192 of file stm3210c_eval_sd.c.

Referenced by SD_GoIdleState().

#define SD_CMD_CLR_WRITE_PROT   29 /* CMD29 = 0x5D */

Definition at line 182 of file stm3210c_eval_sd.c.

#define SD_CMD_ERASE   38 /* CMD38 = 0x66 */

Definition at line 190 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_Erase().

#define SD_CMD_ERASE_GRP_END   36 /* CMD36 = 0x64 */

Definition at line 188 of file stm3210c_eval_sd.c.

#define SD_CMD_ERASE_GRP_START   35 /* CMD35 = 0x63 */

Definition at line 187 of file stm3210c_eval_sd.c.

#define SD_CMD_GO_IDLE_STATE   0 /* CMD0 = 0x40 */

Commands: CMDxx = CMD-number | 0x40.

Definition at line 167 of file stm3210c_eval_sd.c.

Referenced by SD_GoIdleState().

#define SD_CMD_LENGTH   6

Definition at line 133 of file stm3210c_eval_sd.c.

Referenced by SD_SendCmd().

#define SD_CMD_PROG_CSD   27 /* CMD27 = 0x5B */

Definition at line 180 of file stm3210c_eval_sd.c.

#define SD_CMD_READ_MULT_BLOCK   18 /* CMD18 = 0x52 */

Definition at line 176 of file stm3210c_eval_sd.c.

#define SD_CMD_READ_OCR   58 /* CMD55 = 0x79 */

Definition at line 193 of file stm3210c_eval_sd.c.

Referenced by SD_GoIdleState().

#define SD_CMD_READ_SINGLE_BLOCK   17 /* CMD17 = 0x51 */

Definition at line 175 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_ReadBlocks().

#define SD_CMD_SD_APP_OP_COND   41 /* CMD41 = 0x69 */

Definition at line 191 of file stm3210c_eval_sd.c.

Referenced by SD_GoIdleState().

#define SD_CMD_SD_ERASE_GRP_END   33 /* CMD33 = 0x61 */

Definition at line 185 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_Erase().

#define SD_CMD_SD_ERASE_GRP_START   32 /* CMD32 = 0x60 */

Definition at line 184 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_Erase().

#define SD_CMD_SEND_CID   10 /* CMD10 = 0x4A */

Definition at line 171 of file stm3210c_eval_sd.c.

Referenced by SD_GetCIDRegister().

#define SD_CMD_SEND_CSD   9 /* CMD9 = 0x49 */

Definition at line 170 of file stm3210c_eval_sd.c.

Referenced by SD_GetCSDRegister().

#define SD_CMD_SEND_IF_COND   8 /* CMD8 = 0x48 */

Definition at line 169 of file stm3210c_eval_sd.c.

Referenced by SD_GoIdleState().

#define SD_CMD_SEND_OP_COND   1 /* CMD1 = 0x41 */

Definition at line 168 of file stm3210c_eval_sd.c.

#define SD_CMD_SEND_STATUS   13 /* CMD13 = 0x4D */

Definition at line 173 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_GetCardState().

#define SD_CMD_SEND_WRITE_PROT   30 /* CMD30 = 0x5E */

Definition at line 183 of file stm3210c_eval_sd.c.

#define SD_CMD_SET_BLOCK_COUNT   23 /* CMD23 = 0x57 */

Definition at line 177 of file stm3210c_eval_sd.c.

#define SD_CMD_SET_BLOCKLEN   16 /* CMD16 = 0x50 */

Definition at line 174 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_ReadBlocks(), and BSP_SD_WriteBlocks().

#define SD_CMD_SET_WRITE_PROT   28 /* CMD28 = 0x5C */

Definition at line 181 of file stm3210c_eval_sd.c.

#define SD_CMD_STOP_TRANSMISSION   12 /* CMD12 = 0x4C */

Definition at line 172 of file stm3210c_eval_sd.c.

#define SD_CMD_UNTAG_ERASE_GROUP   37 /* CMD37 = 0x65 */

Definition at line 189 of file stm3210c_eval_sd.c.

#define SD_CMD_UNTAG_SECTOR   34 /* CMD34 = 0x62 */

Definition at line 186 of file stm3210c_eval_sd.c.

#define SD_CMD_WRITE_MULT_BLOCK   25 /* CMD25 = 0x59 */

Definition at line 179 of file stm3210c_eval_sd.c.

#define SD_CMD_WRITE_SINGLE_BLOCK   24 /* CMD24 = 0x58 */

Definition at line 178 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_WriteBlocks().

#define SD_CSD_STRUCT_V1   0x2 /* CSD struct version V1 */

Definition at line 137 of file stm3210c_eval_sd.c.

#define SD_CSD_STRUCT_V2   0x1 /* CSD struct version V2 */

Definition at line 138 of file stm3210c_eval_sd.c.

#define SD_MAX_FRAME_LENGTH   17 /* Lenght = 16 + 1 */

Definition at line 132 of file stm3210c_eval_sd.c.

#define SD_MAX_TRY   100 /* Number of try */

Definition at line 135 of file stm3210c_eval_sd.c.

Referenced by SD_GoIdleState().

#define SD_TOKEN_START_DATA_MULTIPLE_BLOCK_READ   0xFE /* Data token start byte, Start Multiple Block Read */

Definition at line 159 of file stm3210c_eval_sd.c.

#define SD_TOKEN_START_DATA_MULTIPLE_BLOCK_WRITE   0xFD /* Data token start byte, Start Multiple Block Write */

Definition at line 161 of file stm3210c_eval_sd.c.

#define SD_TOKEN_START_DATA_SINGLE_BLOCK_READ   0xFE /* Data token start byte, Start Single Block Read */

Start Data tokens: Tokens (necessary because at nop/idle (and CS active) only 0xff is on the data/command line)

Definition at line 158 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_ReadBlocks(), SD_GetCIDRegister(), and SD_GetCSDRegister().

#define SD_TOKEN_START_DATA_SINGLE_BLOCK_WRITE   0xFE /* Data token start byte, Start Single Block Write */

Definition at line 160 of file stm3210c_eval_sd.c.

Referenced by BSP_SD_WriteBlocks().

#define SD_TOKEN_STOP_DATA_MULTIPLE_BLOCK_WRITE   0xFD /* Data toke stop byte, Stop Multiple Block Write */

Definition at line 162 of file stm3210c_eval_sd.c.


Enumeration Type Documentation

SD ansewer format.

Enumerator:
SD_ANSWER_R1_EXPECTED 
SD_ANSWER_R1B_EXPECTED 
SD_ANSWER_R2_EXPECTED 
SD_ANSWER_R3_EXPECTED 
SD_ANSWER_R4R5_EXPECTED 
SD_ANSWER_R7_EXPECTED 

Definition at line 144 of file stm3210c_eval_sd.c.

enum SD_Error

SD reponses and error flags.

Enumerator:
SD_R1_NO_ERROR 
SD_R1_IN_IDLE_STATE 
SD_R1_ERASE_RESET 
SD_R1_ILLEGAL_COMMAND 
SD_R1_COM_CRC_ERROR 
SD_R1_ERASE_SEQUENCE_ERROR 
SD_R1_ADDRESS_ERROR 
SD_R1_PARAMETER_ERROR 
SD_R2_NO_ERROR 
SD_R2_CARD_LOCKED 
SD_R2_LOCKUNLOCK_ERROR 
SD_R2_ERROR 
SD_R2_CC_ERROR 
SD_R2_CARD_ECC_FAILED 
SD_R2_WP_VIOLATION 
SD_R2_ERASE_PARAM 
SD_R2_OUTOFRANGE 
SD_DATA_OK 

Data response error.

SD_DATA_CRC_ERROR 
SD_DATA_WRITE_ERROR 
SD_DATA_OTHER_ERROR 

Definition at line 198 of file stm3210c_eval_sd.c.

Generated on Fri Apr 14 2017 13:00:47 for STM3210C_EVAL BSP User Manual by   doxygen 1.7.6.1