{"id":13423249,"url":"https://github.com/ryankurte/embedded-hal-compat","last_synced_at":"2025-07-12T13:35:08.567Z","repository":{"id":45537071,"uuid":"340845407","full_name":"ryankurte/embedded-hal-compat","owner":"ryankurte","description":"Rust embedded-hal inter-version compatibility layer","archived":false,"fork":false,"pushed_at":"2025-04-13T23:06:12.000Z","size":77,"stargazers_count":16,"open_issues_count":3,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-03T04:34:07.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/ryankurte.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","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}},"created_at":"2021-02-21T07:40:21.000Z","updated_at":"2025-04-23T14:45:34.000Z","dependencies_parsed_at":"2024-04-20T00:27:42.290Z","dependency_job_id":"58a5ddf4-68f1-4268-94d6-bc2634d455cb","html_url":"https://github.com/ryankurte/embedded-hal-compat","commit_stats":{"total_commits":34,"total_committers":6,"mean_commits":5.666666666666667,"dds":0.2941176470588235,"last_synced_commit":"956f281b3e1b98b3bb98073fc11d146c9663bbcf"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/ryankurte/embedded-hal-compat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryankurte%2Fembedded-hal-compat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryankurte%2Fembedded-hal-compat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryankurte%2Fembedded-hal-compat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryankurte%2Fembedded-hal-compat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryankurte","download_url":"https://codeload.github.com/ryankurte/embedded-hal-compat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryankurte%2Fembedded-hal-compat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265002557,"owners_count":23696076,"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":"2024-07-31T00:00:26.065Z","updated_at":"2025-07-12T13:35:08.523Z","avatar_url":"https://github.com/ryankurte.png","language":"Rust","funding_links":[],"categories":["Tools"],"sub_categories":["Paid and commercially available materials","Community Chat Rooms"],"readme":"# Embedded HAL Compatibility Layer\n\nA compatibility layer to smooth the transition between different versions of [embedded-hal](https://github.com/rust-embedded/embedded-hal) (specifically `0.2.x` and `1.0.0-alpha.X` series).\n\nThis resolves the problem where a HAL implementation (ie. the implementation for your processor) and driver you intend to use are mismatched.\n\nThis crate is intended to track `1.0.0-alpha` versions, and update to `1.0.0` on release, adaptation is not provided between `1.0.0-alpha.x` releases (though we _could_ do this if it was deemed worthwhile)\n\n### Supported Versions\n\nEach release of `embedded-hal-compat` supports one(ish) pair of e-h releases, because of changes to the `1.0.0-alpha`, use:\n\n- `embedded-hal-compat = \"0.13.0\"` for `=1.0.0` and `^0.2.7`\n- `embedded-hal-compat = \"0.12.0\"` for `=1.0.0-rc.1` and `^0.2.7`\n- `embedded-hal-compat = \"0.11.0\"` for `=1.0.0-alpha.11` and `^0.2.7`\n- `embedded-hal-compat = \"0.10.0\"` for `=1.0.0-alpha.10` and `^0.2.7`\n- `embedded-hal-compat = \"0.7.0\"` for `=1.0.0-alpha.8` and `^0.2.4`\n- `embedded-hal-compat = \"0.6.0\"` for `=1.0.0-alpha.7` and `^0.2.4`\n- `embedded-hal-compat = \"0.5.0\"` for `=1.0.0-alpha.6` and `^0.2.4`\n- `embedded-hal-compat = \"0.4.0\"` for `=1.0.0-alpha.5` and `^0.2.4`\n- `embedded-hal-compat = \"0.3.0\"` for `=1.0.0-alpha.4` and `^0.2.4`\n\n\n## Status\n\n[![GitHub tag](https://img.shields.io/github/tag/ryankurte/embedded-hal-compat.svg)](https://github.com/ryankurte/embedded-hal-compat)\n[![Build Status](https://github.com/ryankurte/embedded-hal-compat/actions/workflows/rust.yml/badge.svg)](https://github.com/ryankurte/embedded-hal-compat/actions/workflows/rust.yml)\n[![Crates.io](https://img.shields.io/crates/v/embedded-hal-compat.svg)](https://crates.io/crates/embedded-hal-compat)\n[![Docs.rs](https://docs.rs/embedded-hal-compat/badge.svg)](https://docs.rs/embedded-hal-compat)\n![Minimum Supported Rust Version](https://img.shields.io/badge/rustc-1.73+-blue.svg)\n\nNot all wrappers are fully implemented, feel free to open a PR if you come across something missing!\n\n\n#### How to use this:\n\n- Add `embedded-hal-compat` to your dependencies\n- Import with `use embedded_hal_compat::{ForwardCompat, ReverseCompat};`\n- Vicariously add `.forward()` or `.reverse()` on any `embedded-hal` type mismatches\n- See [docs.rs](https://docs.rs/embedded-hal-compat/latest/embedded_hal_compat/) for further documentation\n\n#### How do I know that I need this?\n\nType errors. Lots of type errors.\n\n(and `cargo tree -i embedded-hal` returns two versions)\n\n\n#### Is this cursed?!\n\nAt least a little bit, because traits have the same method names you might end up with some cursed errors, and we have to pave over some differences around errors and error kinds...\n\n\n#### What kind of errors?\n\nBecause you're likely to have symbols with the same name you'll end up with errors like:\n\n```\nerror[E0599]: no method named `delay_ms` found for mutable reference `\u0026mut Compat\u003catsamd_hal::delay::Delay\u003e` in the current scope\n   --\u003e src/main.rs:351:27\n    |\n351 |         tlv.inner_delay().delay_ms(10u32);\n    |                           ^^^^^^^^ method not found in `\u0026mut Compat\u003catsamd_hal::delay::Delay\u003e`\n\nwarning: unused import: `embedded_hal::blocking::delay::DelayMs`\n  --\u003e src/main.rs:22:5\n   |\n22 | use embedded_hal::blocking::delay::DelayMs;\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n```\n\nSuggesting you're missing an import that's obviously there, because you have the `0.2.x` imports not the `1.0.0-alpha.x` imports, and the method is called `try_delay_ms` in the updated HAL (a fairly common renaming).\n\nYou can fix this by importing the correct trait with something like: `use embedded_hal_compat::eh1_0::blocking::delay::{DelayMs as _};` (this must be renamed with `as` / you can't use the prelude because the names overlap), and by swapping the method to use the correct `try_` name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryankurte%2Fembedded-hal-compat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryankurte%2Fembedded-hal-compat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryankurte%2Fembedded-hal-compat/lists"}