16 #ifndef AVIATE_SRAMMANAGER_H_
17 #define AVIATE_SRAMMANAGER_H_
20 #include "Aviate/Aviate.h"
21 #include "Aviate/ForwardDeclares.h"
77 bool zero(
size_t offsetBytes,
size_t numBytes);
84 bool write(
size_t offsetBytes, uint8_t *src,
size_t numBytes);
91 bool read(
size_t offsetBytes, uint8_t *dest,
size_t numBytes);
127 bool zero16(
size_t offsetWords,
size_t numWords);
134 bool write16(
size_t offsetWords, int16_t *src,
size_t numWords);
141 bool read16(
size_t offsetWords, int16_t *dest,
size_t numWords);
183 std::unique_ptr<Impl> _pimpl;
232 void stop(
bool waitForStop =
false);
236 void start(
bool waitForStart =
false);
251 std::unique_ptr<Impl> _pimpl;
#define AVIATE_API
enable default visibility. This is used for public API functions and classes.
Definition: Aviate.h:19
SramManager provides a class to handle dividing an external SPI RAM into independent slots for genera...
Definition: SramManager.h:192
SysPlatform::SysSpi * getSpiDmaMemoryPtr()
get the raw pointer to the underlying DMA-mode SPI memory
SramMemSlot * requestMemory(float delayMilliseconds, bool clearMemory=false)
Request memory be allocated for the provided slot.
void begin()
Starts the SRAM manager and gets it ready for use.
bool isStopped()
check if SRAM manager is stopped
void stop(bool waitForStop=false)
Halt the SRAM manager, no further transactions will be processed.
size_t availableMemory()
Query the amount of available (unallocated) memory.
virtual ~SramManager()
destructor
bool isUsingDma()
Check if SRAM manager is using DMA for transfers.
SramManager(bool useDma)
This object is created automatically by the framework. Do not instantiate directly.
SramMemSlot * requestMemory(size_t sizeBytes, bool clearMemory=false)
Request memory be allocated for the provided slot.
void start(bool waitForStart=false)
Start the SRAM manager.
bool isStarted()
check if SRAM manager is started
SysPlatform::SysSpi * getSpiMemoryPtr()
get the raw pointers to the underlying SPI memory
This object is used for data transfers to/from the external SPI SRAM.
Definition: SramManager.h:28
bool clear()
clear the entire contents of the slot by writing zeros
bool isReadBusy() const
Check if a DMA read is complete and data is available.
bool isWriteBusy() const
Check if a DMA write is still pending or in progress.
bool writeAdvance16(int16_t *src, size_t numWords)
Write a block of 16-bit data from the specified location in circular operation.
bool writeAdvance(uint8_t data)
Write a single 16-bit data to the next location in circular operation.
bool isUseDma() const
check if SRAM is using DMA for transfers
friend SramManager
SramManager is a friend of this class.
Definition: SramManager.h:178
bool zeroAdvance16(size_t numWords)
Write a block of 16-bit data zeros in circular operation.
bool write16(size_t offsetWords, int16_t *src, size_t numWords)
Write a block of 16-bit data to the memory at the specified offset.
bool readAdvance16(int16_t *dest, size_t numWords)
Read the next block of numWords during circular operation.
bool setReadPosition(size_t offsetBytes)
set a new read position (in bytes) for circular operation
bool read16(size_t offsetWords, int16_t *dest, size_t numWords)
Read a block of 16-bit data from the memory at the specified location.
size_t getWritePosition() const
returns the currently set write pointer pointer
uint16_t readAdvance16()
Read the next in memory during circular operation.
bool zero16(size_t offsetWords, size_t numWords)
Write a block of zeros (16-bit) to the memory at the specified offset.
bool read(size_t offsetBytes, uint8_t *dest, size_t numBytes)
Read a block of 8-bit data from the memory at the specified location.
bool writeAdvance(uint8_t *src, size_t numBytes)
Write a block of 16-bit data from the specified location in circular operation.
bool readAdvance(uint8_t *dest, size_t numBytes)
Read the next block of numWords during circular operation.
bool zeroAdvance(size_t numBytes)
Write a block of 16-bit data zeros in circular operation.
bool zero(size_t offsetBytes, size_t numBytes)
Write a block of zeros (8-bit) to the memory at the specified offset.
size_t size()
Get the size of the memory slot in bytes.
bool enable() const
Ensures the underlying SPI interface is enabled.
bool setWritePosition(size_t offsetBytes)
set a new write position (in bytes) for circular operation
friend AudioDelay
AudioDelay is a friend of this class.
Definition: SramManager.h:179
bool writeAdvance16(int16_t data)
Write a single 16-bit data to the next location in circular operation.
uint8_t readAdvance()
Read the next byte in memory during circular operation.
bool write(size_t offsetBytes, uint8_t *src, size_t numBytes)
Write a block of 8-bit data to the memory at the specified offset.
size_t getReadPosition() const
returns the currently set read pointer pointer
bool isEnabled() const
Checks whether underlying SPI interface is enabled.
The Aviate library/namespace provides the primary API for working with Multiverse.
Definition: AudioEffectWrapper.h:24
volatile SramManager * sramManagerPtr
pointer to global SramManager pointer