{"id":13423258,"url":"https://github.com/Rahix/avr-device","last_synced_at":"2025-03-15T15:30:52.587Z","repository":{"id":38419099,"uuid":"186051104","full_name":"Rahix/avr-device","owner":"Rahix","description":"Register access crate for AVR microcontrollers","archived":false,"fork":false,"pushed_at":"2025-01-07T14:04:33.000Z","size":703,"stargazers_count":193,"open_issues_count":21,"forks_count":74,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-08T17:56:50.467Z","etag":null,"topics":["avr","avr-microcontrollers","rust-embedded","svd2rust"],"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}},"created_at":"2019-05-10T20:34:37.000Z","updated_at":"2025-03-04T17:35:53.000Z","dependencies_parsed_at":"2023-11-14T16:28:46.506Z","dependency_job_id":"aa99572f-67cf-4c11-9037-0382cca4dca6","html_url":"https://github.com/Rahix/avr-device","commit_stats":{"total_commits":283,"total_committers":49,"mean_commits":5.775510204081633,"dds":0.3639575971731449,"last_synced_commit":"2a46a0cc32d38cd98a2c4fc27bc838e8cf94e0db"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-device","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-device/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-device/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Favr-device/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahix","download_url":"https://codeload.github.com/Rahix/avr-device/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243750473,"owners_count":20342066,"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":["avr","avr-microcontrollers","rust-embedded","svd2rust"],"created_at":"2024-07-31T00:00:26.370Z","updated_at":"2025-03-15T15:30:52.574Z","avatar_url":"https://github.com/Rahix.png","language":"Rust","funding_links":[],"categories":["Peripheral Access Crates"],"sub_categories":["Microchip"],"readme":"avr-device [![crates.io page](https://img.shields.io/crates/v/avr-device.svg)](https://crates.io/crates/avr-device) [![docs.rs](https://docs.rs/avr-device/badge.svg)](https://docs.rs/avr-device) ![Continuous Integration](https://github.com/Rahix/avr-device/workflows/Continuous%20Integration/badge.svg)\n==========\nAuto-generated wrappers around registers for AVR microcontrollers.\n\n## Usage\nAdd the following to `Cargo.toml`:\n```toml\n[dependencies.avr-device]\nversion = \"0.7.0\"\nfeatures = [\"atmega32u4\"]\n```\n\nVia the feature you can select which chip you want the register specifications for.  The following list is what is currently supported:\n\n|     ATmega      |  ATmega USB  | ATmega 0,1 Series |     AT90      |    ATtiny     |\n| :-------------: | :----------: | :---------------: | :-----------: | :-----------: |\n|    `atmega8`    | `atmega8u2`  |   `atmega3208`    | `at90usb1286` |  `attiny13a`  |\n|   `atmega48p`   | `atmega16u2` |   `atmega3209`    |               |  `attiny167`  |\n|   `atmega64`    | `atmega32u2` |   `atmega4808`    |               |  `attiny202`  |\n|   `atmega644`   | `atmega32u4` |   `atmega4809`    |               |  `attiny212`  |\n|   `atmega88p`   | `avr64du32`  |                   |               |  `attiny214`  |\n|   `atmega16`    | `avr64du28`  |                   |               |  `attiny402`  |\n|   `atmega168`   |              |                   |               |  `attiny404`  |\n|  `atmega324pa`  |              |                   |               |  `attiny412`  |\n|  `atmega328p`   |              |                   |               |  `attiny414`  |\n|  `atmega328pb`  |              |                   |               |  `attiny416`  |\n|   `atmega32a`   |              |                   |               |  `attiny44a`  |\n|  `atmega1280`   |              |                   |               |  `attiny84`   |\n|  `atmega1284p`  |              |                   |               |  `attiny85`   |\n|  `atmega128a`   |              |                   |               |  `attiny88`   |\n| `atmega128rfa1` |              |                   |               |  `attiny816`  |\n|  `atmega2560`   |              |                   |               |  `attiny828`  |\n|  `atmega164pa`  |              |                   |               |  `attiny841`  |\n|                 |              |                   |               |  `attiny84a`  |\n|                 |              |                   |               |  `attiny861`  |\n|                 |              |                   |               | `attiny1614`  |\n|                 |              |                   |               | `attiny2313`  |\n|                 |              |                   |               | `attiny2313a` |\n\n## Build Instructions\nThe version on `crates.io` is pre-built.  The following is only necessary when trying to build this crate from source.\n\nYou need to have [atdf2svd][] (= 0.5.0), [svd2rust][] (= 0.28), [form][] (\u003e= 0.8), [rustfmt][](for the *nightly* toolchain) and [svdtools][] (= 0.4.0) installed:\n```bash\ncargo install atdf2svd --version 0.5.0 --locked\ncargo install svd2rust --version 0.28.0 --locked\ncargo install form\nrustup component add --toolchain nightly rustfmt\ncargo install svdtools --version 0.4.0 --locked\n```\n\n[atdf2svd]: https://github.com/Rahix/atdf2svd\n[svd2rust]: https://github.com/rust-embedded/svd2rust\n[form]: https://github.com/djmcgill/form\n[rustfmt]: https://github.com/rust-lang/rustfmt\n[svdtools]: https://github.com/stm32-rs/svdtools\n\nNext, clone this repo and build the device definitions:\n```bash\ngit clone https://github.com/Rahix/avr-device\ncd avr-device\nmake\n# You can build for just one specific chip using\n# make atmega32u4\n# I suggest building documentation as well\ncargo +nightly doc --features \u003cchip\u003e --open\n```\n\n## Internals\n*avr-device* is generated using [`atdf2svd`](https://github.com/Rahix/atdf2svd) and [`svd2rust`](https://github.com/rust-embedded/svd2rust).  The vendor-provided *atdf* files can be found in `vendor/`.  The intermediate svd files are patched by `svdpatch.py` (Adapted from [`svdpatch.py`](https://github.com/stm32-rs/stm32-rs/blob/master/scripts/svdpatch.py) in [stm32-rs](https://github.com/stm32-rs/stm32-rs)) with device-dependent patches in `patch/`, mainly to improve undescriptive names and missing descriptions.\n\n### Adding a new Chip\nTo add a new chip, download the *atdf* from \u003chttp://packs.download.atmel.com/\u003e (or [avr-mcu/packs/](https://github.com/avr-rust/avr-mcu/tree/master/packs)) and place it in `vendor/` ***note: file name may need to be modified***.  Be sure to name it like the Rust module that should be generated.  Next, you need to integrate it into the base crate and build system.  Follow what was done in commit [290613454fbd (\"Add basic support for ATmega64\")](https://github.com/Rahix/avr-device/commit/290613454fbdc5e4ac98e53deccaf74dafc88963).  Please adhere to the alphabetical sorting that is present so far.\n\nNext, you **must** create a `\u003cchipname\u003e.yaml` in `patch/` which has at least the following content:\n```yaml\n_svd: ../svd/\u003cchipname\u003e.svd\n```\n\nIf more patches need to be applied (most likely!), they should be added into this file as well.  The patching format is documented in the [`svdtools` README](https://github.com/stm32-rs/svdtools#device-and-peripheral-yaml-format).  Ideally, try to reuse the exisiting patches in `patch/common/` or `patch/timer/`.\n\nFinally, try building the crate for your MCU with `make \u003cchipname\u003e`.\n\n## License\n*avr-device* 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\nThe vendored *atdf* files are licensed under the Apache License, Version 2.0 ([LICENSE-VENDOR](vendor/LICENSE)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRahix%2Favr-device","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRahix%2Favr-device","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRahix%2Favr-device/lists"}