[audio_dac] [aic3204] Add new component + platform docs (#4286)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Keith Burzinski 2024-10-06 15:59:40 -05:00 committed by GitHub
parent df96b67cb2
commit ab281e7bf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,54 @@
AIC3204
=======
.. seo::
:description: Instructions for using ESPHome's AIC3204 audio DAC platform to play media from your devices.
:image: i2s_audio.svg
:keywords: AIC3204, Audio, DAC, I2S, ESP32
The ``aic3204`` platform allows your ESPHome devices to use the AIC3204 ultra low power stereo audio codec (DAC).
This allows the playback of audio via the microcontroller from a range of sources via
:doc:`/components/media_player/index`.
The :ref:`I²C bus <i2c>` is required in your configuration as this is used to communicate with the AIC3204.
.. code-block:: yaml
# Example configuration entry
audio_dac:
- platform: aic3204
.. _config-aic3204:
Configuration variables:
------------------------
- **address** (*Optional*, int): The I²C address of the driver. Defaults to ``0x18``.
- **i2c_id** (*Optional*): The ID of the :ref:`I²C bus <i2c>` the AIC3204 is connected to.
- All other options from :ref:`Audio DAC <config-audio_dac>`.
Automations
-----------
``aic3204.set_auto_mute_mode`` Action
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This action sets the auto-mute mode of the AIC3204. See page 111 in the
`reference manual <https://www.ti.com/lit/ml/slaa557/slaa557.pdf?ts=1727495047647&ref_url=ti.com>`__
for more information.
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the ``aic3204`` platform.
- **mode** (**Required**, int, :ref:`templatable <config-templatable>`): The auto-mute mode to be used; must be in the
range of 0 (auto-mute disabled) to 7.
All :ref:`Audio DAC Automations <automations-audio_dac>` are supported by this platform, as well.
See Also
--------
- :doc:`index`
- :apiref:`aic3204/aic3204.h`
- :apiref:`audio_dac/audio_dac.h`
- :ghedit:`Edit`

View File

@ -0,0 +1,71 @@
Audio DAC Core
==============
.. seo::
:description: Instructions for using ESPHome's Audio DAC Core component.
:image: i2s_audio.svg
:keywords: Audio, DAC, I2S, ESP32
The `audio_dac` component allows your ESPHome devices to use audio DAC hardware components, allowing the playback of
audio via the microcontroller from a range of sources via :doc:`/components/media_player/index`.
.. code-block:: yaml
# Example configuration entry
audio_dac:
- platform: ...
.. _config-audio_dac:
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
.. _automations-audio_dac:
Automations
-----------
``audio_dac.mute_off`` Action
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This action unmutes the output of the DAC.
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the ``audio_dac`` platform.
``audio_dac.mute_on`` Action
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This action mutes the output of the DAC.
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the ``audio_dac`` platform.
``audio_dac.set_volume`` Action
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This action sets the output volume of the DAC.
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID of the ``audio_dac`` platform.
- **volume** (**Required**, percentage, :ref:`templatable <config-templatable>`): The desired volume level for the
output from 0% to 100%.
Platforms
---------
.. toctree::
:maxdepth: 1
:glob:
*
See Also
--------
- :ghedit:`Edit`

View File

@ -27,6 +27,7 @@ Components
lock/index
display_menu/index
lvgl/index
audio_dac/index
media_player/index
microphone/index
speaker/index

1
images/aic3204.svg Normal file
View File

@ -0,0 +1 @@
<svg viewBox="0 0 130 25" id="svg5" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs9"/><path d="M5 0H125a5 5 0 015 5v15a5 5 0 01-5 5H5a5 5 0 01-5-5V5a5 5 0 015-5z" style="fill:#000" id="path2"/><g aria-label="AIC3204" id="component-text" style="font-weight:900;font-size:25px;font-family:Montserrat;letter-spacing:1.1px;fill:#fffffc"><path d="m4.525 21 7.65-17.5h5.8l7.65 17.5h-6.1L13.875 6.3h2.3L10.525 21zm4.55-3.05 1.5-4.25h8.05l1.5 4.25z" id="path11"/><path d="M27.674994 21V3.5h5.9V21z" id="path13"/><path d="m46.575004 21.4q-2.1.0-3.9-.65-1.775-.675-3.1-1.9-1.3-1.225-2.025-2.9-.725-1.675-.725-3.7t.725-3.7q.725-1.675 2.025-2.9 1.325-1.225 3.1-1.875 1.8-.675 3.9-.675 2.575.0 4.55.9 2 .9 3.3 2.6l-3.725 3.325q-.775-.975-1.725-1.5-.925-.55-2.1-.55-.925.0-1.675.3t-1.3.875q-.525.575-.825 1.4-.3.8-.3 1.8t.3 1.825q.3.8.825 1.375.55.575 1.3.875t1.675.3q1.175.0 2.1-.525.95-.55 1.725-1.525l3.725 3.325q-1.3 1.675-3.3 2.6-1.975.9-4.55.9z" id="path15"/><path d="m62.549992 21.4q-1.8.0-3.65-.4t-3.25-1.175l2-4.35q1.125.65 2.35.975 1.25.3 2.35.3 1 0 1.625-.325.65-.35.65-1.025.0-.575-.475-.875-.475-.325-1.6-.325h-2.325v-3.625l4.525-4.6.525 1.975h-8.725V3.5h13.05v3.625l-4.525 4.6-2.825-1.6h1.55q3.3.0 5.025 1.475 1.725 1.475 1.725 3.8.0 1.5-.85 2.875-.825 1.375-2.6 2.25-1.75.875-4.55.875z" id="path17"/><path d="m72.825023 21v-3.625l6.325-5.85q.6-.575.875-1 .3-.425.4-.75.1-.35.1-.65.0-.65-.425-1-.425-.375-1.275-.375-.775.0-1.475.425-.7.4-1.1 1.2l-4.45-2.225q.95-1.8 2.85-2.925 1.9-1.125 4.725-1.125 2.075.0 3.675.675t2.5 1.9q.9 1.225.9 2.9.0.85-.225 1.7-.2.85-.85 1.8-.65.925-1.925 2.075l-4.75 4.325-.925-2.05h9.075V21z" id="path19"/><path d="m97.075018 21.4q-2.325.0-4.125-1.075-1.775-1.075-2.8-3.125-1-2.05-1-4.95.0-2.9 1-4.95 1.025-2.05 2.8-3.125 1.8-1.075 4.125-1.075t4.100002 1.075q1.8 1.075 2.8 3.125 1.025 2.05 1.025 4.95t-1.025 4.95q-1 2.05-2.8 3.125-1.775002 1.075-4.100002 1.075zm0-4.725q.575.0 1.025-.4.45-.4.7-1.375.275-.975.275-2.65.0-1.7-.275-2.65-.25-.975-.7-1.375t-1.025-.4-1.025.4-.725 1.375q-.25.95-.25 2.65.0 1.675.25 2.65.275.975.725 1.375.45.4 1.025.4z" id="path21"/><path d="M107.4 18V14.25L114.825 3.5h6.05l-7.15 10.75-2.75-.825h13.55V18zm9.075 3v-3l.175-4.575V10.75h5.55V21z" id="path23"/></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

1
images/audio_dac.svg Normal file
View File

@ -0,0 +1 @@
<svg viewBox="0 0 165 25" id="svg5" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs9"/><path d="M5 0H160a5 5 0 015 5v15a5 5 0 01-5 5H5a5 5 0 01-5-5V5a5 5 0 015-5z" style="fill:#000" id="path2"/><g aria-label="Audio DAC" id="component-text" style="font-weight:900;font-size:25px;font-family:Montserrat;letter-spacing:1.1px;fill:#fffffc"><path d="m4.525 21 7.65-17.5h5.8l7.65 17.5h-6.1L13.875 6.3h2.3L10.525 21zm4.55-3.05 1.5-4.25h8.05l1.5 4.25z" id="path11"/><path d="m32.949989 21.25q-1.625.0-2.95-.65-1.3-.675-2.05-2.075-.75-1.425-.75-3.65v-7.55h5.65V13.9q0 1.45.475 2.025t1.3.575q.5.0.925-.25.45-.275.725-.875.275-.625.275-1.625V7.325h5.65V21h-5.375v-3.95l1.075 1.075q-.725 1.6-2.075 2.375-1.325.75-2.875.75z" id="path13"/><path d="m51.799988 21.25q-1.775.0-3.3-.85-1.5-.875-2.4-2.45-.9-1.6-.9-3.8t.9-3.775q.9-1.6 2.4-2.45 1.525-.85 3.3-.85 1.8.0 2.95.775 1.15.75 1.7 2.325.55 1.55.55 3.975.0 2.45-.525 4.025-.5 1.575-1.65 2.325-1.125.75-3.025.75zm1.35-4.4q.625.0 1.125-.3t.8-.9q.3-.625.3-1.5.0-.9-.3-1.475-.3-.6-.8-.9t-1.125-.3-1.125.3-.8.9q-.3.575-.3 1.475.0.875.3 1.5.3.6.8.9t1.125.3zm2.4 4.15v-1.85l-.025-5-.25-5v-6.7h5.65V21z" id="path15"/><path d="M64.524986 21V7.325h5.65V21zm2.825-14.775q-1.55.0-2.475-.825t-.925-2.05q0-1.225.925-2.05.925-.825 2.475-.825t2.475.775q.925.775.925 2 0 1.3-.925 2.15-.925.825-2.475.825z" id="path17"/><path d="m80.999994 21.25q-2.325.0-4.125-.9-1.775-.925-2.8-2.525-1.025-1.6-1.025-3.675t1.025-3.675q1.025-1.6 2.8-2.5 1.8-.9 4.125-.9t4.125.9 2.8 2.5q1.025 1.6 1.025 3.675t-1.025 3.675q-1 1.6-2.8 2.525-1.8.9-4.125.9zm0-4.4q.625.0 1.125-.3t.8-.9q.3-.625.3-1.5.0-.9-.3-1.475-.3-.6-.8-.9t-1.125-.3-1.125.3-.8.9q-.3.575-.3 1.475.0.875.3 1.5.3.6.8.9t1.125.3z" id="path19"/><path d="M100.59996 21V3.5h8.625q2.925.0 5.15 1.075 2.225 1.05 3.475 3t1.25 4.65q0 2.725-1.25 4.7-1.25 1.95-3.475 3.025-2.225 1.05-5.15 1.05zm5.9-4.6h2.475q1.25.0 2.175-.475.95-.475 1.475-1.4.525-.95.525-2.3.0-1.325-.525-2.25t-1.475-1.4q-.925-.475-2.175-.475h-2.475z" id="path21"/><path d="m120.19996 21 7.65-17.5h5.8l7.65 17.5h-6.1l-5.65-14.7h2.3l-5.65 14.7zm4.55-3.05 1.5-4.25h8.05l1.5 4.25z" id="path23"/><path d="m152.14994 21.4q-2.1.0-3.9-.65-1.775-.675-3.1-1.9-1.3-1.225-2.025-2.9-.725-1.675-.725-3.7t.725-3.7q.725-1.675 2.025-2.9 1.325-1.225 3.1-1.875 1.8-.675 3.9-.675 2.575.0 4.55.9 2 .9 3.3 2.6l-3.725 3.325q-.775-.975-1.725-1.5-.925-.55-2.1-.55-.925.0-1.675.3t-1.3.875q-.525.575-.825 1.4-.3.8-.3 1.8t.3 1.825q.3.8.825 1.375.55.575 1.3.875t1.675.3q1.175.0 2.1-.525.95-.55 1.725-1.525l3.725 3.325q-1.3 1.675-3.3 2.6-1.975.9-4.55.9z" id="path25"/></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1004,6 +1004,14 @@ Lock Components
Template Lock, components/lock/template, description.svg, dark-invert
Generic Output Lock, components/lock/output, upload.svg, dark-invert
Audio DAC Components
--------------------
.. imgtable::
Audio DAC Core, components/audio_dac/index, audio_dac.svg
AIC3204, components/audio_dac/aic3204, aic3204.svg
Media Player Components
-----------------------