Go to the source code of this file.
◆ SdStatus_t
◆ anonymous enum
| Enumerator |
|---|
| SD_CARD_ERROR_UNKNOWN | |
◆ __attribute__()
| struct CID __attribute__ |
( |
(packed) |
| ) |
|
◆ printSdErrorSymbol()
| void printSdErrorSymbol |
( |
print_t * |
pr, |
|
|
uint8_t |
code |
|
) |
| |
◆ printSdErrorText()
| void printSdErrorText |
( |
print_t * |
pr, |
|
|
uint8_t |
code |
|
) |
| |
◆ sdCardCapacity()
| uint32_t sdCardCapacity |
( |
csd_t * |
csd | ) |
|
|
inline |
◆ __attribute__
◆ ACMD13
| const uint8_t ACMD13 = 0X0D |
SD_STATUS - Send the SD Status.
◆ ACMD23
| const uint8_t ACMD23 = 0X17 |
SET_WR_BLK_ERASE_COUNT - Set the number of write sectors to be pre-erased before writing
◆ ACMD41
| const uint8_t ACMD41 = 0X29 |
SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process
◆ ACMD6
| const uint8_t ACMD6 = 0X06 |
SET_BUS_WIDTH - Defines the data bus width for data transfer.
◆ always1
◆ c_size_high
| unsigned char c_size_high |
◆ c_size_low
◆ c_size_mid
◆ c_size_mult_high
| unsigned char c_size_mult_high |
◆ c_size_mult_low
| unsigned char c_size_mult_low |
◆ CARD_STATUS_ADDRESS_ERROR
| const uint32_t CARD_STATUS_ADDRESS_ERROR = 1UL << 30 |
A misaligned address which did not match the sector length.
◆ CARD_STATUS_AKE_SEQ_ERROR
| const uint32_t CARD_STATUS_AKE_SEQ_ERROR = 1UL << 3 |
Error in the sequence of the authentication process.
◆ CARD_STATUS_APP_CMD
| const uint32_t CARD_STATUS_APP_CMD = 1UL << 5 |
The card will expect ACMD, or the command has been interpreted as ACMD
◆ CARD_STATUS_CARD_ECC_DISABLED
| const uint32_t CARD_STATUS_CARD_ECC_DISABLED = 1UL << 14 |
The command has been executed without using the internal ECC.
◆ CARD_STATUS_CARD_ECC_FAILED
| const uint32_t CARD_STATUS_CARD_ECC_FAILED = 1UL << 21 |
Card internal ECC was applied but failed to correct the data.
◆ CARD_STATUS_CARD_IS_LOCKED
| const uint32_t CARD_STATUS_CARD_IS_LOCKED = 1UL << 25 |
When set, signals that the card is locked by the host.
◆ CARD_STATUS_CC_ERROR
| const uint32_t CARD_STATUS_CC_ERROR = 1UL << 20 |
Internal card controller error
◆ CARD_STATUS_COM_CRC_ERROR
| const uint32_t CARD_STATUS_COM_CRC_ERROR = 1UL << 23 |
The CRC check of the previous command failed.
◆ CARD_STATUS_CSD_OVERWRITE
| const uint32_t CARD_STATUS_CSD_OVERWRITE = 1UL << 16 |
Permanent WP set or attempt to change read only values of CSD.
◆ CARD_STATUS_CURRENT_STATE
| const uint32_t CARD_STATUS_CURRENT_STATE = 0XF << 9 |
The state of the card when receiving the command. 0 = idle 1 = ready 2 = ident 3 = stby 4 = tran 5 = data 6 = rcv 7 = prg 8 = dis 9-14 = reserved 15 = reserved for I/O mode
◆ CARD_STATUS_CURRENT_STATE_SHIFT
| const uint32_t CARD_STATUS_CURRENT_STATE_SHIFT = 9 |
◆ CARD_STATUS_ERASE_PARAM
| const uint32_t CARD_STATUS_ERASE_PARAM = 1UL << 27 |
An invalid selection of write-sectors for erase occurred.
◆ CARD_STATUS_ERASE_RESET
| const uint32_t CARD_STATUS_ERASE_RESET = 1UL << 13 |
out of erase sequence command was received.
◆ CARD_STATUS_ERASE_SEQ_ERROR
| const uint32_t CARD_STATUS_ERASE_SEQ_ERROR = 1UL << 28 |
An error in the sequence of erase commands occurred.
◆ CARD_STATUS_ERROR
| const uint32_t CARD_STATUS_ERROR = 1UL << 19 |
A general or an unknown error occurred during the operation.
◆ CARD_STATUS_FX_EVENT
| const uint32_t CARD_STATUS_FX_EVENT = 1UL << 6 |
Extension Functions may set this bit to get host to deal with events.
◆ CARD_STATUS_ILLEGAL_COMMAND
| const uint32_t CARD_STATUS_ILLEGAL_COMMAND = 1UL << 22 |
Command not legal for the card state.
◆ CARD_STATUS_LOCK_UNLOCK_FAILED
| const uint32_t CARD_STATUS_LOCK_UNLOCK_FAILED = 1UL << 24 |
Set when a sequence or password error has been detected.
◆ CARD_STATUS_OUT_OF_RANGE
| const uint32_t CARD_STATUS_OUT_OF_RANGE = 1UL << 31 |
The command's argument was out of the allowed range for this card.
◆ CARD_STATUS_READY_FOR_DATA
| const uint32_t CARD_STATUS_READY_FOR_DATA = 1UL << 8 |
Corresponds to buffer empty signaling on the bus.
◆ CARD_STATUS_SECTOR_LEN_ERROR
| const uint32_t CARD_STATUS_SECTOR_LEN_ERROR = 1UL << 29 |
The transferred sector length is not allowed for this card.
◆ CARD_STATUS_WP_ERASE_SKIP
| const uint32_t CARD_STATUS_WP_ERASE_SKIP = 1UL << 15 |
partial address space was erased due to write protect.
◆ CARD_STATUS_WP_VIOLATION
| const uint32_t CARD_STATUS_WP_VIOLATION = 1UL << 26 |
Set when the host attempts to write to a protected sector.
◆ ccc_high
◆ ccc_low
◆ CMD0
| const uint8_t CMD0 = 0X00 |
GO_IDLE_STATE - init card in spi mode if CS low
◆ CMD10
| const uint8_t CMD10 = 0X0A |
SEND_CID - read the card identification information (CID register)
◆ CMD11
| const uint8_t CMD11 = 0X0B |
VOLTAGE_SWITCH -Switch to 1.8V bus signaling level.
◆ CMD12
| const uint8_t CMD12 = 0X0C |
STOP_TRANSMISSION - end multiple sector read sequence
◆ CMD13
| const uint8_t CMD13 = 0X0D |
SEND_STATUS - read the card status register
◆ CMD17
| const uint8_t CMD17 = 0X11 |
READ_SINGLE_SECTOR - read a single data sector from the card
◆ CMD18
| const uint8_t CMD18 = 0X12 |
READ_MULTIPLE_SECTOR - read multiple data sectors from the card
◆ CMD2
| const uint8_t CMD2 = 0X02 |
ALL_SEND_CID - Asks any card to send the CID.
◆ CMD24
| const uint8_t CMD24 = 0X18 |
WRITE_SECTOR - write a single data sector to the card
◆ CMD25
| const uint8_t CMD25 = 0X19 |
WRITE_MULTIPLE_SECTOR - write sectors of data until a STOP_TRANSMISSION
◆ CMD3
| const uint8_t CMD3 = 0X03 |
SEND_RELATIVE_ADDR - Ask the card to publish a new RCA.
◆ CMD32
| const uint8_t CMD32 = 0X20 |
ERASE_WR_BLK_START - sets the address of the first sector to be erased
◆ CMD33
| const uint8_t CMD33 = 0X21 |
ERASE_WR_BLK_END - sets the address of the last sector of the continuous range to be erased
◆ CMD38
| const uint8_t CMD38 = 0X26 |
ERASE - erase all previously selected sectors
◆ CMD55
| const uint8_t CMD55 = 0X37 |
APP_CMD - escape for application specific command
◆ CMD58
| const uint8_t CMD58 = 0X3A |
READ_OCR - read the OCR register of a card
◆ CMD59
| const uint8_t CMD59 = 0X3B |
CRC_ON_OFF - enable or disable CRC checking
◆ CMD6
| const uint8_t CMD6 = 0X06 |
SWITCH_FUNC - Switch Function Command
◆ CMD7
| const uint8_t CMD7 = 0X07 |
SELECT/DESELECT_CARD - toggles between the stand-by and transfer states.
◆ CMD8
| const uint8_t CMD8 = 0X08 |
SEND_IF_COND - verify SD Memory Card interface operating condition.
◆ CMD9
| const uint8_t CMD9 = 0X09 |
SEND_CSD - read the Card Specific Data (CSD register)
◆ copy
◆ crc
◆ csd_ver
◆ DATA_RES_ACCEPTED
| const uint8_t DATA_RES_ACCEPTED = 0X05 |
write data accepted token
◆ DATA_RES_MASK
| const uint8_t DATA_RES_MASK = 0X1F |
mask for data response tokens after a write sector operation
◆ DATA_START_SECTOR
| const uint8_t DATA_START_SECTOR = 0XFE |
start data token for read or write single sector
◆ dsr_imp
◆ erase_blk_en
| unsigned char erase_blk_en |
fixed to 1 - erase single is supported
◆ file_format
| unsigned char file_format |
◆ file_format_grp
| unsigned char file_format_grp |
Indicates the file format on the card
Do not use always 0
◆ mdt_month
◆ mdt_year_high
| unsigned char mdt_year_high |
Manufacturing date year high digit
◆ mdt_year_low
| unsigned char mdt_year_low |
Manufacturing date year low digit
◆ mid
◆ nsac
◆ oid
◆ perm_write_protect
| unsigned char perm_write_protect |
◆ pnm
◆ prv_m
Product revision least significant digit
◆ prv_n
Product revision most significant digit
◆ psn
◆ R1_IDLE_STATE
| const uint8_t R1_IDLE_STATE = 0X01 |
status for card in the idle state
◆ R1_ILLEGAL_COMMAND
| const uint8_t R1_ILLEGAL_COMMAND = 0X04 |
status bit for illegal command
◆ R1_READY_STATE
| const uint8_t R1_READY_STATE = 0X00 |
status for card in the ready state
◆ r2w_factor
◆ read_bl_len
| unsigned char read_bl_len |
This field is fixed to 9h, which indicates READ_BL_LEN=512 Byte
◆ read_bl_partial
| unsigned char read_bl_partial |
fixed to 0 - no partial read
◆ read_blk_misalign
| unsigned char read_blk_misalign |
◆ reserved
◆ reserved1
◆ reserved2
◆ reserved3
◆ reserved4
◆ reserved5
◆ reserved6
◆ reserved7
◆ SD_CARD_TYPE_SD1
| const uint8_t SD_CARD_TYPE_SD1 = 1 |
Standard capacity V1 SD card
◆ SD_CARD_TYPE_SD2
| const uint8_t SD_CARD_TYPE_SD2 = 2 |
Standard capacity V2 SD card
◆ SD_CARD_TYPE_SDHC
| const uint8_t SD_CARD_TYPE_SDHC = 3 |
◆ SD_CMD0_RETRY
| const uint8_t SD_CMD0_RETRY = 10 |
◆ SD_CMD_TIMEOUT
| const uint16_t SD_CMD_TIMEOUT = 300 |
◆ SD_ERASE_TIMEOUT
| const uint16_t SD_ERASE_TIMEOUT = 10000 |
◆ SD_INIT_TIMEOUT
| const uint16_t SD_INIT_TIMEOUT = 2000 |
◆ SD_READ_TIMEOUT
| const uint16_t SD_READ_TIMEOUT = 300 |
◆ SD_WRITE_TIMEOUT
| const uint16_t SD_WRITE_TIMEOUT = 600 |
◆ sector_size_high
| unsigned char sector_size_high |
sector size is fixed at 64 KB
◆ sector_size_low
| unsigned char sector_size_low |
sector size is fixed at 64 KB
◆ STOP_TRAN_TOKEN
| const uint8_t STOP_TRAN_TOKEN = 0XFD |
stop token for write multiple sectors
◆ taac
◆ tmp_write_protect
| unsigned char tmp_write_protect |
◆ tran_speed
◆ vdd_r_curr_max
| unsigned char vdd_r_curr_max |
◆ vdd_r_curr_min
| unsigned char vdd_r_curr_min |
◆ vdd_w_cur_max
| unsigned char vdd_w_cur_max |
◆ vdd_w_curr_min
| unsigned char vdd_w_curr_min |
◆ wp_grp_enable
| unsigned char wp_grp_enable |
fixed value of 0 - no write protect groups
◆ wp_grp_size
| unsigned char wp_grp_size |
◆ write_bl_len_high
| unsigned char write_bl_len_high |
write_bl_len fixed for 512 byte sectors
◆ write_bl_len_low
| unsigned char write_bl_len_low |
write_bl_len fixed for 512 byte sectors
◆ write_blk_misalign
| unsigned char write_blk_misalign |
◆ WRITE_MULTIPLE_TOKEN
| const uint8_t WRITE_MULTIPLE_TOKEN = 0XFC |
start data token for write multiple sectors
◆ write_partial
| unsigned char write_partial |
always zero - no partial sector read