Skip to content
Get started

TAS2780

The tas2780 platform allows your ESPHome devices to use the Texas Instruments TAS2780 mono Class-D audio amplifier with digital (TDM/I2S) input. This allows the playback of audio via the microcontroller from a range of sources via Speaker or Media Player.

The I²C bus is required in your configuration as this is used to communicate with the TAS2780 for configuration and status monitoring. Audio data is delivered via I2S/TDM.

# Example configuration entry
audio_dac:
- platform: tas2780
id: tas2780_amp
  • amp_level (Optional, int): Amplifier output level index. Controls the Class-D output voltage level. Valid range: 0 to 20, corresponding to approximately 11 dBV to 21 dBV at 48 kSPS (roughly 0.5 dBV per step). Defaults to 8.
  • power_mode (Optional, int): Selects the power supply operating mode. Defaults to 2.
    • 0 — PVDD is the only supply. VBAT1S is supplied externally.
    • 1 — VBAT1S delivers output power at low signal levels; Class-D switches to PVDD when the audio signal exceeds a configured threshold.
    • 2 — PVDD is the only supply. An internal LDO generates VBAT1S for near-idle signal levels. Class-D switches back to PVDD when the signal exceeds approximately −100 dBFS. (default)
    • 3 — Forced low-power rail mode.
  • vol_range_min (Optional, float): Maps the audio_dac 0 % volume level to this fraction of the digital volume scale. Valid range: 0.0 to 1.0. Defaults to 0.3. Use this to raise the minimum audible volume and avoid near-silent output at the bottom of the range.
  • vol_range_max (Optional, float): Maps the audio_dac 100 % volume level to this fraction of the digital volume scale. Valid range: 0.0 to 1.0. Defaults to 1.0.
  • channel (Optional, string): Selects which TDM input channel is played back. Defaults to mono.
    • mono — Mono downmix (stereo left + right mixed to mono).
    • left — Left channel only.
    • right — Right channel only.
  • address (Optional, int): The I²C address of the TAS2780. The address is set by the SD0 pin on the device (see the datasheet). Defaults to 0x38.
  • update_interval (Optional, Time): How often internal error states are logged. Defaults to 5s.
  • i2c_id (Optional): The ID of the I²C bus the TAS2780 is connected to.
  • All other options from Audio DAC.

Activates the amplifier (transitions from software shutdown to active mode). An optional power_mode parameter allows changing the power mode at activation time; if omitted the currently configured power mode is used.

Configuration variables:

  • id (Required, ID): The ID of the tas2780 platform.
  • power_mode (Optional, int, templatable): Power mode to activate with (0–3). Defaults to the value set in the component configuration.

Puts the amplifier into software shutdown, cutting audio output while keeping the device powered and accessible over I²C.

Configuration variables:

  • id (Required, ID): The ID of the tas2780 platform.

Performs a full software reset and reinitializes the device. Useful for recovering from fault conditions such as over-temperature or over-current errors logged during polling.

Configuration variables:

  • id (Required, ID): The ID of the tas2780 platform.

Updates one or more runtime-configurable parameters and immediately applies them to the device without a full reset. amp_level and channel changes are written to hardware; vol_range_min / vol_range_max changes take effect on the next volume write.

Configuration variables:

  • id (Required, ID): The ID of the tas2780 platform.
  • amp_level (Optional, int, templatable): New amplifier level index (0–20).
  • channel (Optional, string, templatable): New channel selection (mono, left, or right).
  • vol_range_min (Optional, float, templatable): New minimum volume fraction (0.0–1.0).
  • vol_range_max (Optional, float, templatable): New maximum volume fraction (0.0–1.0).

All Audio DAC Automations are supported by this platform as well.

Mono speaker:

i2c:
sda: GPIOXX
scl: GPIOXX
i2s_audio:
- id: i2s_output
i2s_lrclk_pin: GPIOXX
i2s_bclk_pin: GPIOXX
audio_dac:
- platform: tas2780
id: tas2780_amp
address: 0x38
amp_level: 10
speaker:
- platform: i2s_audio
id: amp_speaker
i2s_audio_id: i2s_output
i2s_dout_pin: GPIOXX
dac_type: external
audio_dac: tas2780_amp

Stereo setup with two TAS2780 devices (left + right):

audio_dac:
- platform: tas2780
id: tas2780_left
address: 0x38
channel: left
- platform: tas2780
id: tas2780_right
address: 0x39
channel: right

Deactivate the amplifier when idle and reactivate on demand:

button:
- platform: template
name: "Amplifier On"
on_press:
- tas2780.activate:
id: tas2780_amp
- platform: template
name: "Amplifier Off"
on_press:
- tas2780.deactivate:
id: tas2780_amp