{"id":13472664,"url":"https://github.com/WebAssembly/wasi-i2c","last_synced_at":"2025-03-26T17:30:59.835Z","repository":{"id":229190753,"uuid":"622016958","full_name":"WebAssembly/wasi-i2c","owner":"WebAssembly","description":"I2C API for WASI","archived":false,"fork":false,"pushed_at":"2024-10-17T09:11:21.000Z","size":30,"stargazers_count":20,"open_issues_count":4,"forks_count":6,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-22T06:41:50.749Z","etag":null,"topics":["proposal","wasi"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebAssembly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-03-31T22:38:38.000Z","updated_at":"2025-02-09T20:54:37.000Z","dependencies_parsed_at":"2024-10-19T09:22:06.999Z","dependency_job_id":null,"html_url":"https://github.com/WebAssembly/wasi-i2c","commit_stats":null,"previous_names":["webassembly/wasi-i2c"],"tags_count":0,"template":false,"template_full_name":"WebAssembly/wasi-proposal-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-i2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-i2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-i2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-i2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebAssembly","download_url":"https://codeload.github.com/WebAssembly/wasi-i2c/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245702171,"owners_count":20658558,"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":["proposal","wasi"],"created_at":"2024-07-31T16:00:56.894Z","updated_at":"2025-03-26T17:30:59.443Z","avatar_url":"https://github.com/WebAssembly.png","language":"Rust","readme":"# WASI I2C\n\nA proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) API.\n\n### Current Phase\n\nwasi-i2c is currently in [Phase 2](https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-2---proposed-spec-text-available-cg--wg)\n\n### Champions\n\n- Friedrich Vandenberghe\n- Merlijn Sebrechts\n- Maximilian Seidler\n\n### Portability Criteria\n\nWASI-I2C must have an implementation for at least the following platforms:\n\n| Platform                  | Architecture  | Reference Hardware     |\n| ------------------------- | ------------- | ---------------------- |\n| Linux                     | ARM           | Raspberry Pi 3 Model B |\n| RTOS (NuttX or Zephyr)    | RISC-V        | ESP32-C3               |\n| RTOS (Zephyr or FreeRTOS) | ARM32         | Nucleo F412ZG          |\n\nFurthermore, the interface should be designed in such a way to use as little memory as reasonably possible, to ensure enough RAM on these boards is still available for the applications.\n\n### Introduction\n\nThe WASI-I2C proposal defines an API for the I2C protocol. The API of [embedded_hal](https://github.com/rust-embedded/embedded-hal) is closely followed.\n\nReference implementations can be found in [i2c-wasm-components](https://github.com/Zelzahn/i2c-wasm-components). Furthermore, there is also a [wasi-embedded-hal](https://crates.io/crates/wasi-embedded-hal) crate that implements the `embedded-hal` traits for the generated bindings.\n\n### Goals\n\nThe primary goal is to provide an interface that WASI programs can use to read and write data over an I2C connection.\n\n### Non-goals\n\nAlthough I2C is in some aspects not that different from SPI, the purpose of this proposal is to solely focus on I2C.\n\n### API walk-through\n\nThe full API documentation can be found [here](wasi-proposal-template.md).\n\n[Walk through of how someone would use this API.]\n\n#### [Use case 1]\n\n[Provide example code snippets and diagrams explaining how the API would be used to solve the given problem]\n\n#### [Use case 2]\n\n[etc.]\n\n### Detailed design discussion\n\n#### Should this be combined with SPI, GPIO and PWM into 1 embedded proposal?\n\nAlthough `embedded_hal` takes this approach, I would keep them separated for now. At least until each proposal is at least in Phase 2.\n\n#### Why are there no constructors for the i2c interface? How does one obtain an i2c handle?\n\nI2c resources will be constructed in many different ways on different devices, so worlds that include the i2c interface should also include a way to obtain i2c handles. Typically this will either be by having i2c handles passed into exported functions as parameters, or by having i2c handles returned from imported functions.\n\n### Stakeholder Interest \u0026 Feedback\n\nTODO before entering Phase 3.\n\n### References \u0026 acknowledgements\n\nMany thanks for valuable feedback and advice from:\n\n- Merlijn Sebrechts\n- Dan Gohman for the `hello-embedded` repository\n- Everyone else in SIG Embedded\n","funding_links":[],"categories":["Rust","Components"],"sub_categories":["Interfaces"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebAssembly%2Fwasi-i2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWebAssembly%2Fwasi-i2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebAssembly%2Fwasi-i2c/lists"}