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.
void read_span(span<uint8_t>& destination)
Copies SRAM data into the given span.
void read_span_offset(span<uint8_t>& destination, int offset)
Copies SRAM data into the given span.
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 write_span(const span<const uint8_t>& source)
Copies the given span into SRAM.
void write_span_offset(const span<const uint8_t>& source, int offset)
Copies the given span 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 trivially copyable 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 trivially copyable value.
offset Copying starts from SRAM start address + this offset.

void bn::sram::read_span(span<uint8_t>& destination)

Copies SRAM data into the given span.

Parameters
destination SRAM data is copied into this span.

void bn::sram::read_span_offset(span<uint8_t>& destination, int offset)

Copies SRAM data into the given span.

Parameters
destination SRAM data is copied into this span.
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. It must be trivially copyable.

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

Copies the given value into SRAM.

Parameters
source Value to copy. It must be trivially copyable.
offset The given value is copied into SRAM start address + this offset.

void bn::sram::write_span(const span<const uint8_t>& source)

Copies the given span into SRAM.

Parameters
source Span to copy.

void bn::sram::write_span_offset(const span<const uint8_t>& source, int offset)

Copies the given span into SRAM.

Parameters
source Span to copy.
offset The given span 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.