Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
EEPROMStoredBitSet_DefaultHW Class Reference

Template of how the HW class should look like. More...

#include <EEPROMStoredBitSet.hxx>

Inheritance diagram for EEPROMStoredBitSet_DefaultHW:
TivaEEPROMHwDefs< USER_BIT_COUNT, BITS_PER_CELL >

Protected Types

typedef uint32_t eeprom_t
 

Static Protected Member Functions

static unsigned bits_per_cell ()
 
static unsigned virtual_cell_count ()
 Defines how many virtual cells we store.
 
static unsigned physical_cell_count ()
 Defines.
 
static void write_cell (unsigned cell_offset, eeprom_t value)
 Writes to the physical storage.
 
static eeprom_t read_cell (unsigned cell_offset)
 Reads from the physical storage.
 

Detailed Description

Template of how the HW class should look like.

Definition at line 42 of file EEPROMStoredBitSet.hxx.

Member Typedef Documentation

◆ eeprom_t

typedef uint32_t EEPROMStoredBitSet_DefaultHW::eeprom_t
protected

Definition at line 45 of file EEPROMStoredBitSet.hxx.

Member Function Documentation

◆ bits_per_cell()

static unsigned EEPROMStoredBitSet_DefaultHW::bits_per_cell ( )
inlinestaticprotected
Returns
how many user bits we store per physical cell.

Definition at line 48 of file EEPROMStoredBitSet.hxx.

◆ physical_cell_count()

static unsigned EEPROMStoredBitSet_DefaultHW::physical_cell_count ( )
inlinestaticprotected

Defines.

Returns
how many cells are there in the physical storage. 0..physical_cell_count() - 1 will be the indexes in

Definition at line 65 of file EEPROMStoredBitSet.hxx.

◆ read_cell()

static eeprom_t EEPROMStoredBitSet_DefaultHW::read_cell ( unsigned  cell_offset)
staticprotected

Reads from the physical storage.

Parameters
cell_offsetthe eeprom cell to read.
Returns
the last written value of that cell.

◆ virtual_cell_count()

static unsigned EEPROMStoredBitSet_DefaultHW::virtual_cell_count ( )
inlinestaticprotected

Defines how many virtual cells we store.

The total size of the storage will be VIRTUAL_CELL_COUNT * BITS_PER_CELL. The maximum is 2 ^ (sizeof(eeprom_t) * 8 - bits_per_cell() - 1) - 1.

Returns
the number of cells in the address space

Definition at line 57 of file EEPROMStoredBitSet.hxx.

◆ write_cell()

static void EEPROMStoredBitSet_DefaultHW::write_cell ( unsigned  cell_offset,
eeprom_t  value 
)
staticprotected

Writes to the physical storage.

Parameters
cell_offsetthe eeprom cell to write, 0..physical_cell_count() - 1.
valueis the data to write to that cell.

The documentation for this class was generated from the following file: