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

Header only C++ driver for the TLV320DAC3100 / TLV320DAC3101 audio DAC. More...

#include <TLV320DAC310x.h>

Inheritance diagram for TLV320DAC310x:
ZephyrDriverCommon

Public Member Functions

 TLV320DAC310x ()
 
uint8_t address ()
 Provides the actual I2C address of the codec.
 
bool applyProperties ()
 no-op, nothing is cached that needs re-applying
 
bool begin (uint32_t sample_rate, uint8_t bits, codec_mode_t mode, i2s_format_t fmt, bool is_master, uint8_t channels) override
 
bool begin (uint32_t sample_rate=44100, uint8_t word_size=16, uint32_t mclk_freq=12000000, TLV320DAC310xFormat fmt=TLV320DAC310xFormat::I2S, bool bclk_controller=false, bool wclk_controller=false)
 Initialize the codec.
 
bool configureClocks (uint32_t mclk_freq, uint32_t sample_rate, bool bclk_controller=false, uint8_t word_size=16)
 Configure NDAC/MDAC/OSR dividers (and optionally BCLK divider) to derive the DAC processing/modulator clocks from MCLK.
 
bool configureDai (uint8_t word_size=16, TLV320DAC310xFormat fmt=TLV320DAC310xFormat::I2S, bool bclk_controller=false, bool wclk_controller=false)
 Configure the digital audio interface (format, word length, clock directions)
 
bool configureFilters (uint32_t sample_rate)
 Select the decimation filter / processing block based on the sample rate.
 
bool configureOutput (TLV320DAC310xCmVoltage cm=TLV320DAC310xCmVoltage::V1P65)
 Configure the output path(s) selected via setDevices(): common mode voltage, pop removal, route DAC -> mixer -> headphone and/or Class-D speaker, default analog volume, unmute and power up the corresponding drivers.
 
bool disableBeep ()
 Stop the beep generator immediately by clearing the enable bit.
 
bool enableBeep (uint32_t freq_hz, uint32_t duration_ms=500, int8_t left_db=0, int8_t right_db=0)
 Start the hardware sine-wave beep generator.
 
virtual int getInputVolume ()
 
virtual int getVolume ()
 Provides the output volume in % (0...100) that was set with setVolume()
 
i2c_bus_handle_t getWire ()
 Provides the actual I2C communication object.
 
bool isBeepActive ()
 
virtual bool isInputVolumeSupported ()
 Returns true if the driver supports setting the input volume, false otherwise. By default we return false, but some drivers (e.g. WM8962) override this to return true.
 
virtual bool setActive (codec_mode_t mode)
 
void setAddress (uint8_t addr)
 Defines the I2C address of the codec.
 
bool setDevices (input_device_t input_device, output_device_t output_device) override
 Stores the output device selection for use by configureOutput()
 
virtual bool setInputVolume (int volume)
 
bool setMute (bool mute) override
 Mutes/unmutes the output.
 
bool setOutputImpedance (TLV320DAC310xOutputMode mode)
 Set the HP output driver impedance mode and apply it immediately to register 44.
 
bool setOutputMute ()
 Mute the output (DAC channel mute, output stage stays powered)
 
bool setOutputMute (bool mute)
 Mute / unmute the output.
 
bool setOutputUnmute ()
 Unmute the output.
 
bool setOutputVolume (int vol)
 Set the headphone output (analog) volume.
 
bool setVolume (int volume) override
 
void setWire (i2c_bus_handle_t w)
 Defines the I2C communication object.
 
bool softReset ()
 Soft reset of the codec.
 
bool startOutput ()
 Power up & unmute the DAC channels and start the output.
 
bool stopOutput ()
 Mute and power down the DAC channels.
 

Static Public Attributes

static constexpr uint8_t BCLK_DIV_ADDR = 30
 
static constexpr uint8_t BCLK_DIV_MASK = 0x7F
 
static constexpr uint8_t BCLK_DIV_POWER_UP = 0x80
 
static constexpr uint8_t BCLK_DIV_POWER_UP_MASK = 0x80
 
static constexpr uint8_t BEEP_COS_LSB_ADDR = 79
 
static constexpr uint8_t BEEP_COS_MSB_ADDR = 78
 
static constexpr uint8_t BEEP_GEN_EN_BEEP = 0x80
 
static constexpr uint8_t BEEP_LEN_LSB_ADDR = 75
 
static constexpr uint8_t BEEP_LEN_MID_ADDR = 74
 
static constexpr uint8_t BEEP_LEN_MSB_ADDR = 73
 
static constexpr uint8_t BEEP_SIN_LSB_ADDR = 77
 
static constexpr uint8_t BEEP_SIN_MSB_ADDR = 76
 
static constexpr uint8_t BEEP_VOL_MASK = 0x3F
 
static constexpr uint8_t DAC_LR_POWERDN_DEFAULT = (0x10 | 0x04)
 
static constexpr uint8_t DAC_LR_POWERUP_DEFAULT
 
static constexpr uint32_t DAC_MOD_CLK_FREQ_MAX = 6200000
 
static constexpr uint32_t DAC_MOD_CLK_FREQ_MIN = 2800000
 
static constexpr uint32_t DAC_PROC_CLK_FREQ_MAX = 49152000
 
static constexpr uint8_t DATA_PATH_SETUP_ADDR = 63
 
static constexpr uint8_t DRC_CTRL1_ADDR = 68
 
static constexpr uint8_t HEADPHONE_DRV_ADDR = 31
 
static constexpr uint8_t HEADPHONE_DRV_CM_MASK = (0x03 << 3)
 
static constexpr uint8_t HEADPHONE_DRV_CTRL_ADDR = 44
 
static constexpr uint8_t HEADPHONE_DRV_LINEOUT = (0x02 | 0x04)
 
static constexpr uint8_t HEADPHONE_DRV_POWERUP = (0x80 | 0x40)
 
static constexpr uint8_t HEADPHONE_DRV_RESERVED = 0x04
 
static constexpr uint8_t HP_OUT_POP_RM_ADDR = 33
 
static constexpr uint8_t HP_OUT_POP_RM_ENABLE = 0x80
 
static constexpr uint8_t HPL_ANA_VOL_CTRL_ADDR = 36
 
static constexpr uint8_t HPL_DRV_GAIN_CTRL_ADDR = 40
 
static constexpr uint8_t HPR_ANA_VOL_CTRL_ADDR = 37
 
static constexpr uint8_t HPR_DRV_GAIN_CTRL_ADDR = 41
 
static constexpr uint8_t HPX_ANA_VOL_DEFAULT = 64
 
static constexpr uint8_t HPX_ANA_VOL_ENABLE = 0x80
 
static constexpr uint8_t HPX_ANA_VOL_FLOOR = 144
 
static constexpr uint8_t HPX_ANA_VOL_LOW_THRESH = 105
 
static constexpr uint8_t HPX_ANA_VOL_MASK = 0x7F
 
static constexpr uint8_t HPX_ANA_VOL_MAX = 0
 
static constexpr uint8_t HPX_ANA_VOL_MIN = 127
 
static constexpr uint8_t HPX_DRV_UNMUTE = 0x04
 
static constexpr uint8_t IF_CTRL1_ADDR = 27
 
static constexpr uint8_t IF_CTRL_BCLK_OUT = 0x08
 
static constexpr uint8_t IF_CTRL_IFTYPE_MASK = 0x03
 
static constexpr uint8_t IF_CTRL_WCLK_OUT = 0x04
 
static constexpr uint8_t IF_CTRL_WLEN_MASK = 0x03
 
static constexpr uint8_t L_BEEP_GEN_ADDR = 71
 
static constexpr uint8_t L_DIG_VOL_CTRL_ADDR = 65
 
static constexpr uint8_t MDAC_DIV_ADDR = 12
 
static constexpr uint8_t MDAC_DIV_MASK = 0x7F
 
static constexpr uint8_t MDAC_POWER_UP = 0x80
 
static constexpr uint8_t MDAC_POWER_UP_MASK = 0x80
 
static constexpr uint8_t NDAC_DIV_ADDR = 11
 
static constexpr uint8_t NDAC_DIV_MASK = 0x7F
 
static constexpr uint8_t NDAC_POWER_UP = 0x80
 
static constexpr uint8_t NDAC_POWER_UP_MASK = 0x80
 
static constexpr uint8_t OSR_LSB_ADDR = 14
 
static constexpr uint8_t OSR_LSB_MASK = 0xFF
 
static constexpr uint8_t OSR_MSB_ADDR = 13
 
static constexpr uint8_t OSR_MSB_MASK = 0x03
 
static constexpr uint8_t OUTPUT_ROUTING_ADDR = 35
 
static constexpr uint8_t OUTPUT_ROUTING_HPL = (2 << 6)
 
static constexpr uint8_t OUTPUT_ROUTING_HPR = (2 << 2)
 
static constexpr uint8_t OUTPUT_ROUTING_MIXERL = (1 << 6)
 
static constexpr uint8_t OUTPUT_ROUTING_MIXERR = (1 << 2)
 
static constexpr int OUTPUT_VOLUME_MAX = 0
 
static constexpr int OUTPUT_VOLUME_MIN = (-78 * 2)
 
static constexpr uint8_t OVF_FLAG_ADDR = 39
 
static constexpr uint8_t PAGE_CONTROL_ADDR = 0
 
static constexpr uint8_t PROC_BLK_SEL_ADDR = 60
 
static constexpr uint8_t PROC_BLK_SEL_MASK = 0x1F
 
static constexpr uint8_t R_BEEP_GEN_ADDR = 72
 
static constexpr uint8_t SOFT_RESET_ADDR = 1
 
static constexpr uint8_t SOFT_RESET_ASSERT = 1
 
static constexpr uint8_t SPEAKER_AMP_ADDR = 32
 
static constexpr uint8_t SPEAKER_AMP_POWERUP = 0x80
 
static constexpr uint8_t SPEAKER_AMP_RESERVED = (0x04 | 0x02)
 
static constexpr uint8_t SPK_DRV_GAIN_CTRL_ADDR = 42
 
static constexpr uint8_t SPK_DRV_UNMUTE = 0x04
 
static constexpr uint8_t SPL_ANA_VOL_CTRL_ADDR = 38
 
static constexpr uint8_t TIMER_MCLK_DIV_ADDR = 16
 
static constexpr uint8_t TIMER_MCLK_DIV_EN_EXT = 0x80
 
static constexpr uint8_t TIMER_MCLK_DIV_MASK = 0x7F
 
static constexpr uint8_t VOL_CTRL_ADDR = 64
 
static constexpr uint8_t VOL_CTRL_MUTE_DEFAULT = (0x08 | 0x04)
 
static constexpr uint8_t VOL_CTRL_UNMUTE_DEFAULT = 0
 
static constexpr uint8_t VOL_MICDET_ADC_CTRL_ADDR = 116
 
static constexpr uint8_t VOL_MICDET_VOL_CTRL_PIN = 0x80
 

Protected Member Functions

bool readPagedReg (uint8_t page, uint8_t reg, uint8_t &value)
 Read a register on the given page.
 
bool readReg (uint8_t reg, uint8_t &value)
 Reads a single byte from an 8 bit register address.
 
bool readReg16 (uint8_t reg, uint16_t &value)
 Reads a 16 bit (big endian) value from an 8 bit register address.
 
TLV320DAC310xOutputMode resolveOutputMode () const
 Resolve Auto → Headphone when LINE1 is selected, LineOut otherwise.
 
bool selectPage (uint8_t page)
 Select the active register page (cached, only writes if changed)
 
bool updatePagedReg (uint8_t page, uint8_t reg, uint8_t mask, uint8_t value)
 Read-Modify-Write of a register on the given page.
 
bool updateReg (uint8_t reg, uint8_t mask, uint8_t value)
 Read-Modify-Write of a single byte register.
 
bool updateReg16 (uint8_t reg, uint16_t mask, uint16_t value)
 Read-Modify-Write of a 16 bit (big endian) register.
 
bool writePagedReg (uint8_t page, uint8_t reg, uint8_t value)
 Write a register on the given page.
 
bool writeReg (uint8_t reg, uint8_t value)
 Writes a single byte to an 8 bit register address.
 
bool writeReg16 (uint8_t reg, uint16_t value)
 Writes a 16 bit (big endian) value to an 8 bit register address.
 

Static Protected Member Functions

static uint8_t analogVolReg (uint8_t vol)
 Build the register value for the HPx analog volume control registers.
 
static uint8_t beepVolReg (int8_t vol_db)
 
static TLV320DAC310xOsrMultiple getOsrMultiple (uint32_t sample_rate)
 
static TLV320DAC310xFormat toFormat (i2s_format_t fmt)
 Map the generic I2S format to the TLV320DAC310x specific format.
 

Protected Attributes

uint8_t active_page = 0xFF
 0xFF forces a page select on first access
 
uint32_t current_sample_rate = 44100
 
uint8_t i2c_addr = 0
 
int input_volume_percent = 100
 Last input volume (in %) provided to setInputVolume()
 
output_device_t output_device = DAC_OUTPUT_ALL
 Output device selection set via setDevices(), used by configureOutput()
 
TLV320DAC310xOutputMode output_mode = TLV320DAC310xOutputMode::Auto
 HP driver impedance mode, applied by configureOutput() and setOutputImpedance()
 
int volume_percent = 100
 Last volume (in %) provided to setVolume()
 
i2c_bus_handle_t wire = nullptr
 

Detailed Description

Header only C++ driver for the TLV320DAC3100 / TLV320DAC3101 audio DAC.

The register map of this chip is organized in pages: page 0 register 0 is the page-select register. selectPage()/writePagedReg()/readPagedReg() take care of switching pages as needed.

The RESET pin is not handled here - the chip must be taken out of reset (RESET pin driven high / inactive) by the caller before begin() is called.

Constructor & Destructor Documentation

◆ TLV320DAC310x()

TLV320DAC310x ( )
inline

Member Function Documentation

◆ address()

uint8_t address ( )
inlineinherited

Provides the actual I2C address of the codec.

◆ analogVolReg()

static uint8_t analogVolReg ( uint8_t  vol)
inlinestaticprotected

Build the register value for the HPx analog volume control registers.

◆ applyProperties()

bool applyProperties ( )
inline

no-op, nothing is cached that needs re-applying

◆ beepVolReg()

static uint8_t beepVolReg ( int8_t  vol_db)
inlinestaticprotected

Convert a dB gain value to the 6-bit beep volume register code. Register encoding: code 0 = 2 dB, code 2 = 0 dB, code 63 = −61 dB.

◆ begin() [1/2]

bool begin ( uint32_t  sample_rate,
uint8_t  bits,
codec_mode_t  mode,
i2s_format_t  fmt,
bool  is_master,
uint8_t  channels 
)
inlineoverridevirtual

Required by ZephyrDriverCommon: maps the generic parameters to the TLV320DAC310x specific begin() below (using the default MCLK frequency of 12 MHz).

Implements ZephyrDriverCommon.

◆ begin() [2/2]

bool begin ( uint32_t  sample_rate = 44100,
uint8_t  word_size = 16,
uint32_t  mclk_freq = 12000000,
TLV320DAC310xFormat  fmt = TLV320DAC310xFormat::I2S,
bool  bclk_controller = false,
bool  wclk_controller = false 
)
inline

Initialize the codec.

Note: the RESET pin must be driven inactive (high) by the caller before calling begin().

Parameters
sample_rateI2S sample rate in Hz (e.g. 44100, 48000)
word_sizeI2S word length in bits (16, 20, 24, 32)
mclk_freqMCLK frequency in Hz as fed to the codec
fmtdigital audio interface format
bclk_controllertrue if this device drives BCLK (master)
wclk_controllertrue if this device drives WCLK/LRCLK (master)

◆ configureClocks()

bool configureClocks ( uint32_t  mclk_freq,
uint32_t  sample_rate,
bool  bclk_controller = false,
uint8_t  word_size = 16 
)
inline

Configure NDAC/MDAC/OSR dividers (and optionally BCLK divider) to derive the DAC processing/modulator clocks from MCLK.

◆ configureDai()

bool configureDai ( uint8_t  word_size = 16,
TLV320DAC310xFormat  fmt = TLV320DAC310xFormat::I2S,
bool  bclk_controller = false,
bool  wclk_controller = false 
)
inline

Configure the digital audio interface (format, word length, clock directions)

◆ configureFilters()

bool configureFilters ( uint32_t  sample_rate)
inline

Select the decimation filter / processing block based on the sample rate.

◆ configureOutput()

bool configureOutput ( TLV320DAC310xCmVoltage  cm = TLV320DAC310xCmVoltage::V1P65)
inline

Configure the output path(s) selected via setDevices(): common mode voltage, pop removal, route DAC -> mixer -> headphone and/or Class-D speaker, default analog volume, unmute and power up the corresponding drivers.

DAC_OUTPUT_LINE1 enables the headphone/line drivers (HPL/HPR), and DAC_OUTPUT_LINE2 enables the mono Class-D speaker driver (SPK), fed from DAC_L. DAC_OUTPUT_ALL enables both, DAC_OUTPUT_NONE powers both down.

◆ disableBeep()

bool disableBeep ( )
inline

Stop the beep generator immediately by clearing the enable bit.

◆ enableBeep()

bool enableBeep ( uint32_t  freq_hz,
uint32_t  duration_ms = 500,
int8_t  left_db = 0,
int8_t  right_db = 0 
)
inline

Start the hardware sine-wave beep generator.

Programs the frequency, duration and per-channel volume, then sets the enable bit in register 71 (self-clears once all programmed samples have been played).

Note: the beep generator requires DAC processing block PRB_P25, which is selected automatically by configureFilters() for sample rates < 96 kHz. It will not function at 96 kHz or above.

Parameters
freq_hzSine-wave frequency in Hz
duration_msDuration in milliseconds; 0 uses the maximum (≈380 s at 44.1 kHz)
left_dbLeft channel gain in dB, range [−61, 2] (default 0 dB)
right_dbRight channel gain in dB, range [−61, 2] (default 0 dB)

◆ getInputVolume()

virtual int getInputVolume ( )
inlinevirtualinherited

Provides the input volume in % (0...100) that was set with setInputVolume()

◆ getOsrMultiple()

static TLV320DAC310xOsrMultiple getOsrMultiple ( uint32_t  sample_rate)
inlinestaticprotected

◆ getVolume()

virtual int getVolume ( )
inlinevirtualinherited

Provides the output volume in % (0...100) that was set with setVolume()

◆ getWire()

i2c_bus_handle_t getWire ( )
inlineinherited

Provides the actual I2C communication object.

◆ isBeepActive()

bool isBeepActive ( )
inline

Returns true while the beep generator is still running (D7 of register 71 is self-clearing once the programmed samples complete)

◆ isInputVolumeSupported()

virtual bool isInputVolumeSupported ( )
inlinevirtualinherited

Returns true if the driver supports setting the input volume, false otherwise. By default we return false, but some drivers (e.g. WM8962) override this to return true.

Reimplemented in DA7212, WM8904, and WM8962.

◆ readPagedReg()

bool readPagedReg ( uint8_t  page,
uint8_t  reg,
uint8_t &  value 
)
inlineprotected

Read a register on the given page.

◆ readReg()

bool readReg ( uint8_t  reg,
uint8_t &  value 
)
inlineprotectedinherited

Reads a single byte from an 8 bit register address.

◆ readReg16()

bool readReg16 ( uint8_t  reg,
uint16_t &  value 
)
inlineprotectedinherited

Reads a 16 bit (big endian) value from an 8 bit register address.

◆ resolveOutputMode()

TLV320DAC310xOutputMode resolveOutputMode ( ) const
inlineprotected

Resolve Auto → Headphone when LINE1 is selected, LineOut otherwise.

◆ selectPage()

bool selectPage ( uint8_t  page)
inlineprotected

Select the active register page (cached, only writes if changed)

◆ setActive()

virtual bool setActive ( codec_mode_t  mode)
inlinevirtualinherited

Activates/deactivates the playback and/or capture path at runtime (without reconfiguring the codec), based on codec_mode_t (CODEC_MODE_DECODE: playback active, CODEC_MODE_ENCODE: capture active). By default this just mutes/unmutes all outputs depending on CODEC_MODE_DECODE; chip specific subclasses that support muting the input path independently override this to also mute/unmute the capture path depending on CODEC_MODE_ENCODE.

Reimplemented in DA7212, WM8904, and WM8962.

◆ setAddress()

void setAddress ( uint8_t  addr)
inlineinherited

Defines the I2C address of the codec.

◆ setDevices()

bool setDevices ( input_device_t  input_device,
output_device_t  output_device 
)
inlineoverridevirtual

Stores the output device selection for use by configureOutput()

Reimplemented from ZephyrDriverCommon.

◆ setInputVolume()

virtual bool setInputVolume ( int  volume)
inlinevirtualinherited

Defines the input volume in % (0...100). Chip specific subclasses map this to their native input volume range.

Reimplemented in DA7212, WM8904, and WM8962.

◆ setMute()

bool setMute ( bool  mute)
inlineoverridevirtual

Mutes/unmutes the output.

Reimplemented from ZephyrDriverCommon.

◆ setOutputImpedance()

bool setOutputImpedance ( TLV320DAC310xOutputMode  mode)
inline

Set the HP output driver impedance mode and apply it immediately to register 44.

Overrides the automatic selection that configureOutput() derives from output_device (LINE1 → Headphone, others → LineOut). Pass Auto to restore the automatic behaviour on the next configureOutput() call.

Parameters
modeHeadphone (16–32 Ω), LineOut (≥10 kΩ) or Auto

◆ setOutputMute() [1/2]

bool setOutputMute ( )
inline

Mute the output (DAC channel mute, output stage stays powered)

◆ setOutputMute() [2/2]

bool setOutputMute ( bool  mute)
inline

Mute / unmute the output.

◆ setOutputUnmute()

bool setOutputUnmute ( )
inline

Unmute the output.

◆ setOutputVolume()

bool setOutputVolume ( int  vol)
inline

Set the headphone output (analog) volume.

Parameters
volvolume in units of 0.5dB, range [OUTPUT_VOLUME_MIN (-156, i.e. -78dB), OUTPUT_VOLUME_MAX (0, i.e. 0dB)]

◆ setVolume()

bool setVolume ( int  volume)
inlineoverridevirtual

Sets the output volume in % (0...100), mapped to [OUTPUT_VOLUME_MIN..OUTPUT_VOLUME_MAX] (0.5dB steps)

Reimplemented from ZephyrDriverCommon.

◆ setWire()

void setWire ( i2c_bus_handle_t  w)
inlineinherited

Defines the I2C communication object.

◆ softReset()

bool softReset ( )
inline

Soft reset of the codec.

◆ startOutput()

bool startOutput ( )
inline

Power up & unmute the DAC channels and start the output.

◆ stopOutput()

bool stopOutput ( )
inline

Mute and power down the DAC channels.

◆ toFormat()

static TLV320DAC310xFormat toFormat ( i2s_format_t  fmt)
inlinestaticprotected

Map the generic I2S format to the TLV320DAC310x specific format.

◆ updatePagedReg()

bool updatePagedReg ( uint8_t  page,
uint8_t  reg,
uint8_t  mask,
uint8_t  value 
)
inlineprotected

Read-Modify-Write of a register on the given page.

◆ updateReg()

bool updateReg ( uint8_t  reg,
uint8_t  mask,
uint8_t  value 
)
inlineprotectedinherited

Read-Modify-Write of a single byte register.

◆ updateReg16()

bool updateReg16 ( uint8_t  reg,
uint16_t  mask,
uint16_t  value 
)
inlineprotectedinherited

Read-Modify-Write of a 16 bit (big endian) register.

◆ writePagedReg()

bool writePagedReg ( uint8_t  page,
uint8_t  reg,
uint8_t  value 
)
inlineprotected

Write a register on the given page.

◆ writeReg()

bool writeReg ( uint8_t  reg,
uint8_t  value 
)
inlineprotectedinherited

Writes a single byte to an 8 bit register address.

◆ writeReg16()

bool writeReg16 ( uint8_t  reg,
uint16_t  value 
)
inlineprotectedinherited

Writes a 16 bit (big endian) value to an 8 bit register address.

Member Data Documentation

◆ active_page

uint8_t active_page = 0xFF
protected

0xFF forces a page select on first access

◆ BCLK_DIV_ADDR

constexpr uint8_t BCLK_DIV_ADDR = 30
staticconstexpr

◆ BCLK_DIV_MASK

constexpr uint8_t BCLK_DIV_MASK = 0x7F
staticconstexpr

◆ BCLK_DIV_POWER_UP

constexpr uint8_t BCLK_DIV_POWER_UP = 0x80
staticconstexpr

◆ BCLK_DIV_POWER_UP_MASK

constexpr uint8_t BCLK_DIV_POWER_UP_MASK = 0x80
staticconstexpr

◆ BEEP_COS_LSB_ADDR

constexpr uint8_t BEEP_COS_LSB_ADDR = 79
staticconstexpr

◆ BEEP_COS_MSB_ADDR

constexpr uint8_t BEEP_COS_MSB_ADDR = 78
staticconstexpr

◆ BEEP_GEN_EN_BEEP

constexpr uint8_t BEEP_GEN_EN_BEEP = 0x80
staticconstexpr

◆ BEEP_LEN_LSB_ADDR

constexpr uint8_t BEEP_LEN_LSB_ADDR = 75
staticconstexpr

◆ BEEP_LEN_MID_ADDR

constexpr uint8_t BEEP_LEN_MID_ADDR = 74
staticconstexpr

◆ BEEP_LEN_MSB_ADDR

constexpr uint8_t BEEP_LEN_MSB_ADDR = 73
staticconstexpr

◆ BEEP_SIN_LSB_ADDR

constexpr uint8_t BEEP_SIN_LSB_ADDR = 77
staticconstexpr

◆ BEEP_SIN_MSB_ADDR

constexpr uint8_t BEEP_SIN_MSB_ADDR = 76
staticconstexpr

◆ BEEP_VOL_MASK

constexpr uint8_t BEEP_VOL_MASK = 0x3F
staticconstexpr

◆ current_sample_rate

uint32_t current_sample_rate = 44100
protected

◆ DAC_LR_POWERDN_DEFAULT

constexpr uint8_t DAC_LR_POWERDN_DEFAULT = (0x10 | 0x04)
staticconstexpr

◆ DAC_LR_POWERUP_DEFAULT

constexpr uint8_t DAC_LR_POWERUP_DEFAULT
staticconstexpr
Initial value:
=
(0x80 | 0x40 | 0x10 | 0x04)

◆ DAC_MOD_CLK_FREQ_MAX

constexpr uint32_t DAC_MOD_CLK_FREQ_MAX = 6200000
staticconstexpr

◆ DAC_MOD_CLK_FREQ_MIN

constexpr uint32_t DAC_MOD_CLK_FREQ_MIN = 2800000
staticconstexpr

◆ DAC_PROC_CLK_FREQ_MAX

constexpr uint32_t DAC_PROC_CLK_FREQ_MAX = 49152000
staticconstexpr

◆ DATA_PATH_SETUP_ADDR

constexpr uint8_t DATA_PATH_SETUP_ADDR = 63
staticconstexpr

◆ DRC_CTRL1_ADDR

constexpr uint8_t DRC_CTRL1_ADDR = 68
staticconstexpr

◆ HEADPHONE_DRV_ADDR

constexpr uint8_t HEADPHONE_DRV_ADDR = 31
staticconstexpr

◆ HEADPHONE_DRV_CM_MASK

constexpr uint8_t HEADPHONE_DRV_CM_MASK = (0x03 << 3)
staticconstexpr

◆ HEADPHONE_DRV_CTRL_ADDR

constexpr uint8_t HEADPHONE_DRV_CTRL_ADDR = 44
staticconstexpr

◆ HEADPHONE_DRV_LINEOUT

constexpr uint8_t HEADPHONE_DRV_LINEOUT = (0x02 | 0x04)
staticconstexpr

◆ HEADPHONE_DRV_POWERUP

constexpr uint8_t HEADPHONE_DRV_POWERUP = (0x80 | 0x40)
staticconstexpr

◆ HEADPHONE_DRV_RESERVED

constexpr uint8_t HEADPHONE_DRV_RESERVED = 0x04
staticconstexpr

◆ HP_OUT_POP_RM_ADDR

constexpr uint8_t HP_OUT_POP_RM_ADDR = 33
staticconstexpr

◆ HP_OUT_POP_RM_ENABLE

constexpr uint8_t HP_OUT_POP_RM_ENABLE = 0x80
staticconstexpr

◆ HPL_ANA_VOL_CTRL_ADDR

constexpr uint8_t HPL_ANA_VOL_CTRL_ADDR = 36
staticconstexpr

◆ HPL_DRV_GAIN_CTRL_ADDR

constexpr uint8_t HPL_DRV_GAIN_CTRL_ADDR = 40
staticconstexpr

◆ HPR_ANA_VOL_CTRL_ADDR

constexpr uint8_t HPR_ANA_VOL_CTRL_ADDR = 37
staticconstexpr

◆ HPR_DRV_GAIN_CTRL_ADDR

constexpr uint8_t HPR_DRV_GAIN_CTRL_ADDR = 41
staticconstexpr

◆ HPX_ANA_VOL_DEFAULT

constexpr uint8_t HPX_ANA_VOL_DEFAULT = 64
staticconstexpr

◆ HPX_ANA_VOL_ENABLE

constexpr uint8_t HPX_ANA_VOL_ENABLE = 0x80
staticconstexpr

◆ HPX_ANA_VOL_FLOOR

constexpr uint8_t HPX_ANA_VOL_FLOOR = 144
staticconstexpr

◆ HPX_ANA_VOL_LOW_THRESH

constexpr uint8_t HPX_ANA_VOL_LOW_THRESH = 105
staticconstexpr

◆ HPX_ANA_VOL_MASK

constexpr uint8_t HPX_ANA_VOL_MASK = 0x7F
staticconstexpr

◆ HPX_ANA_VOL_MAX

constexpr uint8_t HPX_ANA_VOL_MAX = 0
staticconstexpr

◆ HPX_ANA_VOL_MIN

constexpr uint8_t HPX_ANA_VOL_MIN = 127
staticconstexpr

◆ HPX_DRV_UNMUTE

constexpr uint8_t HPX_DRV_UNMUTE = 0x04
staticconstexpr

◆ i2c_addr

uint8_t i2c_addr = 0
protectedinherited

◆ IF_CTRL1_ADDR

constexpr uint8_t IF_CTRL1_ADDR = 27
staticconstexpr

◆ IF_CTRL_BCLK_OUT

constexpr uint8_t IF_CTRL_BCLK_OUT = 0x08
staticconstexpr

◆ IF_CTRL_IFTYPE_MASK

constexpr uint8_t IF_CTRL_IFTYPE_MASK = 0x03
staticconstexpr

◆ IF_CTRL_WCLK_OUT

constexpr uint8_t IF_CTRL_WCLK_OUT = 0x04
staticconstexpr

◆ IF_CTRL_WLEN_MASK

constexpr uint8_t IF_CTRL_WLEN_MASK = 0x03
staticconstexpr

◆ input_volume_percent

int input_volume_percent = 100
protectedinherited

Last input volume (in %) provided to setInputVolume()

◆ L_BEEP_GEN_ADDR

constexpr uint8_t L_BEEP_GEN_ADDR = 71
staticconstexpr

◆ L_DIG_VOL_CTRL_ADDR

constexpr uint8_t L_DIG_VOL_CTRL_ADDR = 65
staticconstexpr

◆ MDAC_DIV_ADDR

constexpr uint8_t MDAC_DIV_ADDR = 12
staticconstexpr

◆ MDAC_DIV_MASK

constexpr uint8_t MDAC_DIV_MASK = 0x7F
staticconstexpr

◆ MDAC_POWER_UP

constexpr uint8_t MDAC_POWER_UP = 0x80
staticconstexpr

◆ MDAC_POWER_UP_MASK

constexpr uint8_t MDAC_POWER_UP_MASK = 0x80
staticconstexpr

◆ NDAC_DIV_ADDR

constexpr uint8_t NDAC_DIV_ADDR = 11
staticconstexpr

◆ NDAC_DIV_MASK

constexpr uint8_t NDAC_DIV_MASK = 0x7F
staticconstexpr

◆ NDAC_POWER_UP

constexpr uint8_t NDAC_POWER_UP = 0x80
staticconstexpr

◆ NDAC_POWER_UP_MASK

constexpr uint8_t NDAC_POWER_UP_MASK = 0x80
staticconstexpr

◆ OSR_LSB_ADDR

constexpr uint8_t OSR_LSB_ADDR = 14
staticconstexpr

◆ OSR_LSB_MASK

constexpr uint8_t OSR_LSB_MASK = 0xFF
staticconstexpr

◆ OSR_MSB_ADDR

constexpr uint8_t OSR_MSB_ADDR = 13
staticconstexpr

◆ OSR_MSB_MASK

constexpr uint8_t OSR_MSB_MASK = 0x03
staticconstexpr

◆ output_device

output_device_t output_device = DAC_OUTPUT_ALL
protected

Output device selection set via setDevices(), used by configureOutput()

◆ output_mode

HP driver impedance mode, applied by configureOutput() and setOutputImpedance()

◆ OUTPUT_ROUTING_ADDR

constexpr uint8_t OUTPUT_ROUTING_ADDR = 35
staticconstexpr

◆ OUTPUT_ROUTING_HPL

constexpr uint8_t OUTPUT_ROUTING_HPL = (2 << 6)
staticconstexpr

◆ OUTPUT_ROUTING_HPR

constexpr uint8_t OUTPUT_ROUTING_HPR = (2 << 2)
staticconstexpr

◆ OUTPUT_ROUTING_MIXERL

constexpr uint8_t OUTPUT_ROUTING_MIXERL = (1 << 6)
staticconstexpr

◆ OUTPUT_ROUTING_MIXERR

constexpr uint8_t OUTPUT_ROUTING_MIXERR = (1 << 2)
staticconstexpr

◆ OUTPUT_VOLUME_MAX

constexpr int OUTPUT_VOLUME_MAX = 0
staticconstexpr

◆ OUTPUT_VOLUME_MIN

constexpr int OUTPUT_VOLUME_MIN = (-78 * 2)
staticconstexpr

◆ OVF_FLAG_ADDR

constexpr uint8_t OVF_FLAG_ADDR = 39
staticconstexpr

◆ PAGE_CONTROL_ADDR

constexpr uint8_t PAGE_CONTROL_ADDR = 0
staticconstexpr

◆ PROC_BLK_SEL_ADDR

constexpr uint8_t PROC_BLK_SEL_ADDR = 60
staticconstexpr

◆ PROC_BLK_SEL_MASK

constexpr uint8_t PROC_BLK_SEL_MASK = 0x1F
staticconstexpr

◆ R_BEEP_GEN_ADDR

constexpr uint8_t R_BEEP_GEN_ADDR = 72
staticconstexpr

◆ SOFT_RESET_ADDR

constexpr uint8_t SOFT_RESET_ADDR = 1
staticconstexpr

◆ SOFT_RESET_ASSERT

constexpr uint8_t SOFT_RESET_ASSERT = 1
staticconstexpr

◆ SPEAKER_AMP_ADDR

constexpr uint8_t SPEAKER_AMP_ADDR = 32
staticconstexpr

◆ SPEAKER_AMP_POWERUP

constexpr uint8_t SPEAKER_AMP_POWERUP = 0x80
staticconstexpr

◆ SPEAKER_AMP_RESERVED

constexpr uint8_t SPEAKER_AMP_RESERVED = (0x04 | 0x02)
staticconstexpr

◆ SPK_DRV_GAIN_CTRL_ADDR

constexpr uint8_t SPK_DRV_GAIN_CTRL_ADDR = 42
staticconstexpr

◆ SPK_DRV_UNMUTE

constexpr uint8_t SPK_DRV_UNMUTE = 0x04
staticconstexpr

◆ SPL_ANA_VOL_CTRL_ADDR

constexpr uint8_t SPL_ANA_VOL_CTRL_ADDR = 38
staticconstexpr

◆ TIMER_MCLK_DIV_ADDR

constexpr uint8_t TIMER_MCLK_DIV_ADDR = 16
staticconstexpr

◆ TIMER_MCLK_DIV_EN_EXT

constexpr uint8_t TIMER_MCLK_DIV_EN_EXT = 0x80
staticconstexpr

◆ TIMER_MCLK_DIV_MASK

constexpr uint8_t TIMER_MCLK_DIV_MASK = 0x7F
staticconstexpr

◆ VOL_CTRL_ADDR

constexpr uint8_t VOL_CTRL_ADDR = 64
staticconstexpr

◆ VOL_CTRL_MUTE_DEFAULT

constexpr uint8_t VOL_CTRL_MUTE_DEFAULT = (0x08 | 0x04)
staticconstexpr

◆ VOL_CTRL_UNMUTE_DEFAULT

constexpr uint8_t VOL_CTRL_UNMUTE_DEFAULT = 0
staticconstexpr

◆ VOL_MICDET_ADC_CTRL_ADDR

constexpr uint8_t VOL_MICDET_ADC_CTRL_ADDR = 116
staticconstexpr

◆ VOL_MICDET_VOL_CTRL_PIN

constexpr uint8_t VOL_MICDET_VOL_CTRL_PIN = 0x80
staticconstexpr

◆ volume_percent

int volume_percent = 100
protectedinherited

Last volume (in %) provided to setVolume()

◆ wire

i2c_bus_handle_t wire = nullptr
protectedinherited

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