arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioESP32ULP Class Reference

Outputs to ESP32 DAC through the ULP (Ultra> Low Power coprocessor), freeing I2S for other uses. Connect left channel on pin 25 Connect right channel on pin 26. More...

#include <AudioESP32ULP.h>

Inheritance diagram for AudioESP32ULP:
AudioOutput Print AudioInfoSupport AudioInfoSource

Public Member Functions

virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
 
virtual AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 
int availableForWrite ()
 
virtual bool begin ()
 
bool begin (AudioInfo info)
 Starts the processing. I the output is mono, we can determine the output pin by selecting DAC1 (gpio25) or DAC2 (gpio26)
 
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
 
AudioInfo defaultConfig ()
 
void end ()
 
virtual void flush ()
 
virtual bool isDeletable ()
 If true we need to release the related memory in the destructor.
 
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
 
virtual operator bool ()
 
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
 
virtual void setAudioInfo (AudioInfo newInfo) override
 Defines the input AudioInfo.
 
void setMinWriteBytes (int bytes)
 Selects the limit for the availableForWrite to report the data.
 
void setMonoDAC (UlpDac dac)
 Selects the DAC when we have a mono signal.
 
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active)
 
size_t write (const uint8_t *data, size_t len)
 
virtual size_t write (uint8_t ch) override
 
virtual void writeSilence (size_t len)
 

Protected Member Functions

uint32_t create_I_BXI (uint32_t imm_pc)
 
uint32_t create_I_WR_REG (uint32_t reg, uint32_t low_bit, uint32_t high_bit, uint32_t val)
 
void notifyAudioChange (AudioInfo info)
 
bool setup ()
 
bool writeFrame (int16_t sample[2])
 

Protected Attributes

int _timeout = 10
 
int activeDACs = 3
 
uint8_t bufferedOddSample = 128
 
const uint32_t bufferStart = indexAddress + 1
 
AudioInfo cfg
 
const uint32_t dacTableStart1 = 2048 - 512
 
const uint32_t dacTableStart2 = dacTableStart1 - 512
 
int hertz
 
const uint32_t indexAddress = opcodeCount
 
bool is_active = false
 
bool is_notify_active = true
 
int lastFilledWord = 0
 
int min_write_bytes = 128
 
Vector< AudioInfoSupport * > notify_vector
 
const int opcodeCount = 20
 
UlpDac selected_mono_dac = ULP_DAC1
 
bool stereoOutput = true
 
SingleBuffer< uint8_ttmp {MAX_SINGLE_CHARS}
 
int tmpPos = 0
 
const int totalSamples = totalSampleWords * 2
 
uint32_t totalSampleWords
 
bool waitingOddSample = true
 

Detailed Description

Outputs to ESP32 DAC through the ULP (Ultra> Low Power coprocessor), freeing I2S for other uses. Connect left channel on pin 25 Connect right channel on pin 26.

Version
0.1
Date
2023-03-26

Member Function Documentation

◆ addNotifyAudioChange()

virtual void addNotifyAudioChange ( AudioInfoSupport bi)
inlinevirtualinherited

◆ audioInfo()

virtual AudioInfo audioInfo ( )
inlineoverridevirtualinherited

provides the actual input AudioInfo

Implements AudioInfoSupport.

Reimplemented in AdapterPrintToAudioOutput, EncodedAudioOutput, and AdapterAudioStreamToAudioOutput.

◆ audioInfoOut()

virtual AudioInfo audioInfoOut ( )
inlinevirtualinherited

◆ availableForWrite()

int availableForWrite ( )
inlinevirtual

Reimplemented from AudioOutput.

◆ begin() [1/2]

virtual bool begin ( )
inlinevirtualinherited

◆ begin() [2/2]

bool begin ( AudioInfo  info)
inlinevirtual

Starts the processing. I the output is mono, we can determine the output pin by selecting DAC1 (gpio25) or DAC2 (gpio26)

Reimplemented from AudioOutput.

◆ clearNotifyAudioChange()

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

Deletes all change notify subscriptions.

Reimplemented in RTSPClient< TcpClient, UdpSocket >.

◆ create_I_BXI()

uint32_t create_I_BXI ( uint32_t  imm_pc)
inlineprotected

◆ create_I_WR_REG()

uint32_t create_I_WR_REG ( uint32_t  reg,
uint32_t  low_bit,
uint32_t  high_bit,
uint32_t  val 
)
inlineprotected

◆ defaultConfig()

AudioInfo defaultConfig ( )
inline

◆ end()

void end ( )
inlinevirtual

Reimplemented from AudioOutput.

◆ flush()

virtual void flush ( )
inlinevirtualinherited

Reimplemented from Print.

Reimplemented in MultiOutput, and HexDumpOutput.

◆ isDeletable()

virtual bool isDeletable ( )
inlinevirtualinherited

If true we need to release the related memory in the destructor.

Reimplemented in AdapterPrintToAudioOutput, and AdapterAudioStreamToAudioOutput.

◆ isNotifyActive()

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ notifyAudioChange()

void notifyAudioChange ( AudioInfo  info)
inlineprotectedinherited

◆ operator bool()

virtual operator bool ( )
inlinevirtualinherited

◆ removeNotifyAudioChange()

virtual bool removeNotifyAudioChange ( AudioInfoSupport bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

Reimplemented in RTSPClient< TcpClient, UdpSocket >.

◆ setAudioInfo()

virtual void setAudioInfo ( AudioInfo  info)
inlineoverridevirtualinherited

◆ setMinWriteBytes()

void setMinWriteBytes ( int  bytes)
inline

Selects the limit for the availableForWrite to report the data.

◆ setMonoDAC()

void setMonoDAC ( UlpDac  dac)
inline

Selects the DAC when we have a mono signal.

◆ setNotifyActive()

void setNotifyActive ( bool  flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active)

◆ setup()

bool setup ( )
inlineprotected

◆ write() [1/2]

size_t write ( const uint8_t data,
size_t  len 
)
inlinevirtual

Implements AudioOutput.

◆ write() [2/2]

virtual size_t write ( uint8_t  ch)
inlineoverridevirtualinherited

Reimplemented in MetaDataOutput, and MultiOutput.

◆ writeFrame()

bool writeFrame ( int16_t  sample[2])
inlineprotected

◆ writeSilence()

virtual void writeSilence ( size_t  len)
inlinevirtualinherited

Writes n 0 values (= silence)

Parameters
len

Member Data Documentation

◆ _timeout

int _timeout = 10
protectedinherited

◆ activeDACs

int activeDACs = 3
protected

◆ bufferedOddSample

uint8_t bufferedOddSample = 128
protected

◆ bufferStart

const uint32_t bufferStart = indexAddress + 1
protected

◆ cfg

AudioInfo cfg
protectedinherited

◆ dacTableStart1

const uint32_t dacTableStart1 = 2048 - 512
protected

◆ dacTableStart2

const uint32_t dacTableStart2 = dacTableStart1 - 512
protected

◆ hertz

int hertz
protected

◆ indexAddress

const uint32_t indexAddress = opcodeCount
protected

◆ is_active

bool is_active = false
protectedinherited

◆ is_notify_active

bool is_notify_active = true
protectedinherited

◆ lastFilledWord

int lastFilledWord = 0
protected

◆ min_write_bytes

int min_write_bytes = 128
protected

◆ notify_vector

Vector<AudioInfoSupport*> notify_vector
protectedinherited

◆ opcodeCount

const int opcodeCount = 20
protected

◆ selected_mono_dac

UlpDac selected_mono_dac = ULP_DAC1
protected

◆ stereoOutput

bool stereoOutput = true
protected

◆ tmp

SingleBuffer<uint8_t> tmp {MAX_SINGLE_CHARS}
protectedinherited

◆ tmpPos

int tmpPos = 0
protectedinherited

◆ totalSamples

const int totalSamples = totalSampleWords * 2
protected

◆ totalSampleWords

uint32_t totalSampleWords
protected
Initial value:
=
2048 - 512 - 512 - (opcodeCount + 1)
const int opcodeCount
Definition AudioESP32ULP.h:127

◆ waitingOddSample

bool waitingOddSample = true
protected

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