MySensors Library & Examples  2.3.2
Public Member Functions | List of all members
FlashClass Class Reference

Detailed Description

This class provides low-level access to internal Flash memory.

Definition at line 89 of file Flash.h.

#include <Flash.h>

+ Collaboration diagram for FlashClass:

Public Member Functions

 FlashClass ()
 
void begin ()
 
void end ()
 
uint32_t page_size () const
 
uint8_t page_size_bits () const
 
uint32_t page_count () const
 
uint32_t specified_erase_cycles () const
 
uint32_t * page_address (size_t page)
 
uint32_t * top_app_page_address ()
 
void erase (uint32_t *address, size_t size)
 
void erase_all ()
 
void write (uint32_t *address, uint32_t value)
 
void write_block (uint32_t *dst_address, uint32_t *src_address, uint16_t word_count)
 

Constructor & Destructor Documentation

◆ FlashClass()

FlashClass::FlashClass ( )
inline

Constructor

Definition at line 94 of file Flash.h.

Member Function Documentation

◆ begin()

void FlashClass::begin ( )
inline

Initialize Flash

Definition at line 97 of file Flash.h.

◆ end()

void FlashClass::end ( )
inline

Deinitialize Flash

Definition at line 99 of file Flash.h.

◆ erase()

void FlashClass::erase ( uint32_t *  address,
size_t  size 
)

Erase a page of given size. Size must be page_size aligned! Take care about RADIO, WDT and Interrupt timing!

Parameters
[in]*addressPointer to page
[in]sizenumber of page aligned bytes to erase

◆ erase_all()

void FlashClass::erase_all ( )

Erase the complete MCU. This can brick your device!

◆ page_address()

uint32_t* FlashClass::page_address ( size_t  page)

Get a address of a page

Parameters
[in]pagePage number, starting at 0
Returns
address of given page

◆ page_count()

uint32_t FlashClass::page_count ( ) const

Number of managed flash pages

Returns
Number of pages

◆ page_size()

uint32_t FlashClass::page_size ( ) const

Page size in bytes

Returns
Number of bytes

◆ page_size_bits()

uint8_t FlashClass::page_size_bits ( ) const

Page address width in bits. Page size is 2^x

Returns
Number of bits

◆ specified_erase_cycles()

uint32_t FlashClass::specified_erase_cycles ( ) const

Number of page erase cycles

Returns
Number of page erase cycles

◆ top_app_page_address()

uint32_t* FlashClass::top_app_page_address ( )

Get top of available flash for application data

Returns
Last available address + 1

◆ write()

void FlashClass::write ( uint32_t *  address,
uint32_t  value 
)

write a aligned 32 bit word to flash.

Parameters
[in]*address32 bit aligned pointer to destination word
[in]valueData word to write

◆ write_block()

void FlashClass::write_block ( uint32_t *  dst_address,
uint32_t *  src_address,
uint16_t  word_count 
)

write a aligned block to flash.

Parameters
[in]*dst_address32 bit aligned pointer to destination
[in]*src_address32 bit aligned pointer to source
[in]word_countNumber of words to write

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