![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Represents target device memory as a disk file. More...
#include <SimulatorMemory.h>
Inheritance diagram for blfwk::MemoryStore:Public Types | |
| enum | { kMapIndexFlash = 0, kMapIndexSRAM = 1 } |
| Map indicies. More... | |
Public Member Functions | |
| MemoryStore (int mapIndex, uint32_t fillByte=0) | |
| Constructor that takes a map index. More... | |
| bool | open (const std::string &pathToDir, bool forceCreate) |
| Open the store. More... | |
| void | close () |
| Close the store. | |
| size_t | read (long int offset, size_t size, unsigned char *buffer) |
| Read from memory. More... | |
| size_t | write (long int offset, size_t size, const unsigned char *buffer) |
| Write to memory. More... | |
| void | erase (long int offset, size_t size) |
| Erase memory. More... | |
| void | erase () |
| Erase all memory. | |
Protected Attributes | |
| int | m_mapIndex |
| Index of memory map entry. | |
| uint8_t | m_fillByte |
| Erase value. | |
| size_t | m_size |
| Size of memory file. | |
| uint32_t | m_startAddress |
| Address address from map. | |
| FILE * | m_memoryFile |
| Handle to memory file. | |
Represents target device memory as a disk file.
|
inline |
Constructor that takes a map index.
| mapIndex | Index into memory map array |
| fillByte | Optional byte erase value, default 0 |
| void MemoryStore::erase | ( | long int | offset, |
| size_t | size | ||
| ) |
Erase memory.
The requested offset is adjusted by the store's start address to create a zero-based file offset.
| offset | Offset into memory region |
| size | Number of bytes to erase |
| bool MemoryStore::open | ( | const std::string & | pathToDir, |
| bool | forceCreate | ||
| ) |
Open the store.
| pathToDir | Directory for memory backing file. |
| forceCreate | True to re-create backing file even if it exists. |
| size_t MemoryStore::read | ( | long int | offset, |
| size_t | size, | ||
| unsigned char * | buffer | ||
| ) |
Read from memory.
The requested offset is adjusted by the store's start address to create a zero-based file offset.
| offset | Offset into memory region |
| size | Number of bytes to read |
| buffer | Destination buffer |
| size_t MemoryStore::write | ( | long int | offset, |
| size_t | size, | ||
| const unsigned char * | buffer | ||
| ) |
Write to memory.
The requested offset is adjusted by the store's start address to create a zero-based file offset.
| offset | Offset into memory region |
| size | Number of bytes to write |
| buffer | Source buffer |