{"id":9405846,"url":"https://github.com/idlab-discover/i2c-wasm-components","last_synced_at":"2026-02-02T21:01:25.072Z","repository":{"id":213237621,"uuid":"733394195","full_name":"idlab-discover/i2c-wasm-components","owner":"idlab-discover","description":"A proof of concept for using WebAssembly together with I2C","archived":false,"fork":false,"pushed_at":"2025-10-06T13:13:02.000Z","size":1210,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"root","last_synced_at":"2025-10-06T15:13:47.510Z","etag":null,"topics":["embedded","i2c","wasi","wasmtime","wit"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlab-discover.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-19T08:25:38.000Z","updated_at":"2025-10-06T13:13:07.000Z","dependencies_parsed_at":"2024-05-10T17:05:41.818Z","dependency_job_id":"f0fdfe24-6994-4def-8e8f-10dd32b65977","html_url":"https://github.com/idlab-discover/i2c-wasm-components","commit_stats":null,"previous_names":["zelzahn/i2c-wasm-components","idlab-discover/i2c-wasm-components"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/idlab-discover/i2c-wasm-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlab-discover%2Fi2c-wasm-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlab-discover%2Fi2c-wasm-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlab-discover%2Fi2c-wasm-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlab-discover%2Fi2c-wasm-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlab-discover","download_url":"https://codeload.github.com/idlab-discover/i2c-wasm-components/tar.gz/refs/heads/root","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlab-discover%2Fi2c-wasm-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29019539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["embedded","i2c","wasi","wasmtime","wit"],"created_at":"2024-05-10T17:01:42.605Z","updated_at":"2026-02-02T21:01:25.067Z","avatar_url":"https://github.com/idlab-discover.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# i2c-wasm-components\nThe purpose of this repository is to serve as a proof of concept of a potential WASI and I2C integration. \n\nCurrently, the setup is as follows: Raspberry Pi 4 Model B → I2C Interface → HD44780 LCD. It is my intention to switch out the Pi for a Pi Pico microcontroller, to have a proof of concept for a more constrained piece of hardware. I also have a Pi 3 Model B hooked up with a HTS221.\n\n## Embedded HAL\n\nThe [embedded-hal](https://crates.io/crates/embedded-hal) crate is the main inspiration for the design of the API. To embed a crate that uses this HAL as a guest component [wasi-embedded-hal](https://github.com/Zelzahn/wasi-embedded-hal) can be used.\n\n## Benchmarking\n\n### Execution Time\n\nFor this [criterion.rs](https://github.com/bheisler/criterion.rs) is used. Sadly, it isn't possible to use this in conjunction with a binary crate, thus the crate is split up into a library and a binary.\n\nBenchmarks can be found in the `benches/` directory inside the hosts and native implementations.\n\n#### Building\n\nThe executable is built via `cargo bench --no-run`. Afterwards it can be `scp`'ed and run using `./sensor_read-a3122c62d6d7e506 --bench`. The results are stored inside `target/criterion/sensor\\\\\\ read/report` and are then `scp`'ed back into `report/`.\n\n### Memory Usage\n\nThe used memory is collected via [dhat-rs](https://github.com/nnethercote/dhat-rs). This gives output of the following format after execution:\n```\ndhat: Total:     xxx bytes in y blocks\ndhat: At t-gmax: xxx bytes in y blocks\ndhat: At t-end:  xxx bytes in y blocks\n```\n\nTo build run `cargo build --target aarch64-unknown-linux-gnu --release --features dhat-heap`.\n\n# Funding information\n\nThis work has been partially supported by the ELASTIC project, which received funding from the Smart Networks and Services Joint Undertaking (SNS JU) under the European Union’s Horizon Europe research and innovation programme under Grant Agreement No 101139067. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union. Neither the European Union nor the granting authority can be held responsible for them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlab-discover%2Fi2c-wasm-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlab-discover%2Fi2c-wasm-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlab-discover%2Fi2c-wasm-components/lists"}