Mbed OS Reference
Loading...
Searching...
No Matches
Platform

Modules

 ATCmdParser class
 
 CacheAlignedBuffer class
 
 Callback class
 
 CircularBuffer functions
 
 CriticalSectionLock functions
 
 CThunk class
 
 DeepSleepLock functions
 
 DirHandle functions
 
 File
 
 LocalFileSystem functions
 
 Assert macros
 
 atomic functions
 Atomic functions function analogously to C11 and C++11 - loads have acquire semantics, stores have release semantics, and atomic operations are sequentially consistent.
 
 chrono utilities
 Additions and variations of std::chrono.
 
 critical section function
 
 Debug functions
 
 Error functions
 
 Network interface and other utility functions
 
 mem_trace functions
 
 mktime functions
 
 MPU management functions
 
 poll functions
 
 Power management functions
 
 preprocessor macros
 
 Retarget functions
 
 rtc_time functions
 
 stats functions
 
 Mbed Thread
 
 Toolchain functions
 
 Version macros
 
 wait_api functions
 
 NonCopyable class
 
 ScopedLock functions
 
 SingletonPtr class
 
 Span class
 
 Stream class
 
 Transaction class
 

Data Structures

class  ScopedRamExecutionLock
 RAII object for disabling, then restoring RAM execute never mode Usage: More...
 
class  ScopedRomWriteLock
 RAII object for disabling, then restoring ROM write never mode Usage: More...
 

Enumerations

enum  { MBED_MEM_TRACE_MALLOC , MBED_MEM_TRACE_REALLOC , MBED_MEM_TRACE_CALLOC , MBED_MEM_TRACE_FREE }
 enum Memory operation types for tracer More...
 

Functions

constexpr size_t getNeededBackingBufferSize (size_t neededCapacity, size_t elementSize)
 Calculate the needed capacity for a cache aligned buffer's backing buffer based on the needed capacity and element size. More...
 
static DataT * findCacheLineStart (uint8_t *buffer)
 Find and return the first location in the given buffer that starts on a cache line. More...
 
DataT * data ()
 Get a pointer to the aligned data array inside the buffer. More...
 
DataT const * data () const
 Get a pointer to the aligned data array inside the buffer (const version) More...
 
DataT & operator[] (size_t index)
 Element access. More...
 
DataT operator[] (size_t index) const
 Element access (const) More...
 
iterator begin ()
 Get iterator for start of buffer. More...
 
const_iterator begin () const
 Get iterator for start of buffer. More...
 
iterator end ()
 Get iterator for end of buffer. More...
 
const_iterator end () const
 Get iterator for end of buffer. More...
 
constexpr size_t capacity ()
 
 StaticCacheAlignedBuffer ()
 Construct new cache-aligned buffer. More...
 
 StaticCacheAlignedBuffer (StaticCacheAlignedBuffer const &other)
 Copy from other cache-aligned buffer. More...
 
StaticCacheAlignedBufferoperator= (StaticCacheAlignedBuffer< DataT, BufferSize > const &other)
 Assign from other cache-aligned buffer. More...
 
 DynamicCacheAlignedBuffer (size_t capacity)
 Construct new cache-aligned buffer. More...
 
 DynamicCacheAlignedBuffer (DynamicCacheAlignedBuffer const &other)
 Copy from other cache-aligned buffer. More...
 
DynamicCacheAlignedBufferoperator= (DynamicCacheAlignedBuffer const &other)
 Assign from other cache-aligned buffer with the same type. More...
 

Variables

DataT * _alignedBufferPtr
 Pointer to the aligned buffer. Must be set in each constructor of each subclass. More...
 
size_t _alignedBufferCapacity
 Capacity of the aligned buffer, in terms of number of DataT elements. More...
 

Detailed Description

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enum Memory operation types for tracer

Enumerator
MBED_MEM_TRACE_MALLOC 

Identifier for malloc operation.

MBED_MEM_TRACE_REALLOC 

Identifier for realloc operation.

MBED_MEM_TRACE_CALLOC 

Identifier for calloc operation.

MBED_MEM_TRACE_FREE 

Identifier for free operation.

Definition at line 34 of file mbed_mem_trace.h.

Function Documentation

◆ getNeededBackingBufferSize()

constexpr size_t getNeededBackingBufferSize ( size_t  neededCapacity,
size_t  elementSize 
)
constexpr

Calculate the needed capacity for a cache aligned buffer's backing buffer based on the needed capacity and element size.

Parameters
neededCapacityCapacity needed for the buffer
elementSizeSize of each element
Returns
Needed backing buffer size

Definition at line 37 of file CacheAlignedBuffer.h.

◆ findCacheLineStart()

static DataT * findCacheLineStart ( uint8_t *  buffer)
staticprotected

Find and return the first location in the given buffer that starts on a cache line.

If this MCU does not use a cache, this function is a no-op.

Parameters
bufferPointer to buffer
Returns
Pointer to first data item, aligned at the start of a cache line.

Definition at line 128 of file CacheAlignedBuffer.h.

◆ data() [1/2]

DataT * data ( )

Get a pointer to the aligned data array inside the buffer.

Definition at line 153 of file CacheAlignedBuffer.h.

◆ data() [2/2]

DataT const * data ( ) const

Get a pointer to the aligned data array inside the buffer (const version)

Definition at line 161 of file CacheAlignedBuffer.h.

◆ operator[]() [1/2]

DataT & operator[] ( size_t  index)

Element access.

Definition at line 169 of file CacheAlignedBuffer.h.

◆ operator[]() [2/2]

DataT operator[] ( size_t  index) const

Element access (const)

Definition at line 177 of file CacheAlignedBuffer.h.

◆ begin() [1/2]

iterator begin ( )

Get iterator for start of buffer.

Definition at line 185 of file CacheAlignedBuffer.h.

◆ begin() [2/2]

const_iterator begin ( ) const

Get iterator for start of buffer.

Definition at line 193 of file CacheAlignedBuffer.h.

◆ end() [1/2]

iterator end ( )

Get iterator for end of buffer.

Definition at line 201 of file CacheAlignedBuffer.h.

◆ end() [2/2]

const_iterator end ( ) const

Get iterator for end of buffer.

Definition at line 209 of file CacheAlignedBuffer.h.

◆ capacity()

constexpr size_t capacity ( )
constexpr
Returns
The maximum amount of DataT elements that this buffer can hold.

Definition at line 217 of file CacheAlignedBuffer.h.

◆ StaticCacheAlignedBuffer() [1/2]

Construct new cache-aligned buffer.

Buffer will be zero-initialized.

Definition at line 245 of file CacheAlignedBuffer.h.

◆ StaticCacheAlignedBuffer() [2/2]

StaticCacheAlignedBuffer ( StaticCacheAlignedBuffer< DataT, BufferSize > const &  other)

Copy from other cache-aligned buffer.

Buffer memory will be copied.

Definition at line 255 of file CacheAlignedBuffer.h.

◆ operator=() [1/2]

StaticCacheAlignedBuffer & operator= ( StaticCacheAlignedBuffer< DataT, BufferSize > const &  other)

Assign from other cache-aligned buffer.

Buffer memory will be assigned.

Only a buffer with the same data type and size can be assigned.

Definition at line 267 of file CacheAlignedBuffer.h.

◆ DynamicCacheAlignedBuffer() [1/2]

DynamicCacheAlignedBuffer ( size_t  capacity)
explicit

Construct new cache-aligned buffer.

Buffer will be zero-initialized and allocated from the heap.

Parameters
capacityNumber of elements the buffer shall hold

Definition at line 292 of file CacheAlignedBuffer.h.

◆ DynamicCacheAlignedBuffer() [2/2]

Copy from other cache-aligned buffer.

A new backing buffer will be allocated on the heap and its data will be copied from the other buffer.

Definition at line 303 of file CacheAlignedBuffer.h.

◆ operator=() [2/2]

DynamicCacheAlignedBuffer & operator= ( DynamicCacheAlignedBuffer< DataT > const &  other)

Assign from other cache-aligned buffer with the same type.

A new buffer will be allocated of the correct size.

Definition at line 321 of file CacheAlignedBuffer.h.

Variable Documentation

◆ _alignedBufferPtr

DataT* _alignedBufferPtr
protected

Pointer to the aligned buffer. Must be set in each constructor of each subclass.

Definition at line 112 of file CacheAlignedBuffer.h.

◆ _alignedBufferCapacity

size_t _alignedBufferCapacity
protected

Capacity of the aligned buffer, in terms of number of DataT elements.

Definition at line 115 of file CacheAlignedBuffer.h.