SynchronousSdMmcCardLowLevel is a synchronous wrapper for SdMmcCardLowLevel which implements SdMmcCardBase interface.
More...
#include "distortos/devices/memory/SynchronousSdMmcCardLowLevel.hpp"
SynchronousSdMmcCardLowLevel is a synchronous wrapper for SdMmcCardLowLevel which implements SdMmcCardBase interface.
◆ SynchronousSdMmcCardLowLevel()
constexpr distortos::devices::SynchronousSdMmcCardLowLevel::SynchronousSdMmcCardLowLevel |
( |
SdMmcCardLowLevel & |
sdMmcCard | ) |
|
|
inlineexplicit |
◆ configure()
void distortos::devices::SynchronousSdMmcCardLowLevel::configure |
( |
const SdMmcCardLowLevel::BusMode |
busMode, |
|
|
const uint32_t |
clockFrequency |
|
) |
| const |
|
inline |
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 |
◆ executeTransaction()
Executes transaction.
- 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
- No transaction is in progress.
- Parameters
-
[in] | command | is the command associated with the transaction, [0; SdMmcCardLowLevel::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 |
- Returns
- result of transaction
◆ start()
int distortos::devices::SynchronousSdMmcCardLowLevel::start |
( |
| ) |
const |
|
inline |
Starts low-level SD/MMC card driver.
- Precondition
- Driver is stopped.
- Returns
- 0 on success, error code otherwise:
◆ stop()
void distortos::devices::SynchronousSdMmcCardLowLevel::stop |
( |
| ) |
const |
|
inline |
Stops low-level SD/MMC card driver.
- Precondition
- Driver is started.
-
No transaction is in progress.
- Postcondition
- Driver is stopped.
◆ transactionCompleteEvent()
void distortos::devices::SynchronousSdMmcCardLowLevel::transactionCompleteEvent |
( |
Result |
result | ) |
|
|
overrideprivatevirtual |
"Transaction complete" event
Called by low-level SD/MMC card driver when the transaction is physically finished.
- Parameters
-
[in] | result | is the result of transaction |
Implements distortos::devices::SdMmcCardBase.
◆ result_
Result distortos::devices::SynchronousSdMmcCardLowLevel::result_ |
|
private |
◆ sdMmcCard_
◆ semaphore_
Semaphore distortos::devices::SynchronousSdMmcCardLowLevel::semaphore_ |
|
private |
semaphore used to notify waiting thread about completion of transaction
The documentation for this class was generated from the following files: