{"id":14962050,"url":"https://github.com/rahix/avr-hal","last_synced_at":"2025-05-13T19:04:07.732Z","repository":{"id":38712495,"uuid":"188675035","full_name":"Rahix/avr-hal","owner":"Rahix","description":"embedded-hal abstractions for AVR microcontrollers","archived":false,"fork":false,"pushed_at":"2025-05-09T20:45:40.000Z","size":5917,"stargazers_count":1422,"open_issues_count":123,"forks_count":239,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-05-13T13:06:43.002Z","etag":null,"topics":["arduino","avr","hal-crates","rust","rust-embedd"],"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/Rahix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2019-05-26T11:35:37.000Z","updated_at":"2025-05-12T17:01:12.000Z","dependencies_parsed_at":"2024-01-20T22:29:10.308Z","dependency_job_id":"e2955f61-7ab3-42a8-9a7d-aa0c60104756","html_url":"https://github.com/Rahix/avr-hal","commit_stats":{"total_commits":602,"total_committers":96,"mean_commits":6.270833333333333,"dds":0.3637873754152824,"last_synced_commit":"7e21ea0a468daee5cff9bed1c090a5e50e6879ff"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-hal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-hal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-hal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-hal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahix","download_url":"https://codeload.github.com/Rahix/avr-hal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010796,"owners_count":21998993,"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":["arduino","avr","hal-crates","rust","rust-embedd"],"created_at":"2024-09-24T13:28:54.619Z","updated_at":"2025-05-13T19:04:07.713Z","avatar_url":"https://github.com/Rahix.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"avr-hal ![Continuous Integration](https://github.com/Rahix/avr-hal/workflows/Continuous%20Integration/badge.svg) [![arduino-hal docs](https://img.shields.io/badge/docs-arduino--hal-4d76ae)][arduino-hal docs] [![atmega-hal docs](https://img.shields.io/badge/docs-atmega--hal-4d76ae)][atmega-hal docs] [![attiny-hal docs](https://img.shields.io/badge/docs-attiny--hal-4d76ae)][attiny-hal docs]\n=======\nHardware Abstraction Layer for AVR microcontrollers and common boards (for example Arduino).  Based on the [`avr-device`](https://github.com/Rahix/avr-device) crate.\n\n## Quickstart\nYou need a nightly Rust compiler for compiling Rust code for AVR.  The correct version will be installed automatically due to the `rust-toolchain.toml` file.\n\nInstall dependencies:\n\n- Ubuntu\n  ```bash\n  sudo apt install avr-libc gcc-avr pkg-config avrdude libudev-dev build-essential\n  ```\n- Macos  \n  ```bash\n  xcode-select --install # if you haven't already done so\n  brew tap osx-cross/avr\n  brew install avr-gcc avrdude\n  ```\n- Windows\n\n  Use [`winget`](https://learn.microsoft.com/en-us/windows/package-manager/winget/) on Windows 10 \u0026 Windows 11:\n  ```\n  winget install AVRDudes.AVRDUDE ZakKemble.avr-gcc\n  ```\n  On older systems you can use [Scoop](https://scoop.sh/) which you first have to install using Powershell:\n  ```PowerShell\n  Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Needed to run a remote script the first time\n  irm get.scoop.sh | iex\n  ```\n  Install avr-gcc and avrdude\n  ```\n  scoop install avr-gcc\n  scoop install avrdude\n  ```\n  See [Setting up environment](https://github.com/Rahix/avr-hal/wiki/Setting-up-environment) for more information.\n  \nNext, install [\"ravedude\"](./ravedude), a tool which seamlessly integrates flashing your board into the usual cargo workflow:\n\n```bash\ncargo +stable install ravedude\n```\n\nGo into `./examples/arduino-uno` (or the directory for whatever board you want), and run the following commands:\n\n```bash\ncd examples/arduino-uno\n\n# Build and run it on a connected board\ncargo run --bin uno-blink\n```\n\n## Starting your own project\nThe best way to start your own project is via the [`avr-hal-template`](https://github.com/Rahix/avr-hal-template) which you can easily use with [`cargo-generate`](https://github.com/cargo-generate/cargo-generate):\n\n```bash\ncargo install cargo-generate\ncargo generate --git https://github.com/Rahix/avr-hal-template.git\n```\n\n## Repository Structure\nThe `avr-hal` repository is a workspace containing all components making up the HAL.  Here is an overview:\n\n### `arduino-hal` [![arduino-hal docs](https://img.shields.io/badge/docs-git-4d76ae)][arduino-hal docs]\n`arduino-hal` is the batteries-included HAL for all Arduino \u0026 similar boards.  This is what you probably want to use for your projects.  It is intentionally built to abstract away the differences between boards as much as possible.\n\n### `examples/*`\nThe [examples directory](./examples) contains lots of examples for common hardware.  Do note that not all examples were ported to all boards, but there is a good chance that you can still use the code.  Currently, the [Arduino Uno](./examples/arduino-uno/) crate contains the most examples.\n\n### `mcu/atmega-hal` [![atmega-hal docs](https://img.shields.io/badge/docs-git-4d76ae)][atmega-hal docs] , `mcu/attiny-hal` [![attiny-hal docs](https://img.shields.io/badge/docs-git-4d76ae)][attiny-hal docs]\nHAL crates for AVR microcontroller families.  If you have a custom board, you'll want to work with these crates.  Please check their documentation for a list of supported MCUs.\n\n### `avr-hal-generic` [![avr-hal-generic docs](https://img.shields.io/badge/docs-git-4d76ae)][avr-hal-generic docs]\nThis is a generic crate containing most of the HAL implementations in the form of macros which are instanciated in each HAL crate for the specific MCUs.  If you intend to write drivers that work with any AVR chip, targeting `avr-hal-generic` is probably the best route.\n\n### [`ravedude`](./ravedude) [![crates.io page](https://img.shields.io/crates/v/ravedude.svg)](https://crates.io/crates/ravedude)\n`ravedude` is a utility for seamlessly integrating avrdude and a serial console into the cargo workflow.  With a bit of configuration (check its [README](./ravedude/README.md)!) you can then upload your code to your board and view its output over the serial console by just using `cargo run` as you would normally.\n\n[avr-hal-generic docs]: https://rahix.github.io/avr-hal/avr_hal_generic/index.html\n[arduino-hal docs]: https://rahix.github.io/avr-hal/arduino_hal/index.html\n[atmega-hal docs]: https://rahix.github.io/avr-hal/atmega_hal/index.html\n[attiny-hal docs]: https://rahix.github.io/avr-hal/attiny_hal/index.html\n\n## Disclaimer\nThis project is not affiliated with either Microchip (former Atmel) nor any of the Vendors that created the boards supported in this repository.\n\n## License\n*avr-hal* is licensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or 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## Contribution\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahix%2Favr-hal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahix%2Favr-hal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahix%2Favr-hal/lists"}