From cda94f58d35f49276d456e3119fba2a786496821 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:22:17 +1200 Subject: [PATCH] [sn74hc595] Update documentation for type and spi_id (#3787) --- components/sn74hc595.rst | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/components/sn74hc595.rst b/components/sn74hc595.rst index 7d48a6192..f33a044c7 100644 --- a/components/sn74hc595.rst +++ b/components/sn74hc595.rst @@ -58,28 +58,36 @@ Configuration variables: - **oe_pin** (*Optional*, :ref:`Pin Schema `): Pin connected to SN74HC595 OE pin - **sr_count** (*Optional*, int): Number of daisy-chained shift registers, up-to 256. Defaults to ``1``. - -Pin configuration variables: -**************************** - -- **sn74hc595** (**Required**, :ref:`config-id`): The id of the SN74HC595 component the pin belongs to. -- **number** (**Required**, int): The pin number. -- **inverted** (*Optional*, boolean): If all written values should be treated as inverted. - Defaults to ``false``. - Over SPI -------- .. code-block:: yaml # Example configuration entry - spi: sn74hc595: - id: 'sn74hc595_hub' + type: spi latch_pin: D7 oe_pin: D6 sr_count: 2 + +Configuration variables: +************************ + +- **id** (**Required**, :ref:`config-id`): The id to use for this SN74HC595 component. +- **spi_id** (**Required**, :ref:`SPI Bus Schema `): The SPI bus to use. This will automatically be set to the ID of the SPI bus if there is only one. +- **type** (**Required**, string): Must be ``spi``. +- **latch_pin** (**Required**, :ref:`Pin Schema `): Pin connected to SN74HC595 RCLK (ST_CP) pin +- **oe_pin** (*Optional*, :ref:`Pin Schema `): Pin connected to SN74HC595 OE pin +- **sr_count** (*Optional*, int): Number of daisy-chained shift registers, up to 256. Defaults to ``1``. + + +Pin configuration +----------------- + +.. code-block:: yaml + # Individual outputs switch: - platform: gpio @@ -90,17 +98,6 @@ Over SPI number: 0 inverted: false -Configuration variables: -************************ - -- **id** (**Required**, :ref:`config-id`): The id to use for this SN74HC595 component. -- **latch_pin** (**Required**, :ref:`Pin Schema `): Pin connected to SN74HC595 RCLK (ST_CP) pin -- **oe_pin** (*Optional*, :ref:`Pin Schema `): Pin connected to SN74HC595 OE pin -- **sr_count** (*Optional*, int): Number of daisy-chained shift registers, up to 256. Defaults to ``1``. - - -Pin configuration variables: -**************************** - **sn74hc595** (**Required**, :ref:`config-id`): The id of the SN74HC595 component of the pin. - **number** (**Required**, int): The pin number.