52inline const uint32_t *TivaEEPROMEmulation::get_block(
53 unsigned sector,
unsigned offset)
65 return get_block(sector, offset);
82 auto* address = get_block(sector, 0);
88 while (sectors_per_sector)
91 MAP_FlashErase((uint32_t)address + (
FAMILY * --sectors_per_sector));
104 unsigned sector,
unsigned start_block, uint32_t *data, uint32_t byte_count)
109 auto* address = get_block(sector, start_block);
111 portENTER_CRITICAL();
112 MAP_FlashProgram(data, (uint32_t)address, byte_count);
const char __eeprom_start
Linker-defined symbol where in the memory space (flash) the eeprom emulation data starts.
Emulates EEPROM in FLASH for the Tiva, LPC17xx and LPC40xx platforms.
static const size_t BLOCK_SIZE
block size in bytes
const uint16_t rawBlockCount_
How many blocks are there in a sector.
static const size_t SECTOR_SIZE
Sector size in bytes.
void mount()
Mount the EEPROM file.
static const size_t BYTES_PER_BLOCK
useful data bytes size in bytes
const uint8_t sectorCount_
Total number of sectors available.
size_t file_size()
Get the maximum file size of the EEPROM file.
static const unsigned FAMILY
Family that device belongs to
void flash_program(unsigned sector, unsigned start_block, uint32_t *data, uint32_t byte_count) override
Simple hardware abstraction for FLASH program API.
TivaEEPROMEmulation()
Default constructor.
void flash_erase(unsigned sector) override
Simple hardware abstraction for FLASH erase API.
const uint32_t * block(unsigned sector, unsigned offset) override
Computes the pointer to load the data stored in a specific block from.
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.