Aviate Audio Multiverse Library
Public Member Functions | List of all members
Aviate::SramManager Class Referencefinal

SramManager provides a class to handle dividing an external SPI RAM into independent slots for general use. More...

#include <SramManager.h>

Public Member Functions

 SramManager (bool useDma)
 This object is created automatically by the framework. Do not instantiate directly. More...
 
virtual ~SramManager ()
 destructor
 
void begin ()
 Starts the SRAM manager and gets it ready for use.
 
size_t availableMemory ()
 Query the amount of available (unallocated) memory. More...
 
SramMemSlotrequestMemory (float delayMilliseconds, bool clearMemory=false)
 Request memory be allocated for the provided slot. More...
 
SramMemSlotrequestMemory (size_t sizeBytes, bool clearMemory=false)
 Request memory be allocated for the provided slot. More...
 
SysPlatform::SysSpi * getSpiMemoryPtr ()
 get the raw pointers to the underlying SPI memory More...
 
SysPlatform::SysSpi * getSpiDmaMemoryPtr ()
 get the raw pointer to the underlying DMA-mode SPI memory More...
 
bool isUsingDma ()
 Check if SRAM manager is using DMA for transfers. More...
 
void stop (bool waitForStop=false)
 Halt the SRAM manager, no further transactions will be processed. More...
 
void start (bool waitForStart=false)
 Start the SRAM manager. More...
 
bool isStopped ()
 check if SRAM manager is stopped More...
 
bool isStarted ()
 check if SRAM manager is started More...
 
bool runSramTest ()
 

Detailed Description

SramManager provides a class to handle dividing an external SPI RAM into independent slots for general use.

the class does not support deallocated memory because this would cause fragmentation.

Constructor & Destructor Documentation

◆ SramManager()

Aviate::SramManager::SramManager ( bool  useDma)

This object is created automatically by the framework. Do not instantiate directly.

Parameters
useDmawhen true, SRAM manager will use DMA for transfers

Member Function Documentation

◆ availableMemory()

size_t Aviate::SramManager::availableMemory ( )

Query the amount of available (unallocated) memory.

Returns
the available memory in bytes

◆ getSpiDmaMemoryPtr()

SysPlatform::SysSpi* Aviate::SramManager::getSpiDmaMemoryPtr ( )

get the raw pointer to the underlying DMA-mode SPI memory

Returns
pointer to the BASpiMemoryDMA

◆ getSpiMemoryPtr()

SysPlatform::SysSpi* Aviate::SramManager::getSpiMemoryPtr ( )

get the raw pointers to the underlying SPI memory

Returns
pointer to the BASpiMemory

◆ isStarted()

bool Aviate::SramManager::isStarted ( )

check if SRAM manager is started

Returns
true if started, otherwise false

◆ isStopped()

bool Aviate::SramManager::isStopped ( )

check if SRAM manager is stopped

Returns
true if stopped, otherwise false

◆ isUsingDma()

bool Aviate::SramManager::isUsingDma ( )

Check if SRAM manager is using DMA for transfers.

Returns
true if using DMA, otherwise false

◆ requestMemory() [1/2]

SramMemSlot* Aviate::SramManager::requestMemory ( float  delayMilliseconds,
bool  clearMemory = false 
)

Request memory be allocated for the provided slot.

Parameters
delayMillisecondsrequest the amount of memory in milliseconds of audio
clearMemorywhen true, memory is initialized to zero
Returns
a valid SramMemSlot pointer on success, otherwise nullptr

◆ requestMemory() [2/2]

SramMemSlot* Aviate::SramManager::requestMemory ( size_t  sizeBytes,
bool  clearMemory = false 
)

Request memory be allocated for the provided slot.

Parameters
sizeBytesrequest the amount of memory in bytes to request
clearMemorywhen true, memory is initialized to zero
Returns
a valid SramMemSlot pointer on success, otherwise nullptr

◆ start()

void Aviate::SramManager::start ( bool  waitForStart = false)

Start the SRAM manager.

Parameters
waitForStartblock until device has started

◆ stop()

void Aviate::SramManager::stop ( bool  waitForStop = false)

Halt the SRAM manager, no further transactions will be processed.

Parameters
waitForStopblock until device has stopped

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