{"id":13423257,"url":"https://github.com/atsamd-rs/atsamd","last_synced_at":"2026-03-04T02:11:40.940Z","repository":{"id":38094096,"uuid":"125536984","full_name":"atsamd-rs/atsamd","owner":"atsamd-rs","description":"Target atsamd microcontrollers using Rust","archived":false,"fork":false,"pushed_at":"2025-05-07T17:16:23.000Z","size":101963,"stargazers_count":606,"open_issues_count":70,"forks_count":211,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-07T17:16:26.118Z","etag":null,"topics":["atmel","embedded","embedded-hal","microchip","rust","samd11","samd21","samd51","same54"],"latest_commit_sha":null,"homepage":"https://matrix.to/#/#atsamd-rs:matrix.org","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/atsamd-rs.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,"zenodo":null}},"created_at":"2018-03-16T15:42:43.000Z","updated_at":"2025-05-07T17:12:29.000Z","dependencies_parsed_at":"2023-10-02T02:38:05.425Z","dependency_job_id":"ab8bd9ca-02fe-4bd9-b774-c214a6f93748","html_url":"https://github.com/atsamd-rs/atsamd","commit_stats":{"total_commits":776,"total_committers":116,"mean_commits":6.689655172413793,"dds":0.8105670103092784,"last_synced_commit":"cbbd4f0ebe8be2be6a6c314de7c2bcc32a1cf5a4"},"previous_names":[],"tags_count":182,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsamd-rs%2Fatsamd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsamd-rs%2Fatsamd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsamd-rs%2Fatsamd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsamd-rs%2Fatsamd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atsamd-rs","download_url":"https://codeload.github.com/atsamd-rs/atsamd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036807,"owners_count":22003651,"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":["atmel","embedded","embedded-hal","microchip","rust","samd11","samd21","samd51","same54"],"created_at":"2024-07-31T00:00:26.291Z","updated_at":"2025-12-30T02:28:12.195Z","avatar_url":"https://github.com/atsamd-rs.png","language":"Rust","readme":"# atsamd \u0026 atsame support for Rust\n\nThis repository holds various crates that support/enable working with Microchip (nee Atmel) `samd11`, `samd21`, `samd51` and `same5x` based devices using Rust.\n\n![CI Build](https://github.com/atsamd-rs/atsamd/workflows/Build%20BSPs/badge.svg)\n\n![CI Build](https://github.com/atsamd-rs/atsamd/workflows/Build%20HAL/badge.svg)\n\n## HAL - Hardware Abstraction Layer\n\nThe Hardware Abstraction Layer (HAL - [![Crates.io](https://img.shields.io/crates/v/atsamd_hal.svg)](https://crates.io/crates/atsamd_hal)) crate encodes a type-safe layer over the raw PACs. This crate implements traits specified by the [embedded-hal](https://github.com/rust-embedded/embedded-hal) project, making it compatible with various drivers in the embedded Rust ecosystem.  Cargo features are used to enable support for specific hardware variations and features.  Online documentation for commonly-used feature sets is provided:\n\n| Chip family | Documented features               |\n|:------------|:----------------------------------|\n| [samd11c]   | samd11c dma defmt async           |\n| [samd11d]   | samd11d dma defmt async           |\n| [samd21g]   | samd21g usb dma defmt async       |\n| [samd21j]   | samd21j usb dma defmt async       |\n| [samd51g]   | samd51g usb sdmmc dma defmt async |\n| [samd51j]   | samd51j usb sdmmc dma defmt async |\n| [samd51n]   | samd51n usb sdmmc dma defmt async |\n| [samd51p]   | samd51p usb sdmmc dma defmt async |\n\n[samd11c]: https://atsamd-rs.github.io/atsamd/samd11c/thumbv6m-none-eabi/doc/atsamd_hal/index.html\n[samd11d]: https://atsamd-rs.github.io/atsamd/samd11d/thumbv6m-none-eabi/doc/atsamd_hal/index.html\n[samd21g]: https://atsamd-rs.github.io/atsamd/samd21g/thumbv6m-none-eabi/doc/atsamd_hal/index.html\n[samd21j]: https://atsamd-rs.github.io/atsamd/samd21j/thumbv6m-none-eabi/doc/atsamd_hal/index.html\n[samd51g]: https://atsamd-rs.github.io/atsamd/samd51g/thumbv7em-none-eabihf/doc/atsamd_hal/index.html\n[samd51j]: https://atsamd-rs.github.io/atsamd/samd51j/thumbv7em-none-eabihf/doc/atsamd_hal/index.html\n[samd51n]: https://atsamd-rs.github.io/atsamd/samd51n/thumbv7em-none-eabihf/doc/atsamd_hal/index.html\n[samd51p]: https://atsamd-rs.github.io/atsamd/samd51p/thumbv7em-none-eabihf/doc/atsamd_hal/index.html\n\n## PAC and BSP - Peripheral Access Crate and Board Support Package\n\nThe Peripheral Access Crates (PACs) are automatically generated from Microchip SVD files, and provide low-level access to the peripherals specified by a device's SVD file.\n\n**B**oard **S**upport **P**ackages (**BSP**s) are provided for popular development boards, which rename pins to match silk screens or Arduino pin assignments, add helpers for initialization, and re-export the `atsamd-hal` crate.  The BSPs included in `atsamd-rs` are separated in to two tiers: Tier 1 BSPs use the latest version of `atsamd-hal`, Tier 2 BSPs use a specific version of `atsamd-hal` that is not necessarily the latest.\n\n| PAC docs | crates.io | Provided BSPs  |\n|:---------|:----------|:---------------|\n| [atsamd11c](https://docs.rs/atsamd11c/) | [![Crates.io](https://img.shields.io/crates/v/atsamd11c.svg)](https://crates.io/crates/atsamd11c) | [Bare atsamd11][samd11_bare]\\* |\n| [atsamd21e](https://docs.rs/atsamd21e/) | [![Crates.io](https://img.shields.io/crates/v/atsamd21e.svg)](https://crates.io/crates/atsamd21e) | [Gemma M0][gemma_m0], [Serpente][serpente], [Trinket M0][trinket_m0], [Neo Trinkey][neo_trinkey], [NeoKey Trinkey][neokey_trinkey], [QT Py][qt_py_m0] |\n| [atsamd21g](https://docs.rs/atsamd21g/) | [![Crates.io](https://img.shields.io/crates/v/atsamd21g.svg)](https://crates.io/crates/atsamd21g) | [Arduino Nano 33 IOT][arduino_nano33_iot], [Circuit Playground Express][circuit_playground_express], [Feather M0][feather_m0]\\*, [ItsyBitsy M0][itsybitsy_m0], [Metro M0][metro_m0]\\*, [MKR1000][arduino_mkr1000], [MKR Vidor 4000][arduino_mkr_vidor_4000], [MKR ZERO][arduino_mkrzero], [P1AM-100][p1am_100], [SAMD21 Mini][samd21_mini], [SODAQ ONE][sodaq_one], [Wio Lite MG126][wio_lite_mg126], [Wio Lite W600][wio_lite_w600], [Xiao M0][xiao_m0] |\n| [atsamd21j](https://docs.rs/atsamd21j/) | [![Crates.io](https://img.shields.io/crates/v/atsamd21j.svg)](https://crates.io/crates/atsamd21j) | [SODAQ SARA AFF][sodaq_sara_aff] |\n| [atsamd51g](https://docs.rs/atsamd51g/) | [![Crates.io](https://img.shields.io/crates/v/atsamd51g.svg)](https://crates.io/crates/atsamd51g) | [ItsyBitsy M4][itsybitsy_m4], [Trellis M4][trellis_m4] |\n| [atsamd51j](https://docs.rs/atsamd51j/) | [![Crates.io](https://img.shields.io/crates/v/atsamd51j.svg)](https://crates.io/crates/atsamd51j) | [EdgeBadge][edgebadge], [Feather M4][feather_m4]\\*, [Metro M4][metro_m4]\\*, [PyGamer][pygamer]\\*, [PyPortal][pyportal], [Matrix Portal M4][matrix_portal_m4] |\n| [atsame51n](https://docs.rs/atsame51n/) | [![Crates.io](https://img.shields.io/crates/v/atsame51n.svg)](https://crates.io/crates/atsame51n) |  |\n| [atsamd51p](https://docs.rs/atsamd51p/) | [![Crates.io](https://img.shields.io/crates/v/atsamd51p.svg)](https://crates.io/crates/atsamd51p) | [Grand Central M4 Express][grand_central_m4], [Wio Terminal][wio_terminal] |\n| [atsame51g](https://docs.rs/atsame51g/) | [![Crates.io](https://img.shields.io/crates/v/atsame51g.svg)](https://crates.io/crates/atsame51g) |  |\n| [atsame51j](https://docs.rs/atsame51j/) | [![Crates.io](https://img.shields.io/crates/v/atsame51j.svg)](https://crates.io/crates/atsame51j) |  |\n| [atsame51n](https://docs.rs/atsame51n/) | [![Crates.io](https://img.shields.io/crates/v/atsame51n.svg)](https://crates.io/crates/atsame51n) |  |\n| [atsame53j](https://docs.rs/atsame53j/) | [![Crates.io](https://img.shields.io/crates/v/atsame53j.svg)](https://crates.io/crates/atsame53j) |  |\n| [atsame53n](https://docs.rs/atsame53n/) | [![Crates.io](https://img.shields.io/crates/v/atsame53n.svg)](https://crates.io/crates/atsame53n) |  |\n| [atsame54n](https://docs.rs/atsame54n/) | [![Crates.io](https://img.shields.io/crates/v/atsame54n.svg)](https://crates.io/crates/atsame54n) |  |\n| [atsame54p](https://docs.rs/atsame54p/) | [![Crates.io](https://img.shields.io/crates/v/atsame54p.svg)](https://crates.io/crates/atsame54p) | [PathfinderZA Proto1][pfza_proto1], [SAM E54 Xplained Pro Evaluation Kit][atsame54_xpro]\\* |\n\n\\* Tier 1 BSP\n\n[arduino_mkr1000]: https://github.com/atsamd-rs/atsamd/tree/master/boards/arduino_mkr1000\n[arduino_mkr_vidor_4000]: https://github.com/atsamd-rs/atsamd/tree/master/boards/arduino_mkrvidor4000\n[arduino_mkrzero]: https://github.com/atsamd-rs/atsamd/tree/master/boards/arduino_mkrzero/\n[arduino_nano33_iot]: https://github.com/atsamd-rs/atsamd/tree/master/boards/arduino_nano33iot\n[atsame54_xpro]: https://github.com/atsamd-rs/atsamd/tree/master/boards/atsame54_xpro/\n[circuit_playground_express]: https://github.com/atsamd-rs/atsamd/tree/master/boards/circuit_playground_express/\n[edgebadge]: https://github.com/atsamd-rs/atsamd/tree/master/boards/edgebadge\n[feather_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/feather_m0/\n[feather_m4]: https://github.com/atsamd-rs/atsamd/tree/master/boards/feather_m4/\n[gemma_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/gemma_m0/\n[grand_central_m4]: https://github.com/atsamd-rs/atsamd/tree/master/boards/grand_central_m4/\n[itsybitsy_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/itsybitsy_m0/\n[itsybitsy_m4]: https://github.com/atsamd-rs/atsamd/tree/master/boards/itsybitsy_m4/\n[matrix_portal_m4]: https://github.com/atsamd-rs/atsamd/tree/master/boards/matrix_portal_m4/\n[metro_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/metro_m0/\n[metro_m4]: https://github.com/atsamd-rs/atsamd/tree/master/boards/metro_m4/\n[neo_trinkey]: https://github.com/atsamd-rs/atsamd/tree/master/boards/neo_trinkey\n[neokey_trinkey]: https://github.com/atsamd-rs/atsamd/tree/master/boards/neokey_trinkey\n[p1am_100]: https://github.com/atsamd-rs/atsamd/tree/master/boards/p1am_100\n[pfza_proto1]: https://github.com/atsamd-rs/atsamd/tree/master/boards/pfza_proto1/\n[pygamer]: https://github.com/atsamd-rs/atsamd/tree/master/boards/pygamer/\n[pyportal]: https://github.com/atsamd-rs/atsamd/tree/master/boards/pyportal/\n[qt_py_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/qt_py_m0\n[samd11_bare]: https://github.com/atsamd-rs/atsamd/tree/master/boards/samd11_bare\n[samd21_mini]: https://github.com/atsamd-rs/atsamd/tree/master/boards/samd21_mini/\n[serpente]: https://github.com/atsamd-rs/atsamd/tree/master/boards/serpente/\n[sodaq_one]: https://github.com/atsamd-rs/atsamd/tree/master/boards/sodaq_one/\n[sodaq_sara_aff]: https://github.com/atsamd-rs/atsamd/tree/master/boards/sodaq_sara_aff/\n[trellis_m4]: https://github.com/atsamd-rs/atsamd/tree/master/boards/trellis_m4/\n[trinket_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/trinket_m0/\n[wio_lite_mg126]: https://github.com/atsamd-rs/atsamd/tree/master/boards/wio_lite_mg126\n[wio_lite_w600]: https://github.com/atsamd-rs/atsamd/tree/master/boards/wio_lite_w600\n[wio_terminal]: https://github.com/atsamd-rs/atsamd/tree/master/boards/wio_terminal\n[xiao_m0]: https://github.com/atsamd-rs/atsamd/tree/master/boards/xiao_m0\n\n\n### `async` APIs\n\n[`atsamd_hal`](https://crates.io/crates/atsamd-hal) provides APIs for using `async`/`await` constructs with some of its peripherals. To enable `async` support, use the `async` Cargo feature.\nDetailed documentation is provided in the `atsamd_hal::async_hal` module. The [metro_m4](https://github.com/atsamd-rs/atsamd/tree/master/boards/metro_m4/examples) and\n[feather_m0](https://github.com/atsamd-rs/atsamd/tree/master/boards/feather_m0/examples) feature complete examples showing how to use async APIs.\n\nPlease note that you must bring your own executor runtime such as [`embassy-executor`](https://crates.io/crates/embassy-executor) or [`rtic`](https://crates.io/crates/rtic) to be able to\nuse the async APIs.\n\n#### Supported peripherals\n\n* SPI\n* I2C\n* USART\n* DMAC\n* EIC (GPIO interrupts)\n* Timers\n\n### Examples\n\nThe BSPs include examples to quickly get up and running with the board. Building the examples\nrequires changing directory into one of the board support package directories, and some examples\nwill require additional features:\n\n```bash\n$ cd boards/metro_m0\n$ cargo build --examples --features=\"usb\"\n```\n\nA new firmware can be made from one of the examples:\n  1. Create a new Cargo package for the firmware `cargo new my_firmware`, `cd my_firmware`\n  2. Copy the BSP example source file `cp feather_m0/examples/blinky_basic.rs src/main.rs`\n  3. Copy Cargo config and memory layout `cp -R feather_m0/.cargo feather_m0/memory.x .`\n  4. Add the BSP and any other required dependencies to `Cargo.toml`:\n``` TOML\n[dependencies]\nfeather_m0 = \"0.13\"\npanic-halt = \"0.2\"\n```\n  5. `cargo build` should create an ELF in `target/thumbv6m-none-eabi/debug/my_firmware`\n\n## Building\n\nYou'll need to add the proper compilation target prior to building:\n\n```bash\n$ # for samd11, samd21:\n$ rustup target add thumbv6m-none-eabi\n$ # for samd51, same51, same53, same54:\n$ rustup target add thumbv7em-none-eabihf\n```\n\n### CI\n\nIf you'd like to build all the same things that the CI would build but on your local system, you can run:\n\n```bash\n$ ./build-all.py\n```\n\n## Running and debugging firmware on target hardware\n\nSee our wiki page about [loading code onto the device](https://github.com/atsamd-rs/atsamd/wiki/Loading-code-onto-the-device).\n\n## Adding a new board\n\nSee our wiki page about [adding a new board](https://github.com/atsamd-rs/atsamd/wiki/Adding-a-new-board).\n\n## License\n\nThe included SVD files are sourced from http://packs.download.atmel.com/ and\nare licensed under the Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\nhttp://www.apache.org/licenses/LICENSE-2.0).\n\nThe remainder of the code is licensed 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## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","funding_links":[],"categories":["Rust","Peripheral Access Crates"],"sub_categories":["Microchip"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsamd-rs%2Fatsamd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatsamd-rs%2Fatsamd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsamd-rs%2Fatsamd/lists"}