#include "distortos/devices/memory/SdMmcCardLowLevel.hpp"
SdMmcCardLowLevel class is an interface for low-level SD/MMC card driver.
◆ BusMode
bus mode
Enumerator |
---|
_1Bit | 1-bit bus mode
|
_4Bit | 4-bit bus mode
|
_8Bit | 8-bit bus mode
|
◆ ~SdMmcCardLowLevel()
virtual distortos::devices::SdMmcCardLowLevel::~SdMmcCardLowLevel |
( |
| ) |
|
|
virtualdefault |
◆ configure()
virtual void distortos::devices::SdMmcCardLowLevel::configure |
( |
BusMode |
busMode, |
|
|
uint32_t |
clockFrequency |
|
) |
| |
|
pure virtual |
Configures parameters of low-level SD/MMC card driver.
- Precondition
- Driver is started.
-
No transaction is in progress.
-
clockFrequency is valid.
- Parameters
-
[in] | busMode | is the desired bus mode |
[in] | clockFrequency | is the desired clock frequency, Hz, must be greater than or equal to 400 kHz |
◆ start()
virtual int distortos::devices::SdMmcCardLowLevel::start |
( |
| ) |
|
|
pure virtual |
Starts low-level SD/MMC card driver.
- Precondition
- Driver is stopped.
- Returns
- 0 on success, error code otherwise
◆ startTransaction()
virtual void distortos::devices::SdMmcCardLowLevel::startTransaction |
( |
SdMmcCardBase & |
sdMmcCardBase, |
|
|
uint8_t |
command, |
|
|
uint32_t |
argument, |
|
|
Response |
response, |
|
|
Transfer |
transfer |
|
) |
| |
|
pure virtual |
Starts asynchronous transaction.
This function returns immediately. When the transaction is physically finished (either command, its argument, response and associated transfer were sent/received or an error was detected), SdMmcCardBase::transactionCompleteEvent() will be executed.
- Precondition
- Driver is started.
-
No transaction is in progress.
-
command is valid.
-
When there is an associated transfer:
- either short or long response is expected;
- transfer's read buffer (for read transfers) or write buffer (for write transfers) is valid and its address is aligned to DISTORTOS_SDMMCCARD_BUFFER_ALIGNMENT;
- transfer's block size is a power of two, greater than or equal to 4 and less than or equal to 2^14;
- transfer's size is an integer multiple of block size and less than or equal to 2^25 - 1;
- transfer's timeout converted to clock cycles must be less than or equal to 2^32 - 1;
- Postcondition
- Transaction is in progress.
- Parameters
-
[in] | sdMmcCardBase | is a reference to SdMmcCardBase object that will be notified about completed transaction |
[in] | command | is the command associated with the transaction, [0; maxCommand] |
[in] | argument | is the argument for command |
[out] | response | is the buffer into which the command response will be read, it's size determines what type of response is expected (none, short or long) |
[in,out] | transfer | is the transfer associated with transaction |
◆ stop()
virtual void distortos::devices::SdMmcCardLowLevel::stop |
( |
| ) |
|
|
pure virtual |
Stops low-level SD/MMC card driver.
- Precondition
- Driver is started.
-
No transaction is in progress.
- Postcondition
- Driver is stopped.
◆ maxCommand
constexpr uint8_t distortos::devices::SdMmcCardLowLevel::maxCommand {(1 << 6) - 1} |
|
static |
The documentation for this class was generated from the following file: