ESP32 PSRAM Library
Classes | Typedefs | Enumerations | Functions
esp32_psram Namespace Reference

Namespace containing ESP32 PSRAM-specific implementations. More...

Classes

class  AllocatorPSRAM
 Custom allocator that uses ESP32's PSRAM for memory allocation. More...
 
class  HimemBlock
 Manages a block of himem memory with mapping functionality. More...
 
class  HIMEMClass
 Class for managing files stored in ESP32's High Memory: Use the HIMEM object instead instaniating this class directly. More...
 
class  InMemoryFile
 A file-like interface for vector-backed storage in memory. More...
 
class  PSRAMClass
 Class for managing files stored in ESP32's PSRAM: Use the PSRAM object instead instaniating this class directly. More...
 
class  RingBufferStream
 A circular buffer implementation that extends Arduino's Stream. More...
 
class  TypedRingBuffer
 A generic ring buffer implementation for any data type. More...
 
class  VectorHIMEM
 Vector implementation that uses ESP32's high memory (himem) for storage. More...
 
class  VectorPSRAM
 Vector implementation that uses ESP32's PSRAM for storage. More...
 

Typedefs

using FileHIMEM = InMemoryFile< VectorHIMEM< uint8_t > >
 
using FilePSRAM = InMemoryFile< VectorPSRAM< uint8_t > >
 
using RingBufferStreamHIMEM = RingBufferStream< VectorHIMEM< uint8_t > >
 Type alias for a RingBufferStream that uses HIMEM-backed vector storage.
 
using RingBufferStreamPSRAM = RingBufferStream< VectorPSRAM< uint8_t > >
 Type alias for a RingBufferStream that uses PSRAM-backed vector storage.
 
using RingBufferStreamRAM = RingBufferStream< std::vector< uint8_t > >
 Type alias for a RingBufferStream that uses std::vector storage.
 
template<typename T >
using TypedRingBufferHIMEM = TypedRingBuffer< T, VectorHIMEM< T > >
 Type alias for a typed ring buffer that uses HIMEM-backed vector storage.
 
template<typename T >
using TypedRingBufferPSRAM = TypedRingBuffer< T, VectorPSRAM< T > >
 Type alias for a typed ring buffer that uses PSRAM-backed vector storage.
 
template<typename T >
using TypedRingBufferRAM = TypedRingBuffer< T, std::vector< T > >
 Type alias for a typed ring buffer that uses std::vector (in RAM)
 

Enumerations

enum class  FileMode { READ , WRITE , APPEND , READ_WRITE }
 

Functions

template<typename T , typename U >
bool operator!= (const AllocatorPSRAM< T > &, const AllocatorPSRAM< U > &) noexcept
 Inequality comparison operator for allocators. More...
 
template<typename T >
bool operator!= (const VectorHIMEM< T > &lhs, const VectorHIMEM< T > &rhs)
 Inequality comparison operator. More...
 
template<typename T >
bool operator!= (const VectorPSRAM< T > &lhs, const VectorPSRAM< T > &rhs)
 Inequality comparison operator. More...
 
template<typename T >
bool operator< (const VectorPSRAM< T > &lhs, const VectorPSRAM< T > &rhs)
 Less than comparison operator. More...
 
template<typename T >
bool operator<= (const VectorPSRAM< T > &lhs, const VectorPSRAM< T > &rhs)
 Less than or equal comparison operator. More...
 
template<typename T , typename U >
bool operator== (const AllocatorPSRAM< T > &, const AllocatorPSRAM< U > &) noexcept
 Equality comparison operator for allocators. More...
 
template<typename T >
bool operator== (const VectorHIMEM< T > &lhs, const VectorHIMEM< T > &rhs)
 Equality comparison operator. More...
 
template<typename T >
bool operator== (const VectorPSRAM< T > &lhs, const VectorPSRAM< T > &rhs)
 Equality comparison operator. More...
 
template<typename T >
bool operator> (const VectorPSRAM< T > &lhs, const VectorPSRAM< T > &rhs)
 Greater than comparison operator. More...
 
template<typename T >
bool operator>= (const VectorPSRAM< T > &lhs, const VectorPSRAM< T > &rhs)
 Greater than or equal comparison operator. More...
 
template<typename T >
void swap (VectorHIMEM< T > &lhs, VectorHIMEM< T > &rhs) noexcept
 Swap the contents of two vectors. More...
 
template<typename T >
void swap (VectorPSRAM< T > &lhs, VectorPSRAM< T > &rhs) noexcept
 Swap the contents of two vectors. More...
 

Detailed Description

Namespace containing ESP32 PSRAM-specific implementations.

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename U >
bool esp32_psram::operator!= ( const AllocatorPSRAM< T > &  ,
const AllocatorPSRAM< U > &   
)
noexcept

Inequality comparison operator for allocators.

Template Parameters
TType of first allocator
UType of second allocator
Returns
Always false since all instances are equivalent

◆ operator!=() [2/3]

template<typename T >
bool esp32_psram::operator!= ( const VectorHIMEM< T > &  lhs,
const VectorHIMEM< T > &  rhs 
)

Inequality comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if the vectors are not equal, false otherwise

◆ operator!=() [3/3]

template<typename T >
bool esp32_psram::operator!= ( const VectorPSRAM< T > &  lhs,
const VectorPSRAM< T > &  rhs 
)

Inequality comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if the vectors are not equal, false otherwise

◆ operator<()

template<typename T >
bool esp32_psram::operator< ( const VectorPSRAM< T > &  lhs,
const VectorPSRAM< T > &  rhs 
)

Less than comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if lhs is lexicographically less than rhs, false otherwise

◆ operator<=()

template<typename T >
bool esp32_psram::operator<= ( const VectorPSRAM< T > &  lhs,
const VectorPSRAM< T > &  rhs 
)

Less than or equal comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if lhs is lexicographically less than or equal to rhs, false otherwise

◆ operator==() [1/3]

template<typename T , typename U >
bool esp32_psram::operator== ( const AllocatorPSRAM< T > &  ,
const AllocatorPSRAM< U > &   
)
noexcept

Equality comparison operator for allocators.

Template Parameters
TType of first allocator
UType of second allocator
Returns
Always true since all instances are equivalent

◆ operator==() [2/3]

template<typename T >
bool esp32_psram::operator== ( const VectorHIMEM< T > &  lhs,
const VectorHIMEM< T > &  rhs 
)

Equality comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if the vectors are equal, false otherwise

◆ operator==() [3/3]

template<typename T >
bool esp32_psram::operator== ( const VectorPSRAM< T > &  lhs,
const VectorPSRAM< T > &  rhs 
)

Equality comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if the vectors are equal, false otherwise

◆ operator>()

template<typename T >
bool esp32_psram::operator> ( const VectorPSRAM< T > &  lhs,
const VectorPSRAM< T > &  rhs 
)

Greater than comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if lhs is lexicographically greater than rhs, false otherwise

◆ operator>=()

template<typename T >
bool esp32_psram::operator>= ( const VectorPSRAM< T > &  lhs,
const VectorPSRAM< T > &  rhs 
)

Greater than or equal comparison operator.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector
Returns
true if lhs is lexicographically greater than or equal to rhs, false otherwise

◆ swap() [1/2]

template<typename T >
void esp32_psram::swap ( VectorHIMEM< T > &  lhs,
VectorHIMEM< T > &  rhs 
)
noexcept

Swap the contents of two vectors.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector

◆ swap() [2/2]

template<typename T >
void esp32_psram::swap ( VectorPSRAM< T > &  lhs,
VectorPSRAM< T > &  rhs 
)
noexcept

Swap the contents of two vectors.

Template Parameters
TType of elements in the vectors
Parameters
lhsFirst vector
rhsSecond vector