Aviate Audio Multiverse Library
|
This object is used for data transfers to/from the external SPI SRAM. More...
#include <SramManager.h>
Public Member Functions | |
SramMemSlot () | |
constructor | |
bool | clear () |
clear the entire contents of the slot by writing zeros More... | |
bool | isUseDma () const |
check if SRAM is using DMA for transfers More... | |
bool | isWriteBusy () const |
Check if a DMA write is still pending or in progress. More... | |
bool | isReadBusy () const |
Check if a DMA read is complete and data is available. More... | |
size_t | size () |
Get the size of the memory slot in bytes. More... | |
bool | setWritePosition (size_t offsetBytes) |
set a new write position (in bytes) for circular operation More... | |
size_t | getWritePosition () const |
returns the currently set write pointer pointer More... | |
bool | setReadPosition (size_t offsetBytes) |
set a new read position (in bytes) for circular operation More... | |
size_t | getReadPosition () const |
returns the currently set read pointer pointer More... | |
bool | zero (size_t offsetBytes, size_t numBytes) |
Write a block of zeros (8-bit) to the memory at the specified offset. More... | |
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. More... | |
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. More... | |
bool | zeroAdvance (size_t numBytes) |
Write a block of 16-bit data zeros in circular operation. More... | |
bool | writeAdvance (uint8_t data) |
Write a single 16-bit data to the next location in circular operation. More... | |
bool | writeAdvance (uint8_t *src, size_t numBytes) |
Write a block of 16-bit data from the specified location in circular operation. More... | |
uint8_t | readAdvance () |
Read the next byte in memory during circular operation. More... | |
bool | readAdvance (uint8_t *dest, size_t numBytes) |
Read the next block of numWords during circular operation. More... | |
bool | zero16 (size_t offsetWords, size_t numWords) |
Write a block of zeros (16-bit) to the memory at the specified offset. More... | |
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. More... | |
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. More... | |
bool | zeroAdvance16 (size_t numWords) |
Write a block of 16-bit data zeros in circular operation. More... | |
bool | writeAdvance16 (int16_t *src, size_t numWords) |
Write a block of 16-bit data from the specified location in circular operation. More... | |
bool | writeAdvance16 (int16_t data) |
Write a single 16-bit data to the next location in circular operation. More... | |
uint16_t | readAdvance16 () |
Read the next in memory during circular operation. More... | |
bool | readAdvance16 (int16_t *dest, size_t numWords) |
Read the next block of numWords during circular operation. More... | |
bool | enable () const |
Ensures the underlying SPI interface is enabled. More... | |
bool | isEnabled () const |
Checks whether underlying SPI interface is enabled. More... | |
Public Attributes | |
friend | SramManager |
SramManager is a friend of this class. | |
friend | AudioDelay |
AudioDelay is a friend of this class. | |
This object is used for data transfers to/from the external SPI SRAM.
bool Aviate::SramMemSlot::clear | ( | ) |
clear the entire contents of the slot by writing zeros
bool Aviate::SramMemSlot::enable | ( | ) | const |
Ensures the underlying SPI interface is enabled.
size_t Aviate::SramMemSlot::getReadPosition | ( | ) | const |
returns the currently set read pointer pointer
size_t Aviate::SramMemSlot::getWritePosition | ( | ) | const |
returns the currently set write pointer pointer
bool Aviate::SramMemSlot::isEnabled | ( | ) | const |
Checks whether underlying SPI interface is enabled.
bool Aviate::SramMemSlot::isReadBusy | ( | ) | const |
Check if a DMA read is complete and data is available.
bool Aviate::SramMemSlot::isUseDma | ( | ) | const |
check if SRAM is using DMA for transfers
bool Aviate::SramMemSlot::isWriteBusy | ( | ) | const |
Check if a DMA write is still pending or in progress.
bool Aviate::SramMemSlot::read | ( | size_t | offsetBytes, |
uint8_t * | dest, | ||
size_t | numBytes | ||
) |
Read a block of 8-bit data from the memory at the specified location.
offsetBytes | offset in 8-bit bytes from start of slot |
dest | pointer to destination for the read data |
numBytes | number of 8-bit bytes to transfer |
bool Aviate::SramMemSlot::read16 | ( | size_t | offsetWords, |
int16_t * | dest, | ||
size_t | numWords | ||
) |
Read a block of 16-bit data from the memory at the specified location.
offsetWords | offset in 16-bit words from start of slot |
dest | pointer to destination for the read data |
numWords | number of 16-bit words to transfer |
uint8_t Aviate::SramMemSlot::readAdvance | ( | ) |
Read the next byte in memory during circular operation.
bool Aviate::SramMemSlot::readAdvance | ( | uint8_t * | dest, |
size_t | numBytes | ||
) |
Read the next block of numWords during circular operation.
, dest is ignored when using DMA
dest | pointer to the destination of the read. |
numBytes | number of 16-bit words to transfer |
uint16_t Aviate::SramMemSlot::readAdvance16 | ( | ) |
Read the next in memory during circular operation.
bool Aviate::SramMemSlot::readAdvance16 | ( | int16_t * | dest, |
size_t | numWords | ||
) |
Read the next block of numWords during circular operation.
, dest is ignored when using DMA
dest | pointer to the destination of the read. |
numWords | number of 16-bit words to transfer |
bool Aviate::SramMemSlot::setReadPosition | ( | size_t | offsetBytes | ) |
set a new read position (in bytes) for circular operation
offsetBytes | moves the read pointer to the specified offset from the slot start |
bool Aviate::SramMemSlot::setWritePosition | ( | size_t | offsetBytes | ) |
set a new write position (in bytes) for circular operation
offsetBytes | moves the write pointer to the specified offset from the slot start |
size_t Aviate::SramMemSlot::size | ( | ) |
Get the size of the memory slot in bytes.
bool Aviate::SramMemSlot::write | ( | size_t | offsetBytes, |
uint8_t * | src, | ||
size_t | numBytes | ||
) |
Write a block of 8-bit data to the memory at the specified offset.
offsetBytes | offset in 8-bit bytes from start of slot |
src | pointer to start of block of 16-bit data |
numBytes | number of 8-bit bytes to transfer |
bool Aviate::SramMemSlot::write16 | ( | size_t | offsetWords, |
int16_t * | src, | ||
size_t | numWords | ||
) |
Write a block of 16-bit data to the memory at the specified offset.
offsetWords | offset in 16-bit words from start of slot |
src | pointer to start of block of 16-bit data |
numWords | number of 16-bit words to transfer |
bool Aviate::SramMemSlot::writeAdvance | ( | uint8_t * | src, |
size_t | numBytes | ||
) |
Write a block of 16-bit data from the specified location in circular operation.
src | pointer to the start of the block of data to write to memory |
numBytes | number of 16-bit words to transfer |
bool Aviate::SramMemSlot::writeAdvance | ( | uint8_t | data | ) |
Write a single 16-bit data to the next location in circular operation.
data | the 16-bit word to transfer |
bool Aviate::SramMemSlot::writeAdvance16 | ( | int16_t * | src, |
size_t | numWords | ||
) |
Write a block of 16-bit data from the specified location in circular operation.
src | pointer to the start of the block of data to write to memory |
numWords | number of 16-bit words to transfer |
bool Aviate::SramMemSlot::writeAdvance16 | ( | int16_t | data | ) |
Write a single 16-bit data to the next location in circular operation.
data | the 16-bit word to transfer |
bool Aviate::SramMemSlot::zero | ( | size_t | offsetBytes, |
size_t | numBytes | ||
) |
Write a block of zeros (8-bit) to the memory at the specified offset.
offsetBytes | offset in 8-bit bytes from start of slot |
numBytes | number of 8-bit bytes to transfer |
bool Aviate::SramMemSlot::zero16 | ( | size_t | offsetWords, |
size_t | numWords | ||
) |
Write a block of zeros (16-bit) to the memory at the specified offset.
offsetWords | offset in 16-bit words from start of slot |
numWords | number of 16-bit words to transfer |
bool Aviate::SramMemSlot::zeroAdvance | ( | size_t | numBytes | ) |
Write a block of 16-bit data zeros in circular operation.
numBytes | number of 16-bit words to transfer |
bool Aviate::SramMemSlot::zeroAdvance16 | ( | size_t | numWords | ) |
Write a block of 16-bit data zeros in circular operation.
numWords | number of 16-bit words to transfer |