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

Static Public Member Functions

static void write (uint32_t addr, const void *buf, uint32_t len)
 Performs write to the device.
 
static void read (uint32_t addr, void *buf, size_t len)
 Reads data from the device.
 
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 void erase (uint32_t addr, size_t len)
 Erases sector(s) of the device.
 

Detailed Description

template<uint32_t ERASE_PAGE_SIZE>
class TiFlash< ERASE_PAGE_SIZE >

Definition at line 141 of file TiFlash.hxx.

Constructor & Destructor Documentation

◆ TiFlash()

template<uint32_t ERASE_PAGE_SIZE>
constexpr TiFlash< ERASE_PAGE_SIZE >::TiFlash ( )
inlineconstexpr

Definition at line 144 of file TiFlash.hxx.

Member Function Documentation

◆ erase()

template<uint32_t ERASE_PAGE_SIZE>
static void TiFlash< ERASE_PAGE_SIZE >::erase ( uint32_t  addr,
size_t  len 
)
inlinestatic

Erases sector(s) of the device.

Parameters
addrbeginning of the sector to erase. Must be sector aligned.
lenhow many bytes to erase (must be multiple of sector size).

Definition at line 249 of file TiFlash.hxx.

◆ next_sector_address()

template<uint32_t ERASE_PAGE_SIZE>
static uint32_t TiFlash< 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 241 of file TiFlash.hxx.

◆ read()

template<uint32_t ERASE_PAGE_SIZE>
static void TiFlash< ERASE_PAGE_SIZE >::read ( uint32_t  addr,
void *  buf,
size_t  len 
)
inlinestatic

Reads data from the device.

Parameters
addrwhere to read from (address space of the MCU)
bufpoints to where to put the data read
lenhow many bytes to read

Definition at line 231 of file TiFlash.hxx.

◆ write()

template<uint32_t ERASE_PAGE_SIZE>
static void TiFlash< ERASE_PAGE_SIZE >::write ( uint32_t  addr,
const void *  buf,
uint32_t  len 
)
inlinestatic

Performs write to the device.

This call is synchronous; does not return until the write is complete.

Parameters
addrwhere to write (in the address space of the MCU).
bufdata to write
lenhow many bytes to write

Definition at line 152 of file TiFlash.hxx.


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