SramManager provides a class to handle dividing an external SPI RAM into independent slots for general use.
More...
#include <SramManager.h>
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.
◆ SramManager()
Aviate::SramManager::SramManager |
( |
bool |
useDma | ) |
|
This object is created automatically by the framework. Do not instantiate directly.
- Parameters
-
useDma | when true, SRAM manager will use DMA for transfers |
◆ 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
-
delayMilliseconds | request the amount of memory in milliseconds of audio |
clearMemory | when 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
-
sizeBytes | request the amount of memory in bytes to request |
clearMemory | when 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
-
waitForStart | block until device has started |
◆ stop()
void Aviate::SramManager::stop |
( |
bool |
waitForStop = false | ) |
|
Halt the SRAM manager, no further transactions will be processed.
- Parameters
-
waitForStop | block until device has stopped |
The documentation for this class was generated from the following file: