{"id":24688355,"url":"https://github.com/raspberrypi/rp2040-expander","last_synced_at":"2025-04-14T13:42:34.644Z","repository":{"id":274153977,"uuid":"640872417","full_name":"raspberrypi/rp2040-expander","owner":"raspberrypi","description":"Library to turn an RP2040 device into a GPIO-expander (plus much much more!)","archived":false,"fork":false,"pushed_at":"2023-06-15T15:05:30.000Z","size":468,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-06T20:14:17.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raspberrypi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-15T09:57:43.000Z","updated_at":"2025-03-13T18:43:03.000Z","dependencies_parsed_at":"2025-01-25T09:27:59.224Z","dependency_job_id":"be7680d7-a5ed-4eb2-a9d1-2d3ecc6970d9","html_url":"https://github.com/raspberrypi/rp2040-expander","commit_stats":null,"previous_names":["raspberrypi/rp2040-expander"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2Frp2040-expander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2Frp2040-expander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2Frp2040-expander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2Frp2040-expander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspberrypi","download_url":"https://codeload.github.com/raspberrypi/rp2040-expander/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890072,"owners_count":21178359,"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":[],"created_at":"2025-01-26T17:16:50.747Z","updated_at":"2025-04-14T13:42:34.597Z","avatar_url":"https://github.com/raspberrypi.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# rp2040-expander\n\nThis repo contains the source code for the RP2040 based port-expander known as\n'rp2040-expander'.  Some demonstration modules, which make use of the\nrp2040-expander's API, are also included in this repo.\n\n## Introduction\n\nrp2040-expander is a minimal software environment which utilizes a Raspberry\nPi RP2040 microcontroller as a port-expander peripheral for a host processor.\n\nThe RP2040 has no attached SPI Flash, may not execute any software and is\nunlikely to require a quartz crystal (subject to the intended use, please\nsee: LINK whitepaper here).\n\nThe rp2040-expander is controlled by the host using the RP2040's 'Serial Wire\nDebug' interface over which 'Debug Access Port' transactions are used to\ncontrol the internal RP2040 peripherals _or_ to download a program to RP2040 RAM.\nPlease see the LINK whitepaper here for RAM downloaded program details.\n\n## Contents\n\nGeneric source code is supplied in the `/host` directory to provide the necessary\nSWD, DAP and higher level control primitives and to provide the functional API to\nthe host system.\n\nThe `/port_xxx` directories contain host specific code that provide per-platform\nsupport, i.e. GPIO manipulations to implement the host side SWD interface.\n\nThe `/demo` directory contains the modules used to exercise some of the\nrp2040-expander's API.\n\n## SWD interface\n\nThe SWD interface is 'bit-bashed' and requires a few supporting functions to\nperform the GPIO manipulations required to provide the transfers over SWD.\n\nA port of this software requires that the user provide these functions for\ntheir intended host platform.\n\nTwo programmable GPIOs are required on the host, one is used only as an output\nfrom the host, and drives the SWCLK signal, the other GPIO must be bidirectional\nand is used for the SWDIO signal.\n\n## DAP interface\n\nThe Debug Access Ports within the RP2040 provide access to internal debug\nresources and using them it is possible read and write to the RP2040's\nmemory and internal registers such as GPIO control registers.\n\nIn this application only a small subset of the RP2040 DAP functionality is\nrequired and the code contained here supports that subset and no more.\n\n## Host platforms supported\n\nSupport for _two_ Host platforms are provided within this repo:\n\n- An RP2040 hosted demo; that is running the demo software on an RP2040 which\n  in turn controls a second RP2040 which performs the expander function.\n\nAny available GPIO ports can be used on the host RP2040, the source here uses\nGPIO2 and GPIO3.\n\nYou can connect any suitable RP2040 boards, most obviously two Pico boards.\n(INSERT interconnect diagram here)\n\n- A Raspberry Pi computer hosted demo; that is running the demo on a Pi computer\n  (e.g. Pi 3, Pi 4 ) controlling an RP2040 which performs the expander function.\n\n Any available GPIO ports can be used; the source here uses GPIO17 and GPIO27.\n(INSERT interconnect diagram here)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi%2Frp2040-expander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspberrypi%2Frp2040-expander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi%2Frp2040-expander/lists"}