bn::sram namespace
#include <bn_sram.h>

SRAM related functions.

Functions

auto size() -> int constexpr
Returns the total SRAM size in bytes.
template<typename Type>
void read(Type& destination)
Copies SRAM data into the given value.
template<typename Type>
void read_offset(Type& destination, int offset)
Copies SRAM data into the given value.
template<typename Type>
void write(const Type& source)
Copies the given value into SRAM.
template<typename Type>
void write_offset(const Type& source, int offset)
Copies the given value into SRAM.
void clear(int bytes)
Clears (fills with zero) SRAM.
void clear(int bytes, int offset)
Clears (fills with zero) SRAM.
void set_bytes(uint8_t value, int bytes)
Fills SRAM with the given value.
void set_bytes(uint8_t value, int bytes, int offset)
Fills SRAM with the given value.

Function documentation

template<typename Type>
void bn::sram::read(Type& destination)

Copies SRAM data into the given value.

Parameters
destination SRAM data is copied into this value.

template<typename Type>
void bn::sram::read_offset(Type& destination, int offset)

Copies SRAM data into the given value.

Parameters
destination SRAM data is copied into this value.
offset Copying starts from SRAM start address + this offset.

template<typename Type>
void bn::sram::write(const Type& source)

Copies the given value into SRAM.

Parameters
source Value to copy.

template<typename Type>
void bn::sram::write_offset(const Type& source, int offset)

Copies the given value into SRAM.

Parameters
source Value to copy.
offset The given value is copied into SRAM start address + this offset.

void bn::sram::clear(int bytes)

Clears (fills with zero) SRAM.

Parameters
bytes Number of bytes to clear.

void bn::sram::clear(int bytes, int offset)

Clears (fills with zero) SRAM.

Parameters
bytes Number of bytes to clear.
offset Clear starts from SRAM start address + this offset.

void bn::sram::set_bytes(uint8_t value, int bytes)

Fills SRAM with the given value.

Parameters
value Value to fill with.
bytes Number of bytes to fill.

void bn::sram::set_bytes(uint8_t value, int bytes, int offset)

Fills SRAM with the given value.

Parameters
value Value to fill with.
bytes Number of bytes to fill.
offset Fill starts from SRAM start address + this offset.