:description:Instructions for setting up MCP23S08, MCP23S16 or MCP23S17 digital port expander in ESPHome. This is exactly the same API as the MCP23SXX I/O Expander except talks on the SPI bus
:image:mcp23Sxx.png
The Microchip MCP23Sxx series of general purpose, parallel I/O expansion for SPI bus applications.
This is exactly the same API as the MCP23SXX I/O Expander except talks on the SPI bus
The MCP23S08 component (`datasheet <http://ww1.microchip.com/downloads/en/DeviceDoc/MCP23008-MCP23S08-Data-Sheet-20001919F.pdf>`__,
`Digi-Key <https://www.digikey.com/product-detail/en/microchip-technology/MCP23S08-E-P/MCP23S08-E-P-ND/735954>`__) has 8 GPIOs that can be configured independently.
..code-block:: yaml
# Example configuration entry
mcp23s08:
- id: 'mcp23s08_hub'
cs_pin: D8
deviceaddress: 0
# Individual outputs
switch:
- platform: gpio
name: "MCP23S08 Pin #0"
pin:
mcp23s08_id: mcp23s08_hub
# Use pin number 0
number: 0
# One of INPUT, INPUT_PULLUP or OUTPUT
mode: OUTPUT
inverted: False
# Individual inputs
binary_sensor:
- platform: gpio
name: "MCP23S08 Pin #1"
pin:
mcp23s08_id: mcp23s08_hub
# Use pin number 1
number: 1
# One of INPUT or INPUT_PULLUP
mode: INPUT
inverted: False
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
-**id** (**Required**, :ref:`config-id`): The id to use for this MCP23S08 component.