In development. It changes without notice.
Topic
SD Card
The SD card: mounting it for as long as an action lasts, formatting it, and settling it at boot, on the boards that have a slot.
Files | |
| file | src/ |
| What the boot's settle of the SD slot came to: its states, their console tokens, the state a card-level initialization ends in, and when the slot is known empty (host-tested). | |
| file | src/ |
| SD card mount/status helper over the ESP32 SPI bus. | |
| file | src/ |
| The SD card mounted for one action, and unmounted when that action ends. | |
Classes | |
| class | kleidos:: |
| Static facade for the on-board SD card slot. More about kleidos:: | |
| class | kleidos:: |
| Mount the card for one scope, and unmount it at the scope's end when this scope is the one that mounted it. More about kleidos:: | |
Typedefs | |
| using | kleidos:: |
Enumerations | |
| enum class | kleidos:: |
| Where the boot's settle of the slot stands. More about kleidos:: | |
| enum class | kleidos:: |
| What one look at the slot found: the boot's settle or a mount. More about kleidos:: | |
Functions | |
| constexpr const char * | kleidos:: |
| Console token of a settle state. | |
| constexpr BootSettle | kleidos:: |
| The state a settle ends in, from what the card-level initialization did. | |
| constexpr bool | kleidos:: |
| Whether the slot is as a working boot leaves it, for good. | |
| constexpr bool | kleidos:: |
| Whether a card user may address the card now. | |
| constexpr SlotFinding | kleidos:: |
| What a settle's end says about the slot. | |
| constexpr SlotFinding | kleidos:: |
| What a mount attempt's outcome says about the slot. | |
| constexpr bool | kleidos:: |
| Whether the slot is known empty after one more look at it. | |
Variables | |
| constexpr std::array< const char *, 5 > | kleidos:: |
| Console token of each BootSettle, in enumerator order (boot_settle=). | |
Typedef Documentation
SdCardSession #
The card mounted for one action and unmounted when it ends, if the action mounted it (hal::
Enumeration Type Documentation
BootSettle #
Where the boot's settle of the slot stands.
SlotFinding #
What one look at the slot found: the boot's settle or a mount.
Function Documentation
bootSettleName() #
Console token of a settle state.
- Parameters
-
Name Direction Meaning settle in The state.
- Returns
- Its token, or "na" for a value outside the enumeration.
cardFree() #
Whether a card user may address the card now.
- Parameters
-
Name Direction Meaning settle in The state.
- Return values
-
Value Meaning true No settle is addressing the slot. false One is ( Running): the card driver serves one task at a time.
findingOf() [1/2] #
What a settle's end says about the slot.
- Parameters
-
Name Direction Meaning settle in The state.
- Returns
CardforDone,EmptyforNoCard,Unknownotherwise: a settle that sent nothing (Failed) or has not ended learned nothing.
findingOf() [2/2] #
What a mount attempt's outcome says about the slot.
- Parameters
-
Name Direction Meaning outcome in How the mount ended ( sdfatfs::).lastMountOutcome
- Returns
Cardwhen a card identified (its volume mounted or not),Emptywhen none did,Unknownbefore any attempt.
knownEmptyAfter() #
Whether the slot is known empty after one more look at it.
A look that found no card makes the slot known empty, and one that found a card clears it; a look that learned nothing leaves what was known. While the slot is known empty nothing addresses it on its own (a rail restore does not remount it, a card power-measurement run does not probe it or cycle its rail): with no card-detect line there is no event to wait for, and every such attempt could only fail. A user's own SD action still tries once, and a card it finds clears the knowledge.
- Parameters
-
Name Direction Meaning knownEmpty in What was known before the look. finding in What the look found.
- Returns
- What is known after it.
settled() #
Whether the slot is as a working boot leaves it, for good.
- Parameters
-
Name Direction Meaning settle in The state.
- Return values
-
Value Meaning true DoneorNoCard:the settle ended, and it sent whatever was in the slot the whole initialization or found nothing to send it to.false It has not ended ( NotStarted,Running), or it could not reach the slot (Failed), which leaves a card as its supply left it.
settleOutcome() #
The state a settle ends in, from what the card-level initialization did.
- Parameters
-
Name Direction Meaning init in How sdfatfs::ended.initializeCard
- Returns
Donefor an initialized card (one mounted already is initialized too),NoCardwhen none completed its initialization, andFailedwhen nothing could be sent (or for a value outside the enumeration).