|
Open Model Railroad Network (OpenMRN)
|
Strategy module for finding flash erase sector numbers when the sectors are different sizes. More...
#include <Stm32Flash.hxx>
Public Member Functions | |
| constexpr | FlashVariableSectors (uint32_t *bank_config) |
| bank_config is an array of uint32 addresses, containing the start of each sector. | |
| uint32_t | next_sector_address (uint32_t addr) |
| Aligns an address to the next possible sector start (i.e., rounds up to sector boundary). | |
| std::pair< unsigned, uint32_t > | lookup_sector (uint32_t addr) |
| Lookup the next sector for an address, and return the {sector number, address} pair. | |
Protected Attributes | |
| unsigned | lastIndex_ {0} |
| 1-element cache on where to start looking for sectors. | |
Private Attributes | |
| uint32_t * | bankConfig_ |
| Contains an array of the start addresses of the erase sectors. | |
Strategy module for finding flash erase sector numbers when the sectors are different sizes.
Definition at line 73 of file Stm32Flash.hxx.
|
inlineconstexpr |
bank_config is an array of uint32 addresses, containing the start of each sector.
The sector number is the index in this array. As a sentinel, the element after the last shall be 0xfffffffful.
Definition at line 78 of file Stm32Flash.hxx.
|
inline |
Lookup the next sector for an address, and return the {sector number, address} pair.
Definition at line 110 of file Stm32Flash.hxx.
|
inline |
Aligns an address to the next possible sector start (i.e., rounds up to sector boundary).
| addr | an address in the flash address space. |
Definition at line 87 of file Stm32Flash.hxx.
|
private |
Contains an array of the start addresses of the erase sectors.
Definition at line 123 of file Stm32Flash.hxx.
|
protected |
1-element cache on where to start looking for sectors.
bankConfig_[lastIndex_] <= last address that was queried.
Definition at line 119 of file Stm32Flash.hxx.