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

Header only C++ driver for the MAX98091 audio codec. More...

#include <MAX98091.h>

Inheritance diagram for MAX98091:
ZephyrDriverCommon

Public Types

enum  Reg : uint8_t {
  REG_SOFTWARE_RESET = 0x00 , REG_DEVICE_STATUS = 0x01 , REG_JACK_STATUS = 0x02 , REG_INTERRUPT_S = 0x03 ,
  REG_MASTER_CLOCK = 0x04 , REG_QUICK_SAMPLE_RATE = 0x05 , REG_DAI_INTERFACE = 0x06 , REG_DAC_PATH = 0x07 ,
  REG_MIC_DIRECT_TO_ADC = 0x08 , REG_LINE_TO_ADC = 0x09 , REG_ANALOG_MIC_LOOP = 0x0A , REG_ANALOG_LINE_LOOP = 0x0B ,
  REG_RESERVED = 0x0C , REG_LINE_INPUT_CONFIG = 0x0D , REG_LINE_INPUT_LEVEL = 0x0E , REG_INPUT_MODE = 0x0F ,
  REG_MIC1_INPUT_LEVEL = 0x10 , REG_MIC2_INPUT_LEVEL = 0x11 , REG_MIC_BIAS_VOLTAGE = 0x12 , REG_DIGITAL_MIC_ENABLE = 0x13 ,
  REG_DIGITAL_MIC_CONFIG = 0x14 , REG_LEFT_ADC_MIXER = 0x15 , REG_RIGHT_ADC_MIXER = 0x16 , REG_LEFT_ADC_LEVEL = 0x17 ,
  REG_RIGHT_ADC_LEVEL = 0x18 , REG_ADC_BIQUAD_LEVEL = 0x19 , REG_ADC_SIDETONE = 0x1A , REG_SYSTEM_CLOCK = 0x1B ,
  REG_CLOCK_MODE = 0x1C , REG_CLOCK_RATIO_NI_MSB = 0x1D , REG_CLOCK_RATIO_NI_LSB = 0x1E , REG_CLOCK_RATIO_MI_MSB = 0x1F ,
  REG_CLOCK_RATIO_MI_LSB = 0x20 , REG_MASTER_MODE = 0x21 , REG_INTERFACE_FORMAT = 0x22 , REG_TDM_CONTROL = 0x23 ,
  REG_TDM_FORMAT = 0x24 , REG_IO_CONFIGURATION = 0x25 , REG_FILTER_CONFIG = 0x26 , REG_DAI_PLAYBACK_LEVEL = 0x27 ,
  REG_DAI_PLAYBACK_LEVEL_EQ = 0x28 , REG_LEFT_HP_MIXER = 0x29 , REG_RIGHT_HP_MIXER = 0x2A , REG_HP_CONTROL = 0x2B ,
  REG_LEFT_HP_VOLUME = 0x2C , REG_RIGHT_HP_VOLUME = 0x2D , REG_LEFT_SPK_MIXER = 0x2E , REG_RIGHT_SPK_MIXER = 0x2F ,
  REG_SPK_CONTROL = 0x30 , REG_LEFT_SPK_VOLUME = 0x31 , REG_RIGHT_SPK_VOLUME = 0x32 , REG_DRC_TIMING = 0x33 ,
  REG_DRC_COMPRESSOR = 0x34 , REG_DRC_EXPANDER = 0x35 , REG_DRC_GAIN = 0x36 , REG_RCV_LOUTL_MIXER = 0x37 ,
  REG_RCV_LOUTL_CONTROL = 0x38 , REG_RCV_LOUTL_VOLUME = 0x39 , REG_LOUTR_MIXER = 0x3A , REG_LOUTR_CONTROL = 0x3B ,
  REG_LOUTR_VOLUME = 0x3C , REG_JACK_DETECT = 0x3D , REG_INPUT_ENABLE = 0x3E , REG_OUTPUT_ENABLE = 0x3F ,
  REG_LEVEL_CONTROL = 0x40 , REG_DSP_FILTER_ENABLE = 0x41 , REG_BIAS_CONTROL = 0x42 , REG_DAC_CONTROL = 0x43 ,
  REG_ADC_CONTROL = 0x44 , REG_DEVICE_SHUTDOWN = 0x45 , REG_EQUALIZER_BASE = 0x46 , REG_RECORD_BIQUAD_BASE = 0xAF ,
  REG_DMIC3_VOLUME = 0xBE , REG_DMIC4_VOLUME = 0xBF , REG_DMIC34_BQ_PREATTEN = 0xC0 , REG_RECORD_TDM_SLOT = 0xC1 ,
  REG_SAMPLE_RATE = 0xC2 , REG_DMIC34_BIQUAD_BASE = 0xC3 , REG_REVISION_ID = 0xFF
}
 

Public Member Functions

 MAX98091 ()
 
uint8_t address ()
 Provides the actual I2C address of the codec.
 
bool begin (MAX98091Protocol protocol=MAX98091Protocol::I2S, uint32_t sample_rate=44100, uint32_t mclk_freq=12000000, uint8_t word_size=16, uint8_t channels=2, bool playback=true)
 
bool begin (uint32_t sample_rate, uint8_t bits)
 Initialize the codec: soft reset, configure the system clock, digital audio interface protocol, sample rate and word size, and (if playback is true) configure the default output (speaker/headphone) path.
 
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 configureOutput ()
 Configure the default playback path: route the DAC to the speaker mixers, select DAC-only source for the headphone mixer, enable the headphone and/or speaker outputs (depending on the output device selected via setDevices()) and set the default volume.
 
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.
 
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.
 
bool readRevisionId (uint8_t &id)
 
virtual bool setActive (codec_mode_t mode)
 
void setAddress (uint8_t addr)
 Defines the I2C address of the codec.
 
bool setAudioFormat (uint32_t sample_rate, uint8_t word_size=16, uint8_t channels=2)
 Configure the sample rate, channel count and word size of the digital audio interface.
 
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 all outputs.
 
bool setOutputMute (bool mute, MAX98091Channel channel=MAX98091Channel::All)
 Mute / unmute the output for the given channel(s)
 
bool setOutputVolume (uint8_t volume, MAX98091Channel channel=MAX98091Channel::All)
 
bool setProtocol (MAX98091Protocol protocol)
 Configure the digital audio interface protocol (slave mode)
 
bool setSystemClock (uint32_t mclk_freq)
 Configure the master clock pre-scaler (PSCLK) based on the MCLK frequency, and ensure the codec remains in slave mode.
 
bool setVolume (int volume) override
 Sets the output volume in % (0...100) for all channels.
 
void setWire (i2c_bus_handle_t w)
 Defines the I2C communication object.
 
bool softReset ()
 Soft reset of the codec.
 

Static Public Attributes

static constexpr uint8_t BCI_MASK = (1 << 3)
 
static constexpr uint8_t DALEN_MASK = (1 << 0)
 
static constexpr uint8_t DAREN_MASK = (1 << 1)
 
static constexpr uint8_t DEFAULT_VOLUME = 0x2A
 
static constexpr uint8_t DLY_MASK = (1 << 2)
 
static constexpr uint8_t DMONO_MASK = (1 << 3)
 
static constexpr uint8_t HIZOFF_MASK = (1 << 2)
 
static constexpr uint8_t HPLEN_MASK = (1 << 6)
 
static constexpr uint8_t HPLM_MASK = (1 << 7)
 
static constexpr uint8_t HPREN_MASK = (1 << 7)
 
static constexpr uint8_t HPVOLL_MASK = (31 << 0)
 
static constexpr uint8_t I2S_M_MASK = (1 << 1)
 
static constexpr uint8_t I2S_S_MASK = (1 << 0)
 
static constexpr uint8_t LBEN_MASK = (1 << 4)
 
static constexpr uint8_t LJ_M_MASK = (1 << 3)
 
static constexpr uint8_t LJ_S_MASK = (1 << 2)
 
static constexpr uint8_t LTEN_MASK = (1 << 5)
 
static constexpr uint8_t MAS_MASK = (1 << 7)
 
static constexpr uint8_t MIXHPL_DACL_MASK = (1 << 0)
 
static constexpr uint8_t MIXHPL_DACR_MASK = (1 << 1)
 
static constexpr uint8_t MIXHPL_LINEA_MASK = (1 << 2)
 
static constexpr uint8_t MIXHPL_LINEB_MASK = (1 << 3)
 
static constexpr uint8_t MIXHPL_MASK = (63 << 0)
 
static constexpr uint8_t MIXHPL_MIC1_MASK = (1 << 4)
 
static constexpr uint8_t MIXHPL_MIC2_MASK = (1 << 5)
 
static constexpr uint8_t MIXHPLG_MASK = (3 << 0)
 
static constexpr uint8_t MIXHPLSEL_MASK = (1 << 4)
 
static constexpr uint8_t MIXHPR_DACL_MASK = (1 << 0)
 
static constexpr uint8_t MIXHPR_DACR_MASK = (1 << 1)
 
static constexpr uint8_t MIXHPR_LINEA_MASK = (1 << 2)
 
static constexpr uint8_t MIXHPR_LINEB_MASK = (1 << 3)
 
static constexpr uint8_t MIXHPR_MASK = (63 << 0)
 
static constexpr uint8_t MIXHPR_MIC1_MASK = (1 << 4)
 
static constexpr uint8_t MIXHPR_MIC2_MASK = (1 << 5)
 
static constexpr uint8_t MIXHPRG_MASK = (3 << 2)
 
static constexpr uint8_t MIXHPRSEL_MASK = (1 << 5)
 
static constexpr uint8_t MIXSPL_DACL_MASK = (1 << 0)
 
static constexpr uint8_t MIXSPL_DACR_MASK = (1 << 1)
 
static constexpr uint8_t MIXSPL_LINEA_MASK = (1 << 2)
 
static constexpr uint8_t MIXSPL_LINEB_MASK = (1 << 3)
 
static constexpr uint8_t MIXSPL_MASK = (63 << 0)
 
static constexpr uint8_t MIXSPL_MIC1_MASK = (1 << 4)
 
static constexpr uint8_t MIXSPL_MIC2_MASK = (1 << 5)
 
static constexpr uint8_t MIXSPLG_MASK = (3 << 0)
 
static constexpr uint8_t MIXSPR_DACL_MASK = (1 << 0)
 
static constexpr uint8_t MIXSPR_DACR_MASK = (1 << 1)
 
static constexpr uint8_t MIXSPR_LINEA_MASK = (1 << 2)
 
static constexpr uint8_t MIXSPR_LINEB_MASK = (1 << 3)
 
static constexpr uint8_t MIXSPR_MASK = (63 << 0)
 
static constexpr uint8_t MIXSPR_MIC1_MASK = (1 << 4)
 
static constexpr uint8_t MIXSPR_MIC2_MASK = (1 << 5)
 
static constexpr uint8_t MIXSPRG_MASK = (3 << 2)
 
static constexpr uint8_t PSCLK_DISABLED = (0 << 4)
 
static constexpr uint8_t PSCLK_DIV1 = (1 << 4)
 
static constexpr uint8_t PSCLK_DIV2 = (2 << 4)
 
static constexpr uint8_t PSCLK_DIV4 = (3 << 4)
 
static constexpr uint8_t RCVLEN_MASK = (1 << 3)
 
static constexpr uint8_t RCVREN_MASK = (1 << 2)
 
static constexpr uint8_t REVA = 0x50
 
static constexpr uint8_t RJ_M_MASK = (1 << 5)
 
static constexpr uint8_t RJ_MASK = (1 << 5)
 
static constexpr uint8_t RJ_S_MASK = (1 << 4)
 
static constexpr uint8_t SDIEN_MASK = (1 << 0)
 
static constexpr uint8_t SDOEN_MASK = (1 << 1)
 
static constexpr uint8_t SHDNN_MASK = (1 << 7)
 
static constexpr uint8_t SPK_SLAVE_MASK = (1 << 6)
 
static constexpr uint8_t SPLEN_MASK = (1 << 4)
 
static constexpr uint8_t SPLM_MASK = (1 << 7)
 
static constexpr uint8_t SPREN_MASK = (1 << 5)
 
static constexpr uint8_t SPVOLL_MASK = (63 << 0)
 
static constexpr uint8_t SR_16K_MASK = (1 << 1)
 
static constexpr uint8_t SR_32K_MASK = (1 << 4)
 
static constexpr uint8_t SR_44K1_MASK = (1 << 2)
 
static constexpr uint8_t SR_48K_MASK = (1 << 3)
 
static constexpr uint8_t SR_8K_MASK = (1 << 0)
 
static constexpr uint8_t SR_96K_MASK = (1 << 5)
 
static constexpr uint8_t SWRESET_MASK = (1 << 7)
 
static constexpr uint8_t WCI_MASK = (1 << 4)
 
static constexpr uint8_t WS_16B = (0 << 0)
 
static constexpr uint8_t WS_MASK = (3 << 0)
 

Protected Member Functions

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.
 
bool setVolumeOrMute (MAX98091Channel channel, uint8_t value, bool is_volume)
 
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 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.
 

Protected Attributes

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()
 
int volume_percent = 100
 Last volume (in %) provided to setVolume()
 
i2c_bus_handle_t wire = nullptr
 

Detailed Description

Header only C++ driver for the MAX98091 audio codec.

Provides a soft reset, basic playback configuration (protocol, sample rate, word size, system clock) and output volume/mute control, ported from the corresponding Zephyr RTOS driver.

Member Enumeration Documentation

◆ Reg

enum Reg : uint8_t
Enumerator
REG_SOFTWARE_RESET 
REG_DEVICE_STATUS 
REG_JACK_STATUS 
REG_INTERRUPT_S 
REG_MASTER_CLOCK 
REG_QUICK_SAMPLE_RATE 
REG_DAI_INTERFACE 
REG_DAC_PATH 
REG_MIC_DIRECT_TO_ADC 
REG_LINE_TO_ADC 
REG_ANALOG_MIC_LOOP 
REG_ANALOG_LINE_LOOP 
REG_RESERVED 
REG_LINE_INPUT_CONFIG 
REG_LINE_INPUT_LEVEL 
REG_INPUT_MODE 
REG_MIC1_INPUT_LEVEL 
REG_MIC2_INPUT_LEVEL 
REG_MIC_BIAS_VOLTAGE 
REG_DIGITAL_MIC_ENABLE 
REG_DIGITAL_MIC_CONFIG 
REG_LEFT_ADC_MIXER 
REG_RIGHT_ADC_MIXER 
REG_LEFT_ADC_LEVEL 
REG_RIGHT_ADC_LEVEL 
REG_ADC_BIQUAD_LEVEL 
REG_ADC_SIDETONE 
REG_SYSTEM_CLOCK 
REG_CLOCK_MODE 
REG_CLOCK_RATIO_NI_MSB 
REG_CLOCK_RATIO_NI_LSB 
REG_CLOCK_RATIO_MI_MSB 
REG_CLOCK_RATIO_MI_LSB 
REG_MASTER_MODE 
REG_INTERFACE_FORMAT 
REG_TDM_CONTROL 
REG_TDM_FORMAT 
REG_IO_CONFIGURATION 
REG_FILTER_CONFIG 
REG_DAI_PLAYBACK_LEVEL 
REG_DAI_PLAYBACK_LEVEL_EQ 
REG_LEFT_HP_MIXER 
REG_RIGHT_HP_MIXER 
REG_HP_CONTROL 
REG_LEFT_HP_VOLUME 
REG_RIGHT_HP_VOLUME 
REG_LEFT_SPK_MIXER 
REG_RIGHT_SPK_MIXER 
REG_SPK_CONTROL 
REG_LEFT_SPK_VOLUME 
REG_RIGHT_SPK_VOLUME 
REG_DRC_TIMING 
REG_DRC_COMPRESSOR 
REG_DRC_EXPANDER 
REG_DRC_GAIN 
REG_RCV_LOUTL_MIXER 
REG_RCV_LOUTL_CONTROL 
REG_RCV_LOUTL_VOLUME 
REG_LOUTR_MIXER 
REG_LOUTR_CONTROL 
REG_LOUTR_VOLUME 
REG_JACK_DETECT 
REG_INPUT_ENABLE 
REG_OUTPUT_ENABLE 
REG_LEVEL_CONTROL 
REG_DSP_FILTER_ENABLE 
REG_BIAS_CONTROL 
REG_DAC_CONTROL 
REG_ADC_CONTROL 
REG_DEVICE_SHUTDOWN 
REG_EQUALIZER_BASE 
REG_RECORD_BIQUAD_BASE 
REG_DMIC3_VOLUME 
REG_DMIC4_VOLUME 
REG_DMIC34_BQ_PREATTEN 
REG_RECORD_TDM_SLOT 
REG_SAMPLE_RATE 
REG_DMIC34_BIQUAD_BASE 
REG_REVISION_ID 

Constructor & Destructor Documentation

◆ MAX98091()

MAX98091 ( )
inline

Member Function Documentation

◆ address()

uint8_t address ( )
inlineinherited

Provides the actual I2C address of the codec.

◆ begin() [1/3]

bool begin ( MAX98091Protocol  protocol = MAX98091Protocol::I2S,
uint32_t  sample_rate = 44100,
uint32_t  mclk_freq = 12000000,
uint8_t  word_size = 16,
uint8_t  channels = 2,
bool  playback = true 
)
inline

◆ begin() [2/3]

bool begin ( uint32_t  sample_rate,
uint8_t  bits 
)
inline

Initialize the codec: soft reset, configure the system clock, digital audio interface protocol, sample rate and word size, and (if playback is true) configure the default output (speaker/headphone) path.

Parameters
protocolDigital audio interface protocol (slave mode)
sample_rateI2S sample rate in Hz (8000, 16000, 32000, 44100, 48000 or 96000)
mclk_freqMCLK frequency in Hz (10MHz .. 60MHz)
word_sizeI2S word size in bits (only 16 bits is supported)
channelsnumber of channels (1 = mono, 2 = stereo)
playbackenable & configure the output (speaker/headphone) path Initializes the codec for I2S with the given sample rate and bits per sample

◆ begin() [3/3]

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

Initializes the codec for I2S with the given sample rate, bits per sample, enabling the playback path if mode includes CODEC_MODE_DECODE, using the given I2S data format and number of channels. This chip only supports slave mode, so is_master is ignored.

Implements ZephyrDriverCommon.

◆ configureOutput()

bool configureOutput ( )
inline

Configure the default playback path: route the DAC to the speaker mixers, select DAC-only source for the headphone mixer, enable the headphone and/or speaker outputs (depending on the output device selected via setDevices()) and set the default volume.

◆ getInputVolume()

virtual int getInputVolume ( )
inlinevirtualinherited

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

◆ 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.

◆ 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.

◆ 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.

◆ readRevisionId()

bool readRevisionId ( uint8_t &  id)
inline

Read the device revision ID register (REG_REVISION_ID). Valid MAX98091 devices report a value in the range REVA..REVA+0x0F.

◆ 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.

◆ setAudioFormat()

bool setAudioFormat ( uint32_t  sample_rate,
uint8_t  word_size = 16,
uint8_t  channels = 2 
)
inline

Configure the sample rate, channel count and word size of the digital audio interface.

Parameters
sample_ratesample rate in Hz (8000, 16000, 32000, 44100, 48000 or 96000)
word_sizeword size in bits (only 16 bits is supported)
channelsnumber of channels (1 = mono, 2 = stereo)

◆ 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 all outputs.

Reimplemented from ZephyrDriverCommon.

◆ setOutputMute()

bool setOutputMute ( bool  mute,
MAX98091Channel  channel = MAX98091Channel::All 
)
inline

Mute / unmute the output for the given channel(s)

◆ setOutputVolume()

bool setOutputVolume ( uint8_t  volume,
MAX98091Channel  channel = MAX98091Channel::All 
)
inline

Set the output volume for the given channel(s). Range 0..31 for headphone channels, 0..63 for speaker channels.

◆ setProtocol()

bool setProtocol ( MAX98091Protocol  protocol)
inline

Configure the digital audio interface protocol (slave mode)

◆ setSystemClock()

bool setSystemClock ( uint32_t  mclk_freq)
inline

Configure the master clock pre-scaler (PSCLK) based on the MCLK frequency, and ensure the codec remains in slave mode.

Parameters
mclk_freqMCLK frequency in Hz, in the range 10MHz .. 60MHz

◆ setVolume()

bool setVolume ( int  volume)
inlineoverridevirtual

Sets the output volume in % (0...100) for all channels.

Reimplemented from ZephyrDriverCommon.

◆ setVolumeOrMute()

bool setVolumeOrMute ( MAX98091Channel  channel,
uint8_t  value,
bool  is_volume 
)
inlineprotected

◆ setWire()

void setWire ( i2c_bus_handle_t  w)
inlineinherited

Defines the I2C communication object.

◆ softReset()

bool softReset ( )
inline

Soft reset of the codec.

◆ 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.

◆ 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

◆ BCI_MASK

constexpr uint8_t BCI_MASK = (1 << 3)
staticconstexpr

◆ DALEN_MASK

constexpr uint8_t DALEN_MASK = (1 << 0)
staticconstexpr

◆ DAREN_MASK

constexpr uint8_t DAREN_MASK = (1 << 1)
staticconstexpr

◆ DEFAULT_VOLUME

constexpr uint8_t DEFAULT_VOLUME = 0x2A
staticconstexpr

◆ DLY_MASK

constexpr uint8_t DLY_MASK = (1 << 2)
staticconstexpr

◆ DMONO_MASK

constexpr uint8_t DMONO_MASK = (1 << 3)
staticconstexpr

◆ HIZOFF_MASK

constexpr uint8_t HIZOFF_MASK = (1 << 2)
staticconstexpr

◆ HPLEN_MASK

constexpr uint8_t HPLEN_MASK = (1 << 6)
staticconstexpr

◆ HPLM_MASK

constexpr uint8_t HPLM_MASK = (1 << 7)
staticconstexpr

◆ HPREN_MASK

constexpr uint8_t HPREN_MASK = (1 << 7)
staticconstexpr

◆ HPVOLL_MASK

constexpr uint8_t HPVOLL_MASK = (31 << 0)
staticconstexpr

◆ i2c_addr

uint8_t i2c_addr = 0
protectedinherited

◆ I2S_M_MASK

constexpr uint8_t I2S_M_MASK = (1 << 1)
staticconstexpr

◆ I2S_S_MASK

constexpr uint8_t I2S_S_MASK = (1 << 0)
staticconstexpr

◆ input_volume_percent

int input_volume_percent = 100
protectedinherited

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

◆ LBEN_MASK

constexpr uint8_t LBEN_MASK = (1 << 4)
staticconstexpr

◆ LJ_M_MASK

constexpr uint8_t LJ_M_MASK = (1 << 3)
staticconstexpr

◆ LJ_S_MASK

constexpr uint8_t LJ_S_MASK = (1 << 2)
staticconstexpr

◆ LTEN_MASK

constexpr uint8_t LTEN_MASK = (1 << 5)
staticconstexpr

◆ MAS_MASK

constexpr uint8_t MAS_MASK = (1 << 7)
staticconstexpr

◆ MIXHPL_DACL_MASK

constexpr uint8_t MIXHPL_DACL_MASK = (1 << 0)
staticconstexpr

◆ MIXHPL_DACR_MASK

constexpr uint8_t MIXHPL_DACR_MASK = (1 << 1)
staticconstexpr

◆ MIXHPL_LINEA_MASK

constexpr uint8_t MIXHPL_LINEA_MASK = (1 << 2)
staticconstexpr

◆ MIXHPL_LINEB_MASK

constexpr uint8_t MIXHPL_LINEB_MASK = (1 << 3)
staticconstexpr

◆ MIXHPL_MASK

constexpr uint8_t MIXHPL_MASK = (63 << 0)
staticconstexpr

◆ MIXHPL_MIC1_MASK

constexpr uint8_t MIXHPL_MIC1_MASK = (1 << 4)
staticconstexpr

◆ MIXHPL_MIC2_MASK

constexpr uint8_t MIXHPL_MIC2_MASK = (1 << 5)
staticconstexpr

◆ MIXHPLG_MASK

constexpr uint8_t MIXHPLG_MASK = (3 << 0)
staticconstexpr

◆ MIXHPLSEL_MASK

constexpr uint8_t MIXHPLSEL_MASK = (1 << 4)
staticconstexpr

◆ MIXHPR_DACL_MASK

constexpr uint8_t MIXHPR_DACL_MASK = (1 << 0)
staticconstexpr

◆ MIXHPR_DACR_MASK

constexpr uint8_t MIXHPR_DACR_MASK = (1 << 1)
staticconstexpr

◆ MIXHPR_LINEA_MASK

constexpr uint8_t MIXHPR_LINEA_MASK = (1 << 2)
staticconstexpr

◆ MIXHPR_LINEB_MASK

constexpr uint8_t MIXHPR_LINEB_MASK = (1 << 3)
staticconstexpr

◆ MIXHPR_MASK

constexpr uint8_t MIXHPR_MASK = (63 << 0)
staticconstexpr

◆ MIXHPR_MIC1_MASK

constexpr uint8_t MIXHPR_MIC1_MASK = (1 << 4)
staticconstexpr

◆ MIXHPR_MIC2_MASK

constexpr uint8_t MIXHPR_MIC2_MASK = (1 << 5)
staticconstexpr

◆ MIXHPRG_MASK

constexpr uint8_t MIXHPRG_MASK = (3 << 2)
staticconstexpr

◆ MIXHPRSEL_MASK

constexpr uint8_t MIXHPRSEL_MASK = (1 << 5)
staticconstexpr

◆ MIXSPL_DACL_MASK

constexpr uint8_t MIXSPL_DACL_MASK = (1 << 0)
staticconstexpr

◆ MIXSPL_DACR_MASK

constexpr uint8_t MIXSPL_DACR_MASK = (1 << 1)
staticconstexpr

◆ MIXSPL_LINEA_MASK

constexpr uint8_t MIXSPL_LINEA_MASK = (1 << 2)
staticconstexpr

◆ MIXSPL_LINEB_MASK

constexpr uint8_t MIXSPL_LINEB_MASK = (1 << 3)
staticconstexpr

◆ MIXSPL_MASK

constexpr uint8_t MIXSPL_MASK = (63 << 0)
staticconstexpr

◆ MIXSPL_MIC1_MASK

constexpr uint8_t MIXSPL_MIC1_MASK = (1 << 4)
staticconstexpr

◆ MIXSPL_MIC2_MASK

constexpr uint8_t MIXSPL_MIC2_MASK = (1 << 5)
staticconstexpr

◆ MIXSPLG_MASK

constexpr uint8_t MIXSPLG_MASK = (3 << 0)
staticconstexpr

◆ MIXSPR_DACL_MASK

constexpr uint8_t MIXSPR_DACL_MASK = (1 << 0)
staticconstexpr

◆ MIXSPR_DACR_MASK

constexpr uint8_t MIXSPR_DACR_MASK = (1 << 1)
staticconstexpr

◆ MIXSPR_LINEA_MASK

constexpr uint8_t MIXSPR_LINEA_MASK = (1 << 2)
staticconstexpr

◆ MIXSPR_LINEB_MASK

constexpr uint8_t MIXSPR_LINEB_MASK = (1 << 3)
staticconstexpr

◆ MIXSPR_MASK

constexpr uint8_t MIXSPR_MASK = (63 << 0)
staticconstexpr

◆ MIXSPR_MIC1_MASK

constexpr uint8_t MIXSPR_MIC1_MASK = (1 << 4)
staticconstexpr

◆ MIXSPR_MIC2_MASK

constexpr uint8_t MIXSPR_MIC2_MASK = (1 << 5)
staticconstexpr

◆ MIXSPRG_MASK

constexpr uint8_t MIXSPRG_MASK = (3 << 2)
staticconstexpr

◆ output_device

output_device_t output_device = DAC_OUTPUT_ALL
protected

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

◆ PSCLK_DISABLED

constexpr uint8_t PSCLK_DISABLED = (0 << 4)
staticconstexpr

◆ PSCLK_DIV1

constexpr uint8_t PSCLK_DIV1 = (1 << 4)
staticconstexpr

◆ PSCLK_DIV2

constexpr uint8_t PSCLK_DIV2 = (2 << 4)
staticconstexpr

◆ PSCLK_DIV4

constexpr uint8_t PSCLK_DIV4 = (3 << 4)
staticconstexpr

◆ RCVLEN_MASK

constexpr uint8_t RCVLEN_MASK = (1 << 3)
staticconstexpr

◆ RCVREN_MASK

constexpr uint8_t RCVREN_MASK = (1 << 2)
staticconstexpr

◆ REVA

constexpr uint8_t REVA = 0x50
staticconstexpr

◆ RJ_M_MASK

constexpr uint8_t RJ_M_MASK = (1 << 5)
staticconstexpr

◆ RJ_MASK

constexpr uint8_t RJ_MASK = (1 << 5)
staticconstexpr

◆ RJ_S_MASK

constexpr uint8_t RJ_S_MASK = (1 << 4)
staticconstexpr

◆ SDIEN_MASK

constexpr uint8_t SDIEN_MASK = (1 << 0)
staticconstexpr

◆ SDOEN_MASK

constexpr uint8_t SDOEN_MASK = (1 << 1)
staticconstexpr

◆ SHDNN_MASK

constexpr uint8_t SHDNN_MASK = (1 << 7)
staticconstexpr

◆ SPK_SLAVE_MASK

constexpr uint8_t SPK_SLAVE_MASK = (1 << 6)
staticconstexpr

◆ SPLEN_MASK

constexpr uint8_t SPLEN_MASK = (1 << 4)
staticconstexpr

◆ SPLM_MASK

constexpr uint8_t SPLM_MASK = (1 << 7)
staticconstexpr

◆ SPREN_MASK

constexpr uint8_t SPREN_MASK = (1 << 5)
staticconstexpr

◆ SPVOLL_MASK

constexpr uint8_t SPVOLL_MASK = (63 << 0)
staticconstexpr

◆ SR_16K_MASK

constexpr uint8_t SR_16K_MASK = (1 << 1)
staticconstexpr

◆ SR_32K_MASK

constexpr uint8_t SR_32K_MASK = (1 << 4)
staticconstexpr

◆ SR_44K1_MASK

constexpr uint8_t SR_44K1_MASK = (1 << 2)
staticconstexpr

◆ SR_48K_MASK

constexpr uint8_t SR_48K_MASK = (1 << 3)
staticconstexpr

◆ SR_8K_MASK

constexpr uint8_t SR_8K_MASK = (1 << 0)
staticconstexpr

◆ SR_96K_MASK

constexpr uint8_t SR_96K_MASK = (1 << 5)
staticconstexpr

◆ SWRESET_MASK

constexpr uint8_t SWRESET_MASK = (1 << 7)
staticconstexpr

◆ volume_percent

int volume_percent = 100
protectedinherited

Last volume (in %) provided to setVolume()

◆ WCI_MASK

constexpr uint8_t WCI_MASK = (1 << 4)
staticconstexpr

◆ wire

i2c_bus_handle_t wire = nullptr
protectedinherited

◆ WS_16B

constexpr uint8_t WS_16B = (0 << 0)
staticconstexpr

◆ WS_MASK

constexpr uint8_t WS_MASK = (3 << 0)
staticconstexpr

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