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

Detailed Description

Nonvolatile Memory.

Definition at line 38 of file NVRAM.h.

#include <NVRAM.h>

+ Collaboration diagram for NVRAMClass:

Public Member Functions

 NVRAMClass ()
 
void begin ()
 
void end ()
 
uint16_t length () const
 
void read_block (uint8_t *dst, uint16_t idx, uint16_t n)
 
uint8_t read (const uint16_t idx)
 
bool write_block (uint8_t *src, uint16_t idx, uint16_t n)
 
bool write (const uint16_t idx, uint8_t value)
 
int write_prepare (uint16_t number)
 
void clean_up (uint16_t write_preserve)
 

Constructor & Destructor Documentation

◆ NVRAMClass()

NVRAMClass::NVRAMClass ( )
inline

Constructor.

Definition at line 43 of file NVRAM.h.

Member Function Documentation

◆ begin()

void NVRAMClass::begin ( )
inline

Initialize Class

Definition at line 46 of file NVRAM.h.

◆ clean_up()

void NVRAMClass::clean_up ( uint16_t  write_preserve)

lear log if full and prepare released pages for faster reallocation. Runtime up to 5000ms!

Parameters
[in]write_preserveByte to preserve

◆ end()

void NVRAMClass::end ( )
inline

Deinitialize Class

Definition at line 49 of file NVRAM.h.

◆ length()

uint16_t NVRAMClass::length ( ) const

NVM available space in bytes

Returns
Number of bytes

◆ read()

uint8_t NVRAMClass::read ( const uint16_t  idx)

Read a byte

Parameters
[in]idxNVM Address to read
Returns
Byte from given address

◆ read_block()

void NVRAMClass::read_block ( uint8_t *  dst,
uint16_t  idx,
uint16_t  n 
)

Read a block of bytes

Parameters
[in]*dstWrite bytes to given pointer
[in]idxFirst NVM address to read
[in]nNumber of bytes to read

◆ write()

bool NVRAMClass::write ( const uint16_t  idx,
uint8_t  value 
)

Write a byte

Parameters
[in]idxNVM Address to write
[in]valueByte to write
Returns
success

◆ write_block()

bool NVRAMClass::write_block ( uint8_t *  src,
uint16_t  idx,
uint16_t  n 
)

Write a block

Parameters
[in]*srcRead bytes from given pointer
[in]idxFirst NVM address to write
[in]nNumber of bytes to write
Returns
success

◆ write_prepare()

int NVRAMClass::write_prepare ( uint16_t  number)

Preserve the number of bytes in NVM log for time critical writes. Runtime up to 5000ms!

Parameters
[in]numberBytes to preserve, can 0 to find out free log space
Returns
Bytes available for writing

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