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 ()
 provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
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.
 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_t > tmp {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.


Member Function Documentation

◆ writeSilence()

virtual void writeSilence ( size_t  len)

Writes n 0 values (= silence)


Member Data Documentation

◆ totalSampleWords

uint32_t totalSampleWords
Initial value:
2048 - 512 - 512 - (opcodeCount + 1)

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