|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Manages logical-to-physical RMEM slot mapping for module storage layers. More...
#include <SlotManager.h>
Public Member Functions | |
| void | setSlotRange (uint16_t start, uint16_t end, uint8_t moduleId) |
| Configures logical-to-physical slot mapping using raw values. | |
| void | setSlotRange (const IModule::SlotRange &range) |
| Configures logical-to-physical slot mapping from a SlotRange struct. | |
| uint16_t | capacity () const |
| Returns available entry capacity from configured slot range. | |
| bool | toPhysicalSlot (uint16_t logicalIndex, uint16_t *slotOut) const |
| Converts logical index to physical RMEM slot. | |
| bool | toLogicalSlot (uint16_t slot, uint16_t *logicalIndexOut) const |
| Converts physical RMEM slot to logical index. | |
| bool | findFreeSlot (uint16_t *slotOut) const |
| Finds first free physical slot in configured range. | |
| bool | hasSlotRange () const |
| Returns whether a valid slot range is configured. | |
| uint16_t | rmemStart () const |
| Returns configured RMEM start slot. | |
| uint16_t | rmemEnd () const |
| Returns configured RMEM end slot. | |
| uint8_t | moduleId () const |
| Returns configured owning module identifier. | |
Protected Attributes | |
| bool | hasSlotRange_ = false |
| uint16_t | rmemStart_ = 0 |
| uint16_t | rmemEnd_ = 0 |
| uint8_t | moduleId_ = 0 |
Manages logical-to-physical RMEM slot mapping for module storage layers.
Encapsulates slot range bookkeeping and free-slot discovery shared by OathStore, PasswordStore, and other storage layers backed by the Tropic secure element.
Definition at line 19 of file SlotManager.h.
|
inline |
Returns available entry capacity from configured slot range.
Definition at line 57 of file SlotManager.h.
References hasSlotRange_, rmemEnd_, and rmemStart_.
Referenced by findFreeSlot().
|
inline |
Finds first free physical slot in configured range.
| slotOut | Output physical slot. |
Definition at line 96 of file SlotManager.h.
References capacity(), cdc::core::TropicStorage::forEachSlot(), hasSlotRange_, cdc::core::TropicStorage::instance(), moduleId_, rmemEnd_, and rmemStart_.
|
inline |
Returns whether a valid slot range is configured.
Definition at line 142 of file SlotManager.h.
References hasSlotRange_.
|
inline |
Returns configured owning module identifier.
Definition at line 160 of file SlotManager.h.
References moduleId_.
Referenced by setSlotRange().
|
inline |
Returns configured RMEM end slot.
Definition at line 154 of file SlotManager.h.
References rmemEnd_.
|
inline |
Returns configured RMEM start slot.
Definition at line 148 of file SlotManager.h.
References rmemStart_.
|
inline |
Configures logical-to-physical slot mapping from a SlotRange struct.
| range | Slot range descriptor (only RMEM fields are consumed). |
Definition at line 45 of file SlotManager.h.
References cdc::core::IModule::SlotRange::hasRmem, cdc::core::IModule::SlotRange::moduleId, cdc::core::IModule::SlotRange::rmemEnd, cdc::core::IModule::SlotRange::rmemStart, and setSlotRange().
|
inline |
Configures logical-to-physical slot mapping using raw values.
| start | First RMEM slot. |
| end | Last RMEM slot. |
| moduleId | Owning module identifier. |
Definition at line 27 of file SlotManager.h.
References hasSlotRange_, moduleId(), moduleId_, rmemEnd_, and rmemStart_.
Referenced by setSlotRange().
|
inline |
Converts physical RMEM slot to logical index.
| slot | Physical slot. |
| logicalIndexOut | Output logical index. |
Definition at line 83 of file SlotManager.h.
References hasSlotRange_, rmemEnd_, and rmemStart_.
|
inline |
Converts logical index to physical RMEM slot.
| logicalIndex | Logical index. |
| slotOut | Output physical slot. |
Definition at line 68 of file SlotManager.h.
References hasSlotRange_, rmemEnd_, and rmemStart_.
|
protected |
Definition at line 163 of file SlotManager.h.
Referenced by capacity(), findFreeSlot(), hasSlotRange(), setSlotRange(), toLogicalSlot(), and toPhysicalSlot().
|
protected |
Definition at line 166 of file SlotManager.h.
Referenced by findFreeSlot(), moduleId(), and setSlotRange().
|
protected |
Definition at line 165 of file SlotManager.h.
Referenced by capacity(), findFreeSlot(), rmemEnd(), setSlotRange(), toLogicalSlot(), and toPhysicalSlot().
|
protected |
Definition at line 164 of file SlotManager.h.
Referenced by capacity(), findFreeSlot(), rmemStart(), setSlotRange(), toLogicalSlot(), and toPhysicalSlot().