|
Open Model Railroad Network (OpenMRN)
|
Memory space implementation that exports a some memory-mapped data as a read-only memory space. More...
#include <MemoryConfig.hxx>
Public Member Functions | |
| ReadOnlyMemoryBlock (const void *data) | |
| Creates a memory block for a given pointer of data. | |
| ReadOnlyMemoryBlock (const void *data, address_t len) | |
| Initializes a memory block with a given block of memory. | |
| address_t | max_address () OVERRIDE |
| size_t | read (address_t source, uint8_t *dst, size_t len, errorcode_t *error, Notifiable *again) OVERRIDE |
Public Member Functions inherited from openlcb::MemorySpace | |
| virtual bool | set_node (Node *node) |
| Specifies which node the next operation pertains. | |
| virtual bool | read_only () |
| virtual address_t | min_address () |
| virtual size_t | write (address_t destination, const uint8_t *data, size_t len, errorcode_t *error, Notifiable *again) |
| virtual errorcode_t | freeze () |
| Handles space freeze command. | |
| virtual errorcode_t | unfreeze () |
| Handles space unfreeze command. | |
Private Attributes | |
| const uint8_t * | data_ |
| const address_t | len_ |
Additional Inherited Members | |
Public Types inherited from openlcb::MemorySpace | |
| typedef uint32_t | address_t |
| typedef uint16_t | errorcode_t |
Static Public Attributes inherited from openlcb::MemorySpace | |
| static const errorcode_t | ERROR_AGAIN = 0x3FFF |
| This error code signals that the operation was only partially completed, the again notify was used and will be notified when the operation can be re-tried). | |
Memory space implementation that exports a some memory-mapped data as a read-only memory space.
The data must be given as a const void* pointer, which can point both to RAM or flash (either rodata or specific flash addresses).
Definition at line 134 of file MemoryConfig.hxx.
|
inline |
Creates a memory block for a given pointer of data.
The pointer must stay alive so long as this object is alive.
| data | is a null-terminated string, which may point into read-only memory. |
Definition at line 140 of file MemoryConfig.hxx.
|
inline |
Initializes a memory block with a given block of memory.
The address range [data, data+len) must be dereferenceable for read so long as this object is alive. It may point into read-only memory.
Definition at line 149 of file MemoryConfig.hxx.
|
inlinevirtual |
Implements openlcb::MemorySpace.
Definition at line 155 of file MemoryConfig.hxx.
|
inlinevirtual |
| again | when a re-try makes sense. The caller should call read once more, with the offset adjusted with the previously returned bytes. |
Implements openlcb::MemorySpace.
Definition at line 160 of file MemoryConfig.hxx.
|
private |
Definition at line 177 of file MemoryConfig.hxx.
|
private |
Definition at line 178 of file MemoryConfig.hxx.