A MemoryCardSlot is a device which a MemoryCard can be inserted into and read/written from.
More...
#include <MemoryCardSlot.hpp>
A MemoryCardSlot is a device which a MemoryCard can be inserted into and read/written from.
◆ insert_card()
| bool com::saxbophone::wondercard::MemoryCardSlot::insert_card |
( |
MemoryCard & |
card | ) |
|
◆ read_block()
| bool com::saxbophone::wondercard::MemoryCardSlot::read_block |
( |
std::size_t |
index, |
|
|
MemoryCard::Block |
data |
|
) |
| |
Reads the specified block of the inserted card.
- Returns
- true/false indicating read sucess/failure
- Parameters
-
| index | Block to read from |
| [out] | data | destination to write read data to |
- Todo:
- Change return type to an enum or introduce exception throwing so the variety of causes of failure can be determined by the caller.
◆ read_card()
Reads the entire contents of the inserted card.
- Returns
- true/false indicating read sucess/failure
- Parameters
-
| [out] | data | destination to write read data to |
- Warning
- Not Implemented
◆ read_sector()
| bool com::saxbophone::wondercard::MemoryCardSlot::read_sector |
( |
std::size_t |
index, |
|
|
MemoryCard::Sector |
data |
|
) |
| |
Reads the specified sector of the inserted card.
- Returns
- true/false indicating read sucess/failure
- Parameters
-
| index | Sector to read from |
| [out] | data | destination to write read data to |
- Todo:
- Change return type to an enum or introduce exception throwing so the variety of causes of failure can be determined by the caller.
◆ remove_card()
| bool com::saxbophone::wondercard::MemoryCardSlot::remove_card |
( |
| ) |
|
◆ send()
| bool com::saxbophone::wondercard::MemoryCardSlot::send |
( |
TriState |
command, |
|
|
TriState & |
data |
|
) |
| |
Sends the given command byte to the inserted MemoryCard.
- Returns
false when there is no MemoryCard inserted
-
Response value from inserted MemoryCard when one is inserted
- Parameters
-
| command | Command byte to send (pass std::nullopt for High-Z) |
| [out] | data | Destination to write response data to |
◆ write_block()
| bool com::saxbophone::wondercard::MemoryCardSlot::write_block |
( |
std::size_t |
index, |
|
|
MemoryCard::Block |
data |
|
) |
| |
Writes data from the given span to the specified block of the inserted card.
- Returns
- true/false indicating write sucess/failure
- Parameters
-
| index | Block to write to |
| data | Data to write to the block |
◆ write_card()
Writes data from the given span to the entire card.
- Returns
- true/false indicating write sucess/failure
- Parameters
-
| data | Data to write to the card |
◆ write_sector()
| bool com::saxbophone::wondercard::MemoryCardSlot::write_sector |
( |
std::size_t |
index, |
|
|
MemoryCard::Sector |
data |
|
) |
| |
Writes data from the given span to the specified sector of the inserted card.
- Returns
- true/false indicating write sucess/failure
- Parameters
-
| index | Sector to write to |
| data | Data to write to the sector |
The documentation for this class was generated from the following files: