[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5522":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":36,"discoverSource":37},5522,"embassy","embassy-rs\u002Fembassy","embassy-rs","Modern embedded framework, using Rust and async.","https:\u002F\u002Fembassy.dev",null,"Rust",9396,1514,50,542,0,2,42,193,19,40.54,"Apache License 2.0",false,"main",true,[27,28,29,30,31,32],"async","drivers","embedded","executor","hal","rust","2026-06-12 02:01:11","# Embassy\n\nEmbassy is the next-generation framework for embedded applications. Write safe, correct, and energy-efficient embedded code faster, using the Rust programming language, its async facilities, and the Embassy libraries.\n\n## [Documentation](https:\u002F\u002Fembassy.dev\u002Fbook\u002Findex.html) - [API reference](https:\u002F\u002Fdocs.embassy.dev\u002F) - [Website](https:\u002F\u002Fembassy.dev\u002F) - [Chat](https:\u002F\u002Fmatrix.to\u002F#\u002F#embassy-rs:matrix.org)\n\n## Rust + async ❤️ embedded\n\nThe Rust programming language is blazingly fast and memory-efficient, with no runtime, garbage collector, or OS. It catches a wide variety of bugs at compile time, thanks to its full memory- and thread-safety, and expressive type system.\n\nRust's [async\u002Fawait](https:\u002F\u002Frust-lang.github.io\u002Fasync-book\u002F) allows for unprecedentedly easy and efficient multitasking in embedded systems. Tasks get transformed at compile time into state machines that get run cooperatively. It requires no dynamic memory allocation and runs on a single stack, so no per-task stack size tuning is required. It obsoletes the need for a traditional RTOS with kernel context switching, and is [faster and smaller than one!](https:\u002F\u002Ftweedegolf.nl\u002Fen\u002Fblog\u002F65\u002Fasync-rust-vs-rtos-showdown)\n\n## Batteries included\n\n- **Hardware Abstraction Layers**\n    - HALs implement safe, idiomatic Rust APIs to use the hardware capabilities, so raw register manipulation is not needed. The Embassy project maintains HALs for select hardware, but you can still use HALs from other projects with Embassy.\n    - [embassy-stm32](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-stm32\u002F), for all STM32 microcontroller families.\n    - [embassy-nrf](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-nrf\u002F), for the Nordic Semiconductor nRF52, nRF53, nRF54 and nRF91 series.\n    - [embassy-rp](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-rp\u002F), for the Raspberry Pi RP2040 and RP23xx microcontrollers.\n    - [embassy-mspm0](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-mspm0\u002F), for the Texas Instruments MSPM0 microcontrollers.\n    - [embassy-mcxa](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-mcxa\u002F), for NXP's MCX-A series of microcontrollers.\n    - [esp-rs](https:\u002F\u002Fgithub.com\u002Fesp-rs), for the Espressif Systems ESP32 series of chips.\n        - Embassy HAL support for Espressif chips, as well as Async Wi-Fi, Bluetooth, and ESP-NOW, is being developed in the [esp-rs\u002Fesp-hal](https:\u002F\u002Fgithub.com\u002Fesp-rs\u002Fesp-hal) repository.\n    - [ch32-hal](https:\u002F\u002Fgithub.com\u002Fch32-rs\u002Fch32-hal), for the WCH 32-bit RISC-V(CH32V) series of chips.\n    - [mpfs-hal](https:\u002F\u002Fgithub.com\u002FAlexCharlton\u002Fmpfs-hal), for the Microchip PolarFire SoC.\n    - [py32-hal](https:\u002F\u002Fgithub.com\u002Fpy32-rs\u002Fpy32-hal), for the Puya Semiconductor PY32 series of microcontrollers.\n\n- **Time that Just Works** -\n  No more messing with hardware timers. [embassy_time](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-time) provides Instant, Duration, and Timer types that are globally available and never overflow.\n\n- **Real-time ready** -\n  Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities so that higher priority tasks preempt lower priority ones. See the [example](https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Fembassy\u002Fblob\u002Fmain\u002Fexamples\u002Fnrf52840\u002Fsrc\u002Fbin\u002Fmultiprio.rs).\n\n- **Low-power ready** -\n  Easily build devices with years of battery life. The async executor automatically puts the core to sleep when there's no work to do. Tasks are woken by interrupts, there is no busy-loop polling while waiting.\n\n- **Networking** -\n  The [embassy-net](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-net\u002F) network stack implements extensive networking functionality, including Ethernet, IP, TCP, UDP, ICMP, and DHCP. Async drastically simplifies managing timeouts and serving multiple connections concurrently.\n\n- **Bluetooth**\n    - The [trouble](https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Ftrouble) crate provides a Bluetooth Low Energy 4.x and 5.x Host that runs on any microcontroller implementing the [bt-hci](https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Fbt-hci) traits (currently\n      `nRF52`, `nrf54`, `rp2040`, `rp23xx` and `esp32` and `serial` controllers are supported).\n    - The [nrf-softdevice](https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Fnrf-softdevice) crate provides Bluetooth Low Energy 4.x and 5.x support for nRF52 microcontrollers.\n    - The [embassy-stm32-wpan](https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Fembassy\u002Ftree\u002Fmain\u002Fembassy-stm32-wpan) crate provides Bluetooth Low Energy 5.x support for stm32wb microcontrollers.\n\n- **LoRa** -\n  The [lora-rs](https:\u002F\u002Fgithub.com\u002Flora-rs\u002Flora-rs) project provides an async LoRa and LoRaWAN stack that works well on Embassy.\n\n- **USB** -\n  [embassy-usb](https:\u002F\u002Fdocs.embassy.dev\u002Fembassy-usb\u002F) implements a device-side USB stack. Implementations for common classes such as USB serial (CDC ACM) and USB HID are available, and a rich builder API allows building your own.\n\n- **Bootloader and DFU** -\n  [embassy-boot](https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Fembassy\u002Ftree\u002Fmain\u002Fembassy-boot) is a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks.\n\n## Sneak peek\n\n```rust,ignore\nuse defmt::info;\nuse embassy_executor::Spawner;\nuse embassy_time::{Duration, Timer};\nuse embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull};\nuse embassy_nrf::{Peri, Peripherals};\n\n\u002F\u002F Declare async tasks\n#[embassy_executor::task]\nasync fn blink(pin: Peri\u003C'static, AnyPin>) {\n    let mut led = Output::new(pin, Level::Low, OutputDrive::Standard);\n\n    loop {\n        \u002F\u002F Timekeeping is globally available, no need to mess with hardware timers.\n        led.set_high();\n        Timer::after_millis(150).await;\n        led.set_low();\n        Timer::after_millis(150).await;\n    }\n}\n\n\u002F\u002F Main is itself an async task as well.\n#[embassy_executor::main]\nasync fn main(spawner: Spawner) {\n    let p = embassy_nrf::init(Default::default());\n\n    \u002F\u002F Spawned tasks run in the background, concurrently.\n    spawner.spawn(blink(p.P0_13.into()).unwrap());\n\n    let mut button = Input::new(p.P0_11, Pull::Up);\n    loop {\n        \u002F\u002F Asynchronously wait for GPIO events, allowing other tasks\n        \u002F\u002F to run, or the core to sleep.\n        button.wait_for_low().await;\n        info!(\"Button pressed!\");\n        button.wait_for_high().await;\n        info!(\"Button released!\");\n    }\n}\n```\n\n## Examples\n\nExamples are found in the\n`examples\u002F` folder separated by the chip manufacturer they are designed to run on. For example:\n\n* `examples\u002Fnrf52840` run on the\n  `nrf52840-dk` board (PCA10056) but should be easily adaptable to other nRF52 chips and boards.\n* `examples\u002Fnrf5340` run on the `nrf5340-dk` board (PCA10095).\n* `examples\u002Fstm32xx` for the various STM32 families.\n* `examples\u002Frp` are for the RP2040 and RP235x chips.\n* `examples\u002Fmcxa` run on the `FRDM-MCXA266` board.\n* `examples\u002Fstd` are designed to run locally on your PC.\n\n### Running examples\n\n- Install `probe-rs` following the instructions at \u003Chttps:\u002F\u002Fprobe.rs>.\n- Change directory to the sample's base directory. For example:\n\n```bash\ncd examples\u002Fnrf52840\n```\n\n- Ensure `Cargo.toml` sets the right feature for the name of the chip you are programming.\n  If this name is incorrect, the example may fail to run or immediately crash\n  after being programmed.\n\n- Ensure `.cargo\u002Fconfig.toml` contains the name of the chip you are programming.\n\n- Run the example\n\nFor example:\n\n```bash\ncargo run --release --bin blinky\n```\n\nFor more help getting started, see [Getting Started][1] and [Running the Examples][2].\n\n## Developing Embassy with Rust Analyzer-based editors\n\nThe [Rust Analyzer](https:\u002F\u002Frust-analyzer.github.io\u002F) is used by [Visual Studio Code](https:\u002F\u002Fcode.visualstudio.com\u002F)\nand others. Given the multiple targets that Embassy serves, there is no Cargo workspace file. Instead, the Rust Analyzer\nmust be told of the target project to work with. In the case of Visual Studio Code,\nplease refer to the `.vscode\u002Fsettings.json` file's `rust-analyzer.linkedProjects`setting.\n\n## Minimum supported Rust version (MSRV)\n\nEmbassy is guaranteed to compile on latest stable Rust. It *might*\ncompile with older versions, but that may change in any new patch release.\n\n## Why the name?\n\nEMBedded ASYnc! :)\n\n## License\n\nEmbassy is licensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  \u003Chttp:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0>)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003Chttp:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT>)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n[1]: https:\u002F\u002Fembassy-rs.github.io\u002Fembassy-book\u002Fembassy\u002Fdev\u002Fgetting_started.html\n[2]: https:\u002F\u002Fgithub.com\u002Fembassy-rs\u002Fembassy\u002Fwiki\u002FRunning-the-Examples\n","Embassy 是一个用于嵌入式应用的现代框架，利用 Rust 语言及其异步特性。它提供了安全、高效且节能的编程方式，通过 Rust 的内存安全和线程安全机制在编译时捕获多种错误，并借助 async\u002Fawait 实现高效的多任务处理，无需动态内存分配和复杂的堆栈调整，超越了传统 RTOS 的性能。项目内置了多个硬件抽象层（HAL），支持如 STM32、nRF5x 和 RP2040 等主流微控制器系列，简化了硬件操作接口。此外，Embassy 还提供了一套易于使用的定时器库，确保时间管理的准确性与可靠性。该框架适用于需要高性能、低功耗以及高可靠性的嵌入式开发场景，特别是在物联网设备、工业控制等领域。","2026-06-11 03:03:48","top_language"]