|
Open Model Railroad Network (OpenMRN)
|
Public Member Functions | |
| template<typename... Args> | |
| EEPROMStoredBitSet (Args... args) | |
| void | flush () override |
| Writes the current values to persistent storage. | |
Public Member Functions inherited from ShadowedStoredBitSet | |
| StoredBitSet & | set_bit (unsigned offset, bool value) override |
| Sets an individual bit to a specific value. | |
| bool | get_bit (unsigned offset) override |
| Retrieves an individual bit. | |
| StoredBitSet & | set_multi (unsigned offset, unsigned size, unsigned value) override |
| Sets a block of consecutive bits. | |
| unsigned | get_multi (unsigned offset, unsigned size) override |
| Returns a block of consecutive bits as an integer value. | |
| unsigned | size () override |
| void | lock_and_flush () override |
| Grabs a lock and writes the current values to persistent storage. | |
Private Types | |
| using | eeprom_t = typename HW::eeprom_t |
Private Member Functions | |
| void | mount () |
| void | clear_all_dirty () |
| void | format () |
| void | write_header () |
| void | read_entry (eeprom_t v) |
| unsigned | value_to_vcell_ofs (eeprom_t value) |
| unsigned | value_to_vcell_value (eeprom_t value) |
| eeprom_t | get_vcell (unsigned vcell) |
Private Attributes | |
| eeprom_t | currentMarker_ |
| What is the current desired value of the marker bit. | |
| unsigned | writeOffset_ |
Static Private Attributes | |
| static constexpr eeprom_t | MARKER_MASK |
| The MSB of each eeprom value is the marker. | |
| static constexpr eeprom_t | EEPROM_MASK = eeprom_t(-1) |
| static constexpr eeprom_t | MAGIC |
| Magic value in the zero offset certifies that we are correctly formatted. | |
| static constexpr eeprom_t | ERASED = 0xFFFFFFFFU & EEPROM_MASK |
| static constexpr unsigned | FIRST_MAGIC_OFS = 0 |
| static constexpr unsigned | SECOND_MAGIC_OFS = 1 |
| static constexpr unsigned | HEADER_OFS = 2 |
| static constexpr unsigned | JOURNAL_OFS |
Additional Inherited Members | |
Protected Types inherited from ShadowedStoredBitSet | |
| typedef uint8_t | cell_offs_t |
| Type indexing cells. Must be an unsigned type. | |
| typedef unsigned | bit_offs_t |
| Type indexing all bits. | |
Protected Member Functions inherited from ShadowedStoredBitSet | |
| ShadowedStoredBitSet (unsigned size, uint8_t granularity) | |
| cell_offs_t | next_dirty () |
| void | clear_dirty (cell_offs_t cell) |
| Clears the dirty bit for a given cell. | |
| bool | is_dirty (cell_offs_t cell) |
| cell_offs_t | num_cells () |
Protected Member Functions inherited from Atomic | |
| void | lock () |
| void | unlock () |
Static Protected Attributes inherited from ShadowedStoredBitSet | |
| static constexpr cell_offs_t | NO_CELL = static_cast<cell_offs_t>(-1) |
Definition at line 83 of file EEPROMStoredBitSet.hxx.
|
private |
Definition at line 126 of file EEPROMStoredBitSet.hxx.
|
inline |
Definition at line 87 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 181 of file EEPROMStoredBitSet.hxx.
|
inlineoverridevirtual |
Writes the current values to persistent storage.
The caller is responsible for locking.
Implements StoredBitSet.
Definition at line 95 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 190 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 246 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 128 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 229 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 236 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 241 of file EEPROMStoredBitSet.hxx.
|
inlineprivate |
Definition at line 204 of file EEPROMStoredBitSet.hxx.
|
private |
What is the current desired value of the marker bit.
Definition at line 276 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Definition at line 260 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Definition at line 267 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Definition at line 269 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Definition at line 271 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Definition at line 272 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Magic value in the zero offset certifies that we are correctly formatted.
Definition at line 264 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
The MSB of each eeprom value is the marker.
This alternates between zero and one every time we wrap around.
Definition at line 257 of file EEPROMStoredBitSet.hxx.
|
staticconstexprprivate |
Definition at line 270 of file EEPROMStoredBitSet.hxx.
|
private |
Definition at line 277 of file EEPROMStoredBitSet.hxx.