{"id":13423308,"url":"https://github.com/rubberduck203/switch-hal","last_synced_at":"2025-05-05T23:23:19.516Z","repository":{"id":57669115,"uuid":"237965448","full_name":"rubberduck203/switch-hal","owner":"rubberduck203","description":"Rust no_std embedded-hal driver and traits for Input/Output switches (leds, transistors, buttons, switches)","archived":false,"fork":false,"pushed_at":"2024-04-17T14:27:15.000Z","size":44,"stargazers_count":30,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T00:41:18.342Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubberduck203.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2020-02-03T12:58:09.000Z","updated_at":"2025-03-24T04:59:14.000Z","dependencies_parsed_at":"2024-10-27T01:11:57.515Z","dependency_job_id":null,"html_url":"https://github.com/rubberduck203/switch-hal","commit_stats":{"total_commits":48,"total_committers":4,"mean_commits":12.0,"dds":"0.10416666666666663","last_synced_commit":"932667fa179ede643d3aaac878a7b2bb4fd6f09e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Fswitch-hal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Fswitch-hal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Fswitch-hal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Fswitch-hal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubberduck203","download_url":"https://codeload.github.com/rubberduck203/switch-hal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252591302,"owners_count":21773065,"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:29.204Z","updated_at":"2025-05-05T23:23:19.499Z","avatar_url":"https://github.com/rubberduck203.png","language":"Rust","funding_links":[],"categories":["Component abstraction crates"],"sub_categories":["Other"],"readme":"# switch-hal\n\n![Rust](https://github.com/rubberduck203/switch-hal/workflows/Rust/badge.svg)\n[![crates.io](https://img.shields.io/crates/d/switch-hal.svg)](https://crates.io/crates/switch-hal)\n[![crates.io](https://img.shields.io/crates/v/switch-hal.svg)](https://crates.io/crates/switch-hal)\n[![docs.rs](https://docs.rs/switch-hal/badge.svg)](https://docs.rs/switch-hal)\n\nSwitch-HAL is a `no_std` embedded Rust library for working with buttons, switches, LEDs, and transistors.\nBasically, anything that acts like a switch, whether an input or output.\n\nIt is both a driver that uses the `embedded-hal::digital` traits and is an abstraction in it's own right.\nIt provides a simple, zero-cost, abstraction to clarify the _intent_ of your application code.\n\n## Why Switch-HAL? Why not just use raw GPIO?\n\nDid you mean to drive that line high?  \nOr did you mean to _turn that LED off_?  \nWait a second... is that LED active _high_?  \nWhere's the schematic?  \nOkay... cathode is wired to the input line... that means it's active low.\n\nNow repeat this every place in your code where you need to turn that LED on or off.  \nWhat happens when the hardware changes?  \nUsing the raw GPIO to set pins high and low will have you making changes all over your code base.\n\nWouldn't it be nicer if you only had to think about that once, when you initialize your application,  \nand from then on out, simply called `led.on()` or `led.off()`.  \nHaving an abstraction at the proper level reduces cognitive load.  \nSpecifying whether a simple peripheral is active high or low in a single place in your application reduces the maintenance burden.\n\n## Documentation\n\nhttps://docs.rs/crate/switch-hal\n\nor build a local copy\n\n```sh\ncargo docs\n```\n\nand open `target/doc/switch_hal/index.html` in your browser.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](./LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](./LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Architectural Decision Records\n\nMajor design decisions are tracked in the [adr](./adr) directory.\n\n## Changelog\n\n### 0.4.0\n\nAdds `StatefulOutputSwitch` thanks to [forkbomb9](https://github.com/forkbomb9)\n\n### 0.3.3\n\nUpdate embedded-hal to 0.2.5\n\n### 0.3.2\n\n- Add convenience converter functions `into_active_low_switch()` and `into_active_high_switch()`\n\n### 0.3.1\n\n- Bug Fix: `is_active()` was returning the wrong result for `Switch\u003cInputPin, ActiveLow\u003e`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubberduck203%2Fswitch-hal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubberduck203%2Fswitch-hal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubberduck203%2Fswitch-hal/lists"}