{"id":16089616,"url":"https://github.com/lesamouraipourpre/community_circuitpython_tca9555","last_synced_at":"2025-04-05T16:26:37.319Z","repository":{"id":48970787,"uuid":"362808788","full_name":"lesamouraipourpre/Community_CircuitPython_TCA9555","owner":"lesamouraipourpre","description":"Library for TCA9555 Low-Voltage 16-Bit I2C and SMBus I/O Expander on CircuitPython.","archived":false,"fork":false,"pushed_at":"2021-07-02T22:05:01.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T07:57:23.747Z","etag":null,"topics":["circuitpython","circuitpython-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesamouraipourpre.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-29T12:25:17.000Z","updated_at":"2021-07-02T22:00:50.000Z","dependencies_parsed_at":"2022-08-30T12:30:26.011Z","dependency_job_id":null,"html_url":"https://github.com/lesamouraipourpre/Community_CircuitPython_TCA9555","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesamouraipourpre%2FCommunity_CircuitPython_TCA9555","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesamouraipourpre%2FCommunity_CircuitPython_TCA9555/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesamouraipourpre%2FCommunity_CircuitPython_TCA9555/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesamouraipourpre%2FCommunity_CircuitPython_TCA9555/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesamouraipourpre","download_url":"https://codeload.github.com/lesamouraipourpre/Community_CircuitPython_TCA9555/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247363891,"owners_count":20927026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuitpython","circuitpython-library"],"created_at":"2024-10-09T14:04:55.406Z","updated_at":"2025-04-05T16:26:37.294Z","avatar_url":"https://github.com/lesamouraipourpre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\n.. image:: https://readthedocs.org/projects/community-circuitpython-tca9555/badge/?version=latest\n    :target: https://community-circuitpython-tca9555.readthedocs.io/\n    :alt: Documentation Status\n\n\n.. image:: https://img.shields.io/discord/327254708534116352.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/lesamouraipourpre/Community_CircuitPython_TCA9555/workflows/Build%20CI/badge.svg\n    :target: https://github.com/lesamouraipourpre/Community_CircuitPython_TCA9555/actions\n    :alt: Build Status\n\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\n\nCircuitPython library for Texas Instruments TCA9555 Low-Voltage 16-Bit I2C\nand SMBus I/O Expander with Input / Output and Polarity Inversion.\n\n`DataSheet \u003chttps://www.ti.com/lit/ds/symlink/tca9555.pdf\u003e`_\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython \u003chttps://github.com/adafruit/circuitpython\u003e`_\n* `Bus Device \u003chttps://github.com/adafruit/Adafruit_CircuitPython_BusDevice\u003e`_\n* `Register \u003chttps://github.com/adafruit/Adafruit_CircuitPython_Register\u003e`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle \u003chttps://circuitpython.org/libraries\u003e`_\nor individual libraries can be installed using\n`circup \u003chttps://github.com/adafruit/circup\u003e`_.\n\nInstalling from PyPI\n=====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI \u003chttps://pypi.org/project/community-circuitpython-tca9555/\u003e`_.\nTo install for current user:\n\n.. code-block:: shell\n\n    pip3 install community-circuitpython-tca9555\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install community-circuitpython-tca9555\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name \u0026\u0026 cd project-name\n    python3 -m venv .env\n    source .env/bin/activate\n    pip3 install community-circuitpython-tca9555\n\nUsage Example\n=============\n\nCreate an instance of TCA9555 expander. This defaults to all 16 pins set as\ninputs with no polarity conversion.\n\n.. code-block:: python\n\n    from community_tca9555 import TCA9555\n    # If the board has I2C defined\n    expander = TCA9555(board.I2C())  # Use default address of 0x20\n    # Else specify the specific pins\n    expander = TCA9555(busio.I2C(scl=board.GP5, sda=board.GP4))  # for the RP Pico\n\nSet the low 8 bits as inputs and the high 8 bits as outputs.\n\n.. code-block:: python\n\n    # set all 16 pins at once\n    expander.configuration_ports = 0x00FF\n\n    # or\n    # set port 0 (8bits) and port 1 (8 bits)\n    expander.configuration_port_0 = 0xFF  # Inputs\n    expander.configuration_port_1 = 0x00  # Outputs\n\n    # or\n    # set each pin individually\n    expander.configuration_port_0_pin_0 = True   # Input\n    # ...\n    expander.configuration_port_1_pin_7 = False  # Output\n\nSet pins 6 and 7 of both port 0 and port 1 as polarity inverted.\n\n.. code-block:: python\n\n    # Set polarity inversion state for individual pins.\n    expander.polarity_inversion_port_0_pin_6 = True  # Inverted\n    expander.polarity_inversion_port_0_pin_7 = True\n    expander.polarity_inversion_port_1_pin_6 = True\n    expander.polarity_inversion_port_1_pin_7 = True\n\n    # or\n    # Set an 8bit port at once\n    expander.polarity_inversion_port_0 = 0xC0  # Just bits 6 and 7\n\n    # or\n    # Set all 16bits at once\n    expander.polarity_inversions = 0xC0C0\n\nRead the input pins.\n\n.. code-block:: python\n\n    input_state = expander.input_port_0\n    print(\"Inputs: {:08b}\".format(input_state))\n\nSet the state of the output pins.\n\n.. code-block:: python\n\n    expander.output_port_1 = 0x42\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/lesamouraipourpre/Community_CircuitPython_TCA9555/blob/HEAD/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n\nDocumentation\n=============\n\nFor information on building library documentation, please check out\n`this guide \u003chttps://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesamouraipourpre%2Fcommunity_circuitpython_tca9555","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesamouraipourpre%2Fcommunity_circuitpython_tca9555","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesamouraipourpre%2Fcommunity_circuitpython_tca9555/lists"}