Documentation for DAC7678 component (#2053)

This commit is contained in:
Nick B 2022-06-21 07:12:19 +02:00 committed by GitHub
parent dc8a1be539
commit 178a84b401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,114 @@
DAC7678
=======
.. seo::
:description: Instructions for setting up the DAC7678.
:image: dac7678.svg
:keywords: DAC7678
.. _dac7678-component:
Component/Hub
-------------
The DAC7678 component represents a DAC7678 12-bit 8 channel DAC with internal reference
(`datasheet <https://www.ti.com/lit/ds/symlink/dac7678.pdf>`__) in ESPHome. It
uses the :ref:`I²C Bus <i2c>` for communication.
To use the channels of this components, you first need to setup the
global ``dac7678`` hub and give it an id, and then define the
:ref:`individual output channels <dac7678-output>`.
.. code-block:: yaml
# Example configuration entry
dac7678:
address: 0x4A
id: dac7678_hub1
internal_reference: true
# Individual outputs
output:
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 0
Configuration variables:
************************
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x48``.
- **id** (*Optional*, :ref:`config-id`): The id to use for
this dac7678 component. Use this if you have multiple DAC7678s connected at the same time
- **internal_reference** (*Optional*, bool): State of the internal reference.
Defaults to ``false``.
.. _dac7678-output:
DAC Output
----------
The DAC7678 output component exposes a DAC7678 DAC channel of a global
:ref:`DAC7678 hub <dac7678-component>` as a float
output.
.. code-block:: yaml
# Example configuration entry
dac7678:
address: 0x4A
id: dac7678_hub1
internal_reference: true
# Individual outputs
output:
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 0
id: 'dac7678_1_ch0'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 1
id: 'dac7678_1_ch1'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 2
id: 'dac7678_1_ch2'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 3
id: 'dac7678_1_ch3'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 4
id: 'dac7678_1_ch4'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 5
id: 'dac7678_1_ch5'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 6
id: 'dac7678_1_ch6'
- platform: dac7678
dac7678_id: 'dac7678_hub1'
channel: 7
id: 'dac7678_1_ch7'
Configuration variables:
************************
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the DAC7678 of
this output component. Must be in range from 0 to 7.
- **dac7678_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:ref:`DAC7678 hub <dac7678-component>`.
Use this if you have multiple DAC7678 devices.
- All other options from :ref:`Output <config-output>`.
See Also
--------
- :doc:`/components/output/index`
- :ghedit:`Edit`

1
images/dac7678.svg Normal file
View File

@ -0,0 +1 @@
<svg width="475.15" height="25mm" viewBox="0 0 125.717 25" xmlns="http://www.w3.org/2000/svg"><path style="fill:#000;fill-opacity:1;stroke-width:.133497;stroke-miterlimit:4;stroke-dasharray:none" d="M5 0h115.717c2.77 0 5 2.23 5 5v15c0 2.77-2.23 5-5 5H5c-2.77 0-5-2.23-5-5V5c0-2.77 2.23-5 5-5Z"/><g aria-label="DAC7678" style="font-size:10.5833px;line-height:1.25;letter-spacing:1.08479px;fill:#fffffc;stroke-width:.264583"><path d="M6.48 20.666V4.86h7.18q2.574 0 4.538.994 1.987.97 3.07 2.754 1.107 1.784 1.107 4.154 0 2.371-1.106 4.155-1.084 1.783-3.07 2.777-1.965.97-4.539.97zm7-3.003q2.37 0 3.77-1.31 1.422-1.332 1.422-3.59 0-2.257-1.422-3.567-1.4-1.332-3.77-1.332h-3.342v9.799zM41.635 20.666h-3.838l-1.4-3.387H29.06l-1.4 3.387h-3.747L30.956 4.86h3.612zM32.74 8.45l-2.506 6.051h5.013zM51.706 20.937q-2.416 0-4.38-1.039-1.942-1.061-3.07-2.912-1.107-1.874-1.107-4.223 0-2.348 1.106-4.199 1.13-1.874 3.07-2.913 1.965-1.06 4.403-1.06 2.055 0 3.703.722 1.671.722 2.8 2.077l-2.348 2.167q-1.603-1.851-3.974-1.851-1.467 0-2.619.655-1.151.632-1.806 1.783-.632 1.152-.632 2.62 0 1.467.632 2.618.655 1.152 1.806 1.807 1.152.632 2.62.632 2.37 0 3.973-1.874l2.348 2.167q-1.129 1.378-2.8 2.1-1.67.723-3.725.723zM60.49 10.415V4.861h12.666v2.37l-5.87 13.435h-3.974l5.667-12.824h-5.238v2.573zM83.023 10.754q1.513 0 2.755.61t1.964 1.738q.723 1.106.723 2.574 0 1.58-.79 2.777t-2.168 1.851q-1.355.633-3.025.633-3.32 0-5.193-2.032-1.874-2.032-1.874-5.803 0-2.687 1.016-4.606t2.822-2.912q1.829-.994 4.222-.994 1.264 0 2.416.294 1.174.27 1.987.79l-1.355 2.687q-1.174-.79-2.958-.79-2.01 0-3.183 1.174-1.174 1.174-1.265 3.409 1.4-1.4 3.906-1.4zm-.745 7.45q1.174 0 1.897-.631.745-.633.745-1.716 0-1.084-.745-1.716-.723-.655-1.942-.655-1.196 0-1.964.677-.768.655-.768 1.694 0 1.038.745 1.693t2.032.655zM90.498 10.415V4.861h12.666v2.37l-5.87 13.435H93.32l5.667-12.824h-5.238v2.573zM116.305 12.357q1.174.587 1.784 1.535.632.949.632 2.19 0 1.468-.835 2.574-.836 1.084-2.348 1.694-1.513.587-3.5.587t-3.5-.587q-1.49-.61-2.325-1.694-.813-1.106-.813-2.574 0-1.241.61-2.19.632-.948 1.783-1.535-.88-.542-1.354-1.355-.474-.835-.474-1.896 0-1.377.767-2.393.768-1.016 2.145-1.558 1.377-.565 3.161-.565 1.806 0 3.183.565 1.4.542 2.168 1.558.768 1.016.768 2.393 0 1.061-.475 1.896-.474.813-1.377 1.355zm-4.267-5.08q-1.106 0-1.784.542-.654.52-.654 1.445 0 .903.654 1.422.655.52 1.784.52t1.806-.52q.678-.519.678-1.422 0-.926-.678-1.445-.677-.542-1.806-.542zm0 10.973q1.377 0 2.167-.61.813-.632.813-1.67 0-1.04-.813-1.649-.79-.61-2.167-.61-1.355 0-2.145.61t-.79 1.649q0 1.06.79 1.67.79.61 2.145.61z" style="font-weight:700;font-size:22.5778px;font-family:Montserrat;-inkscape-font-specification:'Montserrat, Bold'"/></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -441,6 +441,7 @@ Output Components
MCP4725, components/output/mcp4725, mcp4725.jpg
MCP4728, components/output/mcp4728, mcp4728.jpg
MCP47A1, components/output/mcp47a1, mcp47a1.svg
DAC7678, components/output/dac7678, dac7678.svg
BLE Binary Output, components/output/ble_client, bluetooth.svg
Modbus Output, components/output/modbus_controller, modbus.png
Custom Output, components/output/custom, language-cpp.svg