Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
FlashFixedSectors< ERASE_PAGE_SIZE > Struct Template Reference

Strategy module for finding flash erase sector numbers when the sectors are constant size. More...

#include <Stm32Flash.hxx>

Static Public Member Functions

static uint32_t next_sector_address (uint32_t addr)
 Aligns an address to the next possible sector start (i.e., rounds up to sector boundary).
 
static std::pair< unsigned, uint32_t > lookup_sector (uint32_t addr)
 Lookup the next sector for an address, and return the {sector number, address} pair.
 

Detailed Description

template<uint32_t ERASE_PAGE_SIZE>
struct FlashFixedSectors< ERASE_PAGE_SIZE >

Strategy module for finding flash erase sector numbers when the sectors are constant size.

Definition at line 44 of file Stm32Flash.hxx.

Member Function Documentation

◆ lookup_sector()

template<uint32_t ERASE_PAGE_SIZE>
static std::pair< unsigned, uint32_t > FlashFixedSectors< ERASE_PAGE_SIZE >::lookup_sector ( uint32_t  addr)
inlinestatic

Lookup the next sector for an address, and return the {sector number, address} pair.

Definition at line 61 of file Stm32Flash.hxx.

◆ next_sector_address()

template<uint32_t ERASE_PAGE_SIZE>
static uint32_t FlashFixedSectors< ERASE_PAGE_SIZE >::next_sector_address ( uint32_t  addr)
inlinestatic

Aligns an address to the next possible sector start (i.e., rounds up to sector boundary).

Parameters
addran address in the flash address space.
Returns
If addr is the first byte of a sector, then returns addr unmodified. Otherwise returns the starting address of the next sector.

Definition at line 51 of file Stm32Flash.hxx.


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