distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::devices::anonymous_namespace{SdCard.cpp} Namespace Reference

Classes

class  Cid
 CID, card identification register. More...
 
class  Csd
 CSD, card-specific data register. More...
 
class  CsdV1
 CSD version 1.0, card-specific data register. More...
 
class  CsdV2
 CSD version 2.0, card-specific data register. More...
 
class  R1Response
 R1 response. More...
 
class  R2Response
 R2 response. More...
 
class  R3Response
 R3 response. More...
 
class  R6Response
 R6 response. More...
 
class  R7Response
 R7 response. More...
 
class  SdStatus
 SD status. More...
 

Typedefs

using ShortResponse = std::array< uint32_t, 1 >
 alias for short response More...
 
using LongResponse = std::array< uint32_t, 4 >
 alias for long response More...
 
using Result = SdMmcCardBase::Result
 import SdMmcCardBase::Result as Result More...
 

Enumerations

enum  CardState : uint8_t {
  CardState::idle, CardState::ready, CardState::identification, CardState::standby,
  CardState::transfer, CardState::sendingData, CardState::receiveData, CardState::programming,
  CardState::disconnect, CardState::reserved9, CardState::reserved10, CardState::reserved11,
  CardState::reserved12, CardState::reserved13, CardState::reserved14, CardState::reservedForIOMode
}
 state of the card More...
 
enum  R1ResponseErrors : ShortResponse::value_type {
  R1ResponseErrors::akeSeqError = 1u << 3, R1ResponseErrors::wpEraseSkip = 1u << 15, R1ResponseErrors::csdOverwrite = 1u << 16, R1ResponseErrors::error = 1u << 19,
  R1ResponseErrors::ccError = 1u << 20, R1ResponseErrors::cardEccFailed = 1u << 21, R1ResponseErrors::illegalCommand = 1u << 22, R1ResponseErrors::comCrcError = 1u << 23,
  R1ResponseErrors::lockUnlockFailed = 1u << 24, R1ResponseErrors::wpViolation = 1u << 26, R1ResponseErrors::eraseParam = 1u << 27, R1ResponseErrors::eraseSeqError = 1u << 28,
  R1ResponseErrors::blockLenError = 1u << 29, R1ResponseErrors::addressError = 1u << 30, R1ResponseErrors::outOfRange = 1u << 31
}
 R1 response errors. More...
 

Functions

void executeCmdWithoutResponse (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument)
 Executes transaction with command that has no response. More...
 
std::pair< Result, ShortResponseexecuteCmdWithShortResponse (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has short response. More...
 
std::pair< Result, LongResponseexecuteCmdWithLongResponse (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has long response. More...
 
int resultToErrorCode (const Result result)
 Converts result of transaction to error code. More...
 
std::pair< int, R1ResponseexecuteCmdWithR1Response (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has R1 response. More...
 
std::pair< int, R2ResponseexecuteCmdWithR2Response (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has R2 response. More...
 
std::pair< int, R3ResponseexecuteCmdWithR3Response (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has R3 response. More...
 
std::pair< int, R6ResponseexecuteCmdWithR6Response (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has R6 response. More...
 
std::pair< int, R7ResponseexecuteCmdWithR7Response (SynchronousSdMmcCardLowLevel &sdCard, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with command that has R7 response. More...
 
void executeCmd0 (SynchronousSdMmcCardLowLevel &sdCard)
 Executes CMD0 command on SD card. More...
 
std::pair< int, CidexecuteCmd2 (SynchronousSdMmcCardLowLevel &sdCard)
 Executes CMD2 command on SD card. More...
 
std::pair< int, R6ResponseexecuteCmd3 (SynchronousSdMmcCardLowLevel &sdCard)
 Executes CMD3 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd7 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca)
 Executes CMD7 command on SD card. More...
 
std::pair< int, bool > executeCmd8 (SynchronousSdMmcCardLowLevel &sdCard)
 Executes CMD8 command on SD card. More...
 
std::pair< int, CsdexecuteCmd9 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca)
 Executes CMD9 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd12 (SynchronousSdMmcCardLowLevel &sdCard)
 Executes CMD12 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd13 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca)
 Executes CMD13 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd16 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t blockLength)
 Executes CMD16 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd17 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t address, const SdMmcCardLowLevel::ReadTransfer readTransfer)
 Executes CMD17 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd18 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t address, const SdMmcCardLowLevel::ReadTransfer readTransfer)
 Executes CMD18 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd24 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t address, const SdMmcCardLowLevel::WriteTransfer writeTransfer)
 Executes CMD24 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd25 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t address, const SdMmcCardLowLevel::WriteTransfer writeTransfer)
 Executes CMD25 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd32 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t address)
 Executes CMD32 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd33 (SynchronousSdMmcCardLowLevel &sdCard, const uint32_t address)
 Executes CMD33 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd38 (SynchronousSdMmcCardLowLevel &sdCard)
 Executes CMD38 command on SD card. More...
 
std::pair< int, R1ResponseexecuteCmd55 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca)
 Executes CMD55 command on SD card. More...
 
std::pair< int, R1ResponseexecuteAcmdWithR1Response (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with application command (ACMD) that has R1 response. More...
 
std::pair< int, R3ResponseexecuteAcmdWithR3Response (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const uint8_t command, const uint32_t argument, const SdMmcCardLowLevel::Transfer transfer)
 Executes transaction with application command (ACMD) that has R3 response. More...
 
std::pair< int, R1ResponseexecuteAcmd6 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const bool _4BitBusMode)
 Executes ACMD6 command on SD card. More...
 
std::tuple< int, R1Response, SdStatusexecuteAcmd13 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const uint16_t timeoutMs)
 Executes ACMD13 command on SD card. More...
 
std::pair< int, R1ResponseexecuteAcmd23 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const uint32_t blocksCount)
 Executes ACMD23 command on SD card. More...
 
std::pair< int, R3ResponseexecuteAcmd41 (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const bool hcs, const bool xpc, const bool s18r, const uint32_t vddVoltageWindow)
 Executes ACMD41 command on SD card. More...
 
int waitForTransferState (SynchronousSdMmcCardLowLevel &sdCard, const uint16_t rca, const TickClock::time_point timePoint)
 Waits until card goes back to transfer (tran) state. More...
 

Typedef Documentation

◆ LongResponse

using distortos::devices::anonymous_namespace{SdCard.cpp}::LongResponse = typedef std::array<uint32_t, 4>

alias for long response

◆ Result

using distortos::devices::anonymous_namespace{SdCard.cpp}::Result = typedef SdMmcCardBase::Result

import SdMmcCardBase::Result as Result

◆ ShortResponse

using distortos::devices::anonymous_namespace{SdCard.cpp}::ShortResponse = typedef std::array<uint32_t, 1>

alias for short response

Enumeration Type Documentation

◆ CardState

enum distortos::devices::anonymous_namespace{SdCard.cpp}::CardState : uint8_t
strong

state of the card

Enumerator
idle 

idle

ready 

ready

identification 

identification (ident)

standby 

standby (stby)

transfer 

transfer (tran)

sendingData 

sending data (data)

receiveData 

receive data (rcv)

programming 

programming (prg)

disconnect 

disconnect (dis)

reserved9 

reserved

reserved10 

reserved

reserved11 

reserved

reserved12 

reserved

reserved13 

reserved

reserved14 

reserved

reservedForIOMode 

reserved for I/O mode

◆ R1ResponseErrors

enum distortos::devices::anonymous_namespace{SdCard.cpp}::R1ResponseErrors : ShortResponse::value_type
strong

R1 response errors.

Enumerator
akeSeqError 

AKE_SEQ_ERROR.

wpEraseSkip 

WP_ERASE_SKIP.

csdOverwrite 

CSD_OVERWRITE.

error 

ERROR.

ccError 

CC_ERROR.

cardEccFailed 

CARD_ECC_FAILED.

illegalCommand 

ILLEGAL_COMMAND.

comCrcError 

COM_CRC_ERROR.

lockUnlockFailed 

LOCK_UNLOCK_FAILED.

wpViolation 

WP_VIOLATION.

eraseParam 

ERASE_PARAM.

eraseSeqError 

ERASE_SEQ_ERROR.

blockLenError 

BLOCK_LEN_ERROR.

addressError 

ADDRESS_ERROR.

outOfRange 

OUT_OF_RANGE.

Function Documentation

◆ executeAcmd13()

std::tuple<int, R1Response, SdStatus> distortos::devices::anonymous_namespace{SdCard.cpp}::executeAcmd13 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const uint16_t  timeoutMs 
)

Executes ACMD13 command on SD card.

This is SD_STATUS command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]timeoutMsis the timeout of read transfer, milliseconds
Returns
tuple with return code (0 on success, error code otherwise), R1 response and SD status; error codes:
Here is the caller graph for this function:

◆ executeAcmd23()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeAcmd23 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const uint32_t  blocksCount 
)

Executes ACMD23 command on SD card.

This is SET_WR_BLK_ERASE_COUNT command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]blocksCountis the number of blocks to pre-erase with next multi-block write command
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeAcmd41()

std::pair<int, R3Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeAcmd41 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const bool  hcs,
const bool  xpc,
const bool  s18r,
const uint32_t  vddVoltageWindow 
)

Executes ACMD41 command on SD card.

This is SD_SEND_OP_COND command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]hcsis the value of HCS (host capacity support) bit, which selects whether host supports SDHC and SDXC cards
[in]xpcis the value of XPC (SDXC power control) bit, which selects whether card should operate in power saving (false) or maximum performance (true) mode
[in]s18ris the value of S18R (switching to 1.8 V request) bit, which selects whether current signal voltage (false) or 1.8 V signal voltage should be used
[in]vddVoltageWindowis the value of VDD voltage window field
Returns
pair with return code (0 on success, error code otherwise) and R3 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeAcmd6()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeAcmd6 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const bool  _4BitBusMode 
)

Executes ACMD6 command on SD card.

This is SET_BUS_WIDTH command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]_4BitBusModeselects whether 1-bit (false) or 4-bit (true) bus mode will be selected
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeAcmdWithR1Response()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeAcmdWithR1Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with application command (ACMD) that has R1 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeAcmdWithR3Response()

std::pair<int, R3Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeAcmdWithR3Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with application command (ACMD) that has R3 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R3 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd0()

void distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd0 ( SynchronousSdMmcCardLowLevel sdCard)

Executes CMD0 command on SD card.

This is GO_IDLE_STATE command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd12()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd12 ( SynchronousSdMmcCardLowLevel sdCard)

Executes CMD12 command on SD card.

This is STOP_TRANSMISSION command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd13()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd13 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca 
)

Executes CMD13 command on SD card.

This is SEND_STATUS command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd16()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd16 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  blockLength 
)

Executes CMD16 command on SD card.

This is SET_BLOCKLEN command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]blockLengthis the length of read/write block, bytes
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd17()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd17 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  address,
const SdMmcCardLowLevel::ReadTransfer  readTransfer 
)

Executes CMD17 command on SD card.

This is READ_SINGLE_BLOCK command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]addressis the address from which data will be read, bytes or blocks
[in,out]readTransferis the read transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd18()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd18 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  address,
const SdMmcCardLowLevel::ReadTransfer  readTransfer 
)

Executes CMD18 command on SD card.

This is READ_MULTIPLE_BLOCK command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]addressis the address from which data will be read, bytes or blocks
[in,out]readTransferis the read transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd2()

std::pair<int, Cid> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd2 ( SynchronousSdMmcCardLowLevel sdCard)

Executes CMD2 command on SD card.

This is ALL_SEND_CID command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
Returns
pair with return code (0 on success, error code otherwise) and CID; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd24()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd24 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  address,
const SdMmcCardLowLevel::WriteTransfer  writeTransfer 
)

Executes CMD24 command on SD card.

This is WRITE_BLOCK command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]addressis the address to which data will be written, bytes or blocks
[in]writeTransferis the write transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd25()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd25 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  address,
const SdMmcCardLowLevel::WriteTransfer  writeTransfer 
)

Executes CMD25 command on SD card.

This is WRITE_MULTIPLE_BLOCK command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]addressis the address to which data will be written, bytes or blocks
[in]writeTransferis the write transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd3()

std::pair<int, R6Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd3 ( SynchronousSdMmcCardLowLevel sdCard)

Executes CMD3 command on SD card.

This is SEND_RELATIVE_ADDR command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
Returns
pair with return code (0 on success, error code otherwise) and R6 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd32()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd32 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  address 
)

Executes CMD32 command on SD card.

This is ERASE_WR_BLK_START_ADDR command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]addressis the address of first block marked for erase, bytes or blocks
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd33()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd33 ( SynchronousSdMmcCardLowLevel sdCard,
const uint32_t  address 
)

Executes CMD33 command on SD card.

This is ERASE_WR_BLK_END_ADDR command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]addressis the address of last block marked for erase, bytes or blocks
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd38()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd38 ( SynchronousSdMmcCardLowLevel sdCard)

Executes CMD38 command on SD card.

This is ERASE command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd55()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd55 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca 
)

Executes CMD55 command on SD card.

This is APP_CMD command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd7()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd7 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca 
)

Executes CMD7 command on SD card.

This is SELECT/DESELECT_CARD command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd8()

std::pair<int, bool> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd8 ( SynchronousSdMmcCardLowLevel sdCard)

Executes CMD8 command on SD card.

This is SEND_IF_COND command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
Returns
pair with return code (0 on success, error code otherwise) and a boolean value which tells whether pattern was matched; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmd9()

std::pair<int, Csd> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmd9 ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca 
)

Executes CMD9 command on SD card.

This is SEND_CSD command.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
Returns
pair with return code (0 on success, error code otherwise) and CSD; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithLongResponse()

std::pair<Result, LongResponse> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithLongResponse ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has long response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with result of transaction and long response
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithoutResponse()

void distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithoutResponse ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument 
)

Executes transaction with command that has no response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithR1Response()

std::pair<int, R1Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithR1Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has R1 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R1 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithR2Response()

std::pair<int, R2Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithR2Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has R2 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R2 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithR3Response()

std::pair<int, R3Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithR3Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has R3 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R3 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithR6Response()

std::pair<int, R6Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithR6Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has R6 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R6 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithR7Response()

std::pair<int, R7Response> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithR7Response ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has R7 response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with return code (0 on success, error code otherwise) and R7 response; error codes:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCmdWithShortResponse()

std::pair<Result, ShortResponse> distortos::devices::anonymous_namespace{SdCard.cpp}::executeCmdWithShortResponse ( SynchronousSdMmcCardLowLevel sdCard,
const uint8_t  command,
const uint32_t  argument,
const SdMmcCardLowLevel::Transfer  transfer 
)

Executes transaction with command that has short response.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]commandis the command that will be executed, [0; SdMmcCardLowLevel::maxCommand]
[in]argumentis the argument for command
[in,out]transferis the transfer associated with transaction
Returns
pair with result of transaction and short response
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resultToErrorCode()

int distortos::devices::anonymous_namespace{SdCard.cpp}::resultToErrorCode ( const Result  result)

Converts result of transaction to error code.

Parameters
[in]resultis the result of transaction
Returns
result converted to error code
Here is the caller graph for this function:

◆ waitForTransferState()

int distortos::devices::anonymous_namespace{SdCard.cpp}::waitForTransferState ( SynchronousSdMmcCardLowLevel sdCard,
const uint16_t  rca,
const TickClock::time_point  timePoint 
)

Waits until card goes back to transfer (tran) state.

Parameters
[in]sdCardis a reference to synchronous low-level SD/MMC card driver
[in]rcais the relative card address
[in]timePointis the time point at which the wait will be terminated
Returns
0 on success, error code otherwise:
  • EIO - R1 response indicates an error;
  • EIO - card is not in sending data (data), receive data (rcv) or programming (prg) state, transfer (tran) state cannot be reached automatically;
  • ETIMEDOUT - card did not went back to transfer (tran) state before the specified timeout expired;
  • error codes returned by executeCmd13();
Here is the call graph for this function:
Here is the caller graph for this function: