repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/build.rs
examples/mspm0g3507/build.rs
//! This build script copies the `memory.x` file from the crate root into //! a directory where the linker can always find it at build time. //! For many projects this is optional, as the linker always searches the //! project root directory -- wherever `Cargo.toml` is. However, if you //! are using a workspace or have...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/button.rs
examples/mspm0g3507/src/bin/button.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::Config; use embassy_mspm0::gpio::{Input, Level, Output, Pull}; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { info!("Hello world!"); let p = embassy_mspm0::init(Con...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/i2c.rs
examples/mspm0g3507/src/bin/i2c.rs
//! This example uses FIFO with polling, and the maximum FIFO size is 8. //! Refer to async example to handle larger packets. //! //! This example controls AD5171 digital potentiometer via I2C with the LP-MSPM0G3507 board. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::i2c::{Co...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/mathacl_ops.rs
examples/mspm0g3507/src/bin/mathacl_ops.rs
//! Example of using mathematical calculations performed by the MSPM0G3507 chip. //! //! It prints the result of basics trigonometric calculation. #![no_std] #![no_main] use core::f32::consts::PI; use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::mathacl::{Mathacl, Precision}; use embassy_time::Timer; ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/uart.rs
examples/mspm0g3507/src/bin/uart.rs
//! Example of using blocking uart //! //! This uses the virtual COM port provided on the LP-MSPM0G3507 board. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::uart::{Config, Uart}; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner)...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/wwdt.rs
examples/mspm0g3507/src/bin/wwdt.rs
//! Example of using window watchdog timer in the MSPM0G3507 chip. //! //! It tests the use case when watchdog timer is expired and when watchdog is pet too early. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::gpio::{Level, Output}; use embassy_mspm0::wwdt::{ClosedWindowPercen...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/i2c_target.rs
examples/mspm0g3507/src/bin/i2c_target.rs
//! Example of using async I2C target //! //! This uses the virtual COM port provided on the LP-MSPM0G3507 board. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::i2c::Config; use embassy_mspm0::i2c_target::{Command, Config as TargetConfig, I2cTarget, ReadStatus}; use embassy_msp...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/i2c_async.rs
examples/mspm0g3507/src/bin/i2c_async.rs
//! The example uses FIFO and interrupts, wrapped in async API. //! //! This example controls AD5171 digital potentiometer via I2C with the LP-MSPM0G3507 board. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::bind_interrupts; use embassy_mspm0::i2c::{Config, I2c, InterruptHandle...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/adc.rs
examples/mspm0g3507/src/bin/adc.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::adc::{self, Adc, Vrsel}; use embassy_mspm0::{Config, bind_interrupts, peripherals}; use embassy_time::Timer; use {defmt_rtt as _, panic_halt as _}; bind_interrupts!(struct Irqs { ADC0 => adc::InterruptHandler<peripherals::ADC0>...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3507/src/bin/blinky.rs
examples/mspm0g3507/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::Config; use embassy_mspm0::gpio::{Level, Output}; use embassy_time::Timer; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { info!("Hello world!"); let p = embassy_mspm...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/build.rs
examples/stm32l5/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/src/bin/usb_serial.rs
examples/stm32l5/src/bin/usb_serial.rs
#![no_std] #![no_main] use defmt::{panic, *}; use embassy_executor::Spawner; use embassy_futures::join::join; use embassy_stm32::usb::{Driver, Instance}; use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; use embassy_usb::Builder; use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; use embassy_usb::dri...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/src/bin/button_exti.rs
examples/stm32l5/src/bin/button_exti.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::Pull; use embassy_stm32::{bind_interrupts, interrupt}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!( pub struct Irqs{ EXTI13 => exti::InterruptHandler<interr...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/src/bin/usb_ethernet.rs
examples/stm32l5/src/bin/usb_ethernet.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_net::StackResources; use embassy_net::tcp::TcpSocket; use embassy_stm32::rng::Rng; use embassy_stm32::usb::Driver; use embassy_stm32::{Config, bind_interrupts, peripherals, rng, usb}; use embassy_usb::class::cdc_ncm::embassy_net::{Device, ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/src/bin/usb_hid_mouse.rs
examples/stm32l5/src/bin/usb_hid_mouse.rs
#![no_std] #![no_main] use core::sync::atomic::{AtomicU8, Ordering}; use defmt::*; use embassy_executor::Spawner; use embassy_futures::join::join; use embassy_stm32::usb::Driver; use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; use embassy_time::Timer; use embassy_usb::Builder; use embassy_usb::class::...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/src/bin/rng.rs
examples/stm32l5/src/bin/rng.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::rcc::{Pll, PllMul, PllPreDiv, PllRDiv, PllSource, Sysclk}; use embassy_stm32::rng::Rng; use embassy_stm32::{Config, bind_interrupts, peripherals, rng}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { RNG ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l5/src/bin/stop.rs
examples/stm32l5/src/bin/stop.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{AnyPin, Level, Output, Speed}; use embassy_stm32::rcc::LsConfig; use embassy_stm32::{Config, Peri, low_power}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main(executor = "low_power::...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wle5/build.rs
examples/stm32wle5/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wle5/src/bin/i2c.rs
examples/stm32wle5/src/bin/i2c.rs
#![no_std] #![no_main] use defmt::*; #[cfg(feature = "defmt-rtt")] use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::i2c::I2c; use embassy_stm32::time::Hertz; use embassy_stm32::{bind_interrupts, i2c, low_power, peripherals}; use embassy_time::{Duration, Timer}; use panic_probe as _; use static_cel...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wle5/src/bin/button_exti.rs
examples/stm32wle5/src/bin/button_exti.rs
#![no_std] #![no_main] use defmt::*; #[cfg(feature = "defmt-rtt")] use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::Pull; use embassy_stm32::{bind_interrupts, interrupt, low_power}; use panic_probe as _; use static_cell::StaticCell; bind_interrupt...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wle5/src/bin/adc.rs
examples/stm32wle5/src/bin/adc.rs
#![no_std] #![no_main] use defmt::*; #[cfg(feature = "defmt-rtt")] use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::adc::{Adc, SampleTime}; use embassy_stm32::low_power; use embassy_time::Timer; use panic_probe as _; use static_cell::StaticCell; #[embassy_executor::main(executor = "low_power::Exe...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wle5/src/bin/blinky.rs
examples/stm32wle5/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; #[cfg(feature = "defmt-rtt")] use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::low_power; use embassy_time::Timer; use panic_probe as _; use static_cell::StaticCell; #[embassy_executor::main(executor = "low_powe...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/nrf52840-edf/build.rs
examples/nrf52840-edf/build.rs
//! This build script copies the `memory.x` file from the crate root into //! a directory where the linker can always find it at build time. //! For many projects this is optional, as the linker always searches the //! project root directory -- wherever `Cargo.toml` is. However, if you //! are using a workspace or have...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/nrf52840-edf/src/bin/basic.rs
examples/nrf52840-edf/src/bin/basic.rs
//! Basic side-by-side example of the Earliest Deadline First scheduler //! //! This test spawns a number of background "ambient system load" workers //! that are constantly working, and runs two sets of trials. //! //! The first trial runs with no deadline set, so our trial task is at the //! same prioritization level...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f2/build.rs
examples/stm32f2/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f2/src/bin/blinky.rs
examples/stm32f2/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Default::default()); info!("Hello World...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f2/src/bin/pll.rs
examples/stm32f2/src/bin/pll.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::Config; use embassy_stm32::time::Hertz; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { // Example config for maximum performance on a NUCLEO-F207ZG ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/build.rs
examples/stm32f4/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/button.rs
examples/stm32f4/src/bin/button.rs
#![no_std] #![no_main] use cortex_m_rt::entry; use defmt::*; use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; use {defmt_rtt as _, panic_probe as _}; #[entry] fn main() -> ! { info!("Hello World!"); let p = embassy_stm32::init(Default::default()); let button = Input::new(p.PC13, Pull::Down)...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/input_capture.rs
examples/stm32f4/src/bin/input_capture.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Pull, Speed}; use embassy_stm32::time::khz; use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; use embassy_stm32::timer::{self, Channel}; use embassy_stm32::{Peri, bind_interrupts, peripherals...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/flash_async.rs
examples/stm32f4/src/bin/flash_async.rs
#![no_std] #![no_main] use defmt::{info, unwrap}; use embassy_executor::Spawner; use embassy_stm32::flash::{Flash, InterruptHandler}; use embassy_stm32::gpio::{AnyPin, Level, Output, Speed}; use embassy_stm32::{Peri, bind_interrupts}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(s...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/rtc.rs
examples/stm32f4/src/bin/rtc.rs
#![no_std] #![no_main] use chrono::{NaiveDate, NaiveDateTime}; use defmt::*; use embassy_executor::Spawner; use embassy_stm32::Config; use embassy_stm32::rtc::{Rtc, RtcConfig}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let config ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/i2c.rs
examples/stm32f4/src/bin/i2c.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::i2c::{Error, I2c}; use {defmt_rtt as _, panic_probe as _}; const ADDRESS: u8 = 0x5F; const WHOAMI: u8 = 0x0F; #[embassy_executor::main] async fn main(_spawner: Spawner) { info!("Hello world!"); let p = embassy_stm32::init(...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/flash.rs
examples/stm32f4/src/bin/flash.rs
#![no_std] #![no_main] use defmt::{info, unwrap}; use embassy_executor::Spawner; use embassy_stm32::flash::{Blocking, Flash}; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Default::default()); info!("Hello Flash!"); // Onc...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/i2c_comparison.rs
examples/stm32f4/src/bin/i2c_comparison.rs
#![no_std] #![no_main] // Example originally designed for stm32f411ceu6 with three A1454 hall effect sensors, connected to I2C1, 2 and 3 // on the pins referenced in the peripheral definitions. // Pins and DMA peripherals changed to compile for stm32f429zi, to work with the CI. // MUST be compiled in release mode to s...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usb_serial.rs
examples/stm32f4/src/bin/usb_serial.rs
#![no_std] #![no_main] use defmt::{panic, *}; use embassy_executor::Spawner; use embassy_futures::join::join; use embassy_stm32::time::Hertz; use embassy_stm32::usb::{Driver, Instance}; use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; use embassy_usb::Builder; use embassy_usb::class::cdc_acm::{CdcAcmCla...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/adc_dma.rs
examples/stm32f4/src/bin/adc_dma.rs
#![no_std] #![no_main] use cortex_m::singleton; use defmt::*; use embassy_executor::Spawner; use embassy_stm32::Peripherals; use embassy_stm32::adc::{Adc, AdcChannel, RegularConversionMode, RingBufferedAdc, SampleTime}; use embassy_time::Instant; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/pwm_input.rs
examples/stm32f4/src/bin/pwm_input.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Pull, Speed}; use embassy_stm32::time::khz; use embassy_stm32::timer::pwm_input::PwmInput; use embassy_stm32::{Peri, bind_interrupts, peripherals, timer}; use embassy_time::Timer; use {defmt_rtt as _, panic_pro...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usart.rs
examples/stm32f4/src/bin/usart.rs
#![no_std] #![no_main] use cortex_m_rt::entry; use defmt::*; use embassy_stm32::usart::{Config, Uart}; use embassy_stm32::{bind_interrupts, peripherals, usart}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USART3 => usart::InterruptHandler<peripherals::USART3>; }); #[entry] fn main() ->...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/eth.rs
examples/stm32f4/src/bin/eth.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_net::tcp::TcpSocket; use embassy_net::{Ipv4Address, StackResources}; use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue, Sma}; use embassy_stm32::peripherals::{ETH, ETH_SMA}; use embassy_stm32::rng::Rng; use embassy_stm32::time::He...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/pwm.rs
examples/stm32f4/src/bin/pwm.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::OutputType; use embassy_stm32::time::khz; use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usart_dma.rs
examples/stm32f4/src/bin/usart_dma.rs
#![no_std] #![no_main] use core::fmt::Write; use defmt::*; use embassy_executor::Spawner; use embassy_stm32::usart::{Config, Uart}; use embassy_stm32::{bind_interrupts, peripherals, usart}; use heapless::String; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USART3 => usart::InterruptHand...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/i2c_slave_blocking.rs
examples/stm32f4/src/bin/i2c_slave_blocking.rs
//! Complete I2C slave example using blocking operations //! //! This example shows how to set up an STM32F4 as an I2C slave device //! that can handle both read and write transactions from master devices. #![no_std] #![no_main] use defmt::{error, info}; use embassy_executor::Spawner; use embassy_stm32::i2c::{self, A...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/spi_dma.rs
examples/stm32f4/src/bin/spi_dma.rs
#![no_std] #![no_main] use core::fmt::Write; use core::str::from_utf8; use defmt::*; use embassy_executor::Spawner; use embassy_stm32::spi::{Config, Spi}; use embassy_stm32::time::Hertz; use heapless::String; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/wdt.rs
examples/stm32f4/src/bin/wdt.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::wdg::IndependentWatchdog; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::ini...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/dac.rs
examples/stm32f4/src/bin/dac.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::dac::{DacCh1, Value}; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { let p = embassy_stm32::init(Default::default()); info!("Hello World, dude!"); let mut dac ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usb_uac_speaker.rs
examples/stm32f4/src/bin/usb_uac_speaker.rs
#![no_std] #![no_main] use core::cell::{Cell, RefCell}; use defmt::{panic, *}; use embassy_executor::Spawner; use embassy_stm32::time::Hertz; use embassy_stm32::{Config, bind_interrupts, interrupt, peripherals, timer, usb}; use embassy_sync::blocking_mutex::Mutex; use embassy_sync::blocking_mutex::raw::{CriticalSecti...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/can.rs
examples/stm32f4/src/bin/can.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::bind_interrupts; use embassy_stm32::can::filter::Mask32; use embassy_stm32::can::{ Can, Fifo, Frame, Rx0InterruptHandler, Rx1InterruptHandler, SceInterruptHandler, StandardId, TxInterruptHandler, }; use embassy_stm32::gpio::{Inp...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/button_exti.rs
examples/stm32f4/src/bin/button_exti.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::Pull; use embassy_stm32::{bind_interrupts, interrupt}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!( pub struct Irqs{ EXTI15_10 => exti::InterruptHandler<int...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/hello.rs
examples/stm32f4/src/bin/hello.rs
#![no_std] #![no_main] use defmt::info; use embassy_executor::Spawner; use embassy_stm32::Config; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { let config = Config::default(); let _p = embassy_stm32::init(config); loop {...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/spi.rs
examples/stm32f4/src/bin/spi.rs
#![no_std] #![no_main] use cortex_m_rt::entry; use defmt::*; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::spi::{Config, Spi}; use embassy_stm32::time::Hertz; use {defmt_rtt as _, panic_probe as _}; #[entry] fn main() -> ! { info!("Hello World, dude!"); let p = embassy_stm32::init(Defau...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/eth_compliance_test.rs
examples/stm32f4/src/bin/eth_compliance_test.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::eth::{Ethernet, PacketQueue, StationManagement}; use embassy_stm32::time::Hertz; use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rng}; use embassy_time::Timer; use static_cell::StaticCell; use {defmt_rtt as _, panic_p...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usb_ethernet.rs
examples/stm32f4/src/bin/usb_ethernet.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_net::StackResources; use embassy_net::tcp::TcpSocket; use embassy_stm32::rng::{self, Rng}; use embassy_stm32::time::Hertz; use embassy_stm32::usb::Driver; use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; use embassy_usb::cla...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/pwm_complementary.rs
examples/stm32f4/src/bin/pwm_complementary.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::OutputType; use embassy_stm32::time::khz; use embassy_stm32::timer::Channel; use embassy_stm32::timer::complementary_pwm::{ComplementaryPwm, ComplementaryPwmPin}; use embassy_stm32::timer::simple_pwm::PwmPin; use embassy_time:...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/multiprio.rs
examples/stm32f4/src/bin/multiprio.rs
//! This example showcases how to create multiple Executor instances to run tasks at //! different priority levels. //! //! Low priority executor runs in thread mode (not interrupt), and uses `sev` for signaling //! there's work in the queue, and `wfe` for waiting for work. //! //! Medium and high priority executors ru...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/i2s_dma.rs
examples/stm32f4/src/bin/i2s_dma.rs
// This example is written for an STM32F411 chip communicating with an external // PCM5102a DAC. Remap pins, change clock speeds, etc. as necessary for your own // hardware. // // NOTE: This example outputs potentially loud audio. Please run responsibly. #![no_std] #![no_main] use embassy_executor::Spawner; use embas...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/ws2812_spi.rs
examples/stm32f4/src/bin/ws2812_spi.rs
// Mimic PWM with SPI, to control ws2812 // We assume the DIN pin of ws2812 connect to GPIO PB5, and ws2812 is properly powered. // // The idea is that the data rate of ws2812 is 800 kHz, and it use different duty ratio to represent bit 0 and bit 1. // Thus we can adjust SPI to send each *round* of data at 800 kHz, and...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usb_hid_mouse.rs
examples/stm32f4/src/bin/usb_hid_mouse.rs
#![no_std] #![no_main] use core::sync::atomic::{AtomicU8, Ordering}; use defmt::*; use embassy_executor::Spawner; use embassy_futures::join::join; use embassy_stm32::time::Hertz; use embassy_stm32::usb::Driver; use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; use embassy_time::Timer; use embassy_usb::B...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usart_buffered.rs
examples/stm32f4/src/bin/usart_buffered.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::usart::{BufferedUart, Config}; use embassy_stm32::{bind_interrupts, peripherals, usart}; use embedded_io_async::BufRead; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USART3 => usart::BufferedInterruptH...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usb_raw.rs
examples/stm32f4/src/bin/usb_raw.rs
//! Example of using USB without a pre-defined class, but instead responding to //! raw USB control requests. //! //! The host computer can either: //! * send a command, with a 16-bit request ID, a 16-bit value, and an optional data buffer //! * request some data, with a 16-bit request ID, a 16-bit value, and a length ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/i2c_slave_async.rs
examples/stm32f4/src/bin/i2c_slave_async.rs
//! I2C slave example using async operations with DMA //! //! This example demonstrates DMA-accelerated I2C slave operations, //! which provide better performance and lower CPU overhead for //! high-frequency I2C transactions. #![no_std] #![no_main] use defmt::{error, info}; use embassy_executor::Spawner; use embassy...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/mco.rs
examples/stm32f4/src/bin/mco.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_stm32::rcc::{Mco, Mco1Source, Mco2Source, McoConfig, McoPrescaler}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawne...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/i2c_async.rs
examples/stm32f4/src/bin/i2c_async.rs
#![no_std] #![no_main] // Example originally designed for stm32f411ceu6 reading an A1454 hall effect sensor on I2C1 // DMA peripherals changed to compile for stm32f429zi, for the CI. use defmt::*; use embassy_executor::Spawner; use embassy_stm32::i2c::I2c; use embassy_stm32::{bind_interrupts, i2c, peripherals}; use {...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/sdmmc.rs
examples/stm32f4/src/bin/sdmmc.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::sdmmc::Sdmmc; use embassy_stm32::sdmmc::sd::{CmdBlock, DataBlock, StorageDevice}; use embassy_stm32::time::{Hertz, mhz}; use embassy_stm32::{Config, bind_interrupts, peripherals, sdmmc}; use {defmt_rtt as _, panic_probe as _}; /// ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/ws2812_pwm.rs
examples/stm32f4/src/bin/ws2812_pwm.rs
// Configure TIM3 in PWM mode, and start DMA Transfer(s) to send color data into ws2812. // We assume the DIN pin of ws2812 connect to GPIO PB4, and ws2812 is properly powered. // // The idea is that the data rate of ws2812 is 800 kHz, and it use different duty ratio to represent bit 0 and bit 1. // Thus we can set TIM...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/usb_hid_keyboard.rs
examples/stm32f4/src/bin/usb_hid_keyboard.rs
#![no_std] #![no_main] use core::sync::atomic::{AtomicBool, AtomicU8, Ordering}; use defmt::*; use embassy_executor::Spawner; use embassy_futures::join::join; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::Pull; use embassy_stm32::time::Hertz; use embassy_stm32::usb::Driver; use embassy_stm32::{...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/adc.rs
examples/stm32f4/src/bin/adc.rs
#![no_std] #![no_main] use cortex_m::prelude::_embedded_hal_blocking_delay_DelayUs; use defmt::*; use embassy_executor::Spawner; use embassy_stm32::adc::{Adc, SampleTime, Temperature, VrefInt}; use embassy_time::{Delay, Timer}; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/blinky.rs
examples/stm32f4/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Default::default()); info!("Hello World...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f4/src/bin/eth_w5500.rs
examples/stm32f4/src/bin/eth_w5500.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_net::tcp::TcpSocket; use embassy_net::{Ipv4Address, StackResources}; use embassy_net_wiznet::chip::W5500; use embassy_net_wiznet::{Device, Runner, State}; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::{Level, Output,...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mimxrt1011/build.rs
examples/mimxrt1011/build.rs
use imxrt_rt::{Family, RuntimeBuilder}; fn main() { // The IMXRT1010-EVK technically has 128M of flash, but we only ever use 8MB so that the examples // will build fine on the Adafruit Metro M7 boards. RuntimeBuilder::from_flexspi(Family::Imxrt1010, 8 * 1024 * 1024) .build() .unwrap(); ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mimxrt1011/src/lib.rs
examples/mimxrt1011/src/lib.rs
//! FlexSPI configuration block (FCB) for iMXRT1011 boards. //! //! This is a generic FCB that should work with most QSPI flash. #![no_std] use imxrt_boot_gen::flexspi; use imxrt_boot_gen::flexspi::opcodes::sdr::*; use imxrt_boot_gen::flexspi::{ ColumnAddressWidth, Command, DeviceModeConfiguration, FlashPadType, ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mimxrt1011/src/bin/button.rs
examples/mimxrt1011/src/bin/button.rs
//! This example works on the following boards: //! - IMXRT1010-EVK //! - Adafruit Metro M7 (with microSD or with AirLift), requires an external button //! - Makerdiary iMX RT1011 Nano Kit (TODO: currently untested, please change this) //! //! Although beware you will need to change the GPIO pins being used (scroll dow...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mimxrt1011/src/bin/blinky.rs
examples/mimxrt1011/src/bin/blinky.rs
//! This example works on the following boards: //! - IMXRT1010-EVK //! - Adafruit Metro M7 (with microSD or with AirLift), requires an external button //! - Makerdiary iMX RT1011 Nano Kit (TODO: currently untested, please change this) //! //! Although beware you will need to change the GPIO pins being used (scroll dow...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/build.rs
examples/stm32f0/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/i2c_master.rs
examples/stm32f0/src/bin/i2c_master.rs
#![no_std] #![no_main] // Hardware Setup for NUCLEO-F072RB: // - I2C1 pins: PB8 (SCL), PB9 (SDA) on CN5 connector // - Connect to I2C slave device (e.g., Digilent Analog Discovery I2C slave, or EEPROM) // - Default slave address: 0x50 // - Pull-up resistors: 4.7kΩ on both SCL and SDA // - CN5 Pin 10 (PB8/SCL) and CN5 ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/wdg.rs
examples/stm32f0/src/bin/wdg.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::wdg::IndependentWatchdog; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { // Initialize and create handle for devicer peripherals let p = embassy...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/adc-watchdog.rs
examples/stm32f0/src/bin/adc-watchdog.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::adc::{self, Adc, SampleTime, WatchdogChannels}; use embassy_stm32::bind_interrupts; use embassy_stm32::peripherals::ADC1; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { ADC1_COMP => adc::InterruptHandler...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/button_controlled_blink.rs
examples/stm32f0/src/bin/button_controlled_blink.rs
//! This example showcases how to create task #![no_std] #![no_main] use core::sync::atomic::{AtomicU32, Ordering}; use defmt::info; use embassy_executor::Spawner; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::{AnyPin, Level, Output, Pull, Speed}; use embassy_stm32::{Peri, bind_interrupts, int...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/button_exti.rs
examples/stm32f0/src/bin/button_exti.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::exti::{self, ExtiInput}; use embassy_stm32::gpio::Pull; use embassy_stm32::{bind_interrupts, interrupt}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!( pub struct Irqs{ EXTI4_15 => exti::InterruptHandler<inte...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/hello.rs
examples/stm32f0/src/bin/hello.rs
#![no_std] #![no_main] use defmt::info; use embassy_executor::Spawner; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { let _p = embassy_stm32::init(Default::default()); loop { Timer::after_secs(1).await; info!("...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/multiprio.rs
examples/stm32f0/src/bin/multiprio.rs
//! This example showcases how to create multiple Executor instances to run tasks at //! different priority levels. //! //! Low priority executor runs in thread mode (not interrupt), and uses `sev` for signaling //! there's work in the queue, and `wfe` for waiting for work. //! //! Medium and high priority executors ru...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/adc.rs
examples/stm32f0/src/bin/adc.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::adc::{Adc, SampleTime}; use embassy_stm32::peripherals::ADC1; use embassy_stm32::{adc, bind_interrupts}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { ADC1_COMP => adc::Interrup...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32f0/src/bin/blinky.rs
examples/stm32f0/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_stm32::gpio::{Level, Output, Speed}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; // main is itself an async function. #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Defaul...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/nrf9160/build.rs
examples/nrf9160/build.rs
//! This build script copies the `memory.x` file from the crate root into //! a directory where the linker can always find it at build time. //! For many projects this is optional, as the linker always searches the //! project root directory -- wherever `Cargo.toml` is. However, if you //! are using a workspace or have...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/nrf9160/src/bin/modem_tcp_client.rs
examples/nrf9160/src/bin/modem_tcp_client.rs
#![no_std] #![no_main] use core::mem::MaybeUninit; use core::net::IpAddr; use core::ptr::addr_of_mut; use core::slice; use core::str::FromStr; use defmt::{info, unwrap, warn}; use embassy_executor::Spawner; use embassy_net::{Ipv4Cidr, Stack, StackResources}; use embassy_net_nrf91::context::Status; use embassy_net_nrf...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/nrf9160/src/bin/blinky.rs
examples/nrf9160/src/bin/blinky.rs
#![no_std] #![no_main] use embassy_executor::Spawner; use embassy_nrf::gpio::{Level, Output, OutputDrive}; use embassy_time::Timer; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_nrf::init(Default::default()); let mut led = Output::new(p.P0...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l432/build.rs
examples/stm32l432/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32l432/src/bin/qspi_mmap.rs
examples/stm32l432/src/bin/qspi_mmap.rs
#![no_std] #![no_main] #![allow(dead_code)] /// This example demonstrates how to use the QSPI peripheral in both indirect-mode and memory-mapped mode. /// If you want to test this example, please pay attention to flash pins and check flash device datasheet /// to make sure operations in this example are compatible with...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3519/build.rs
examples/mspm0g3519/build.rs
//! This build script copies the `memory.x` file from the crate root into //! a directory where the linker can always find it at build time. //! For many projects this is optional, as the linker always searches the //! project root directory -- wherever `Cargo.toml` is. However, if you //! are using a workspace or have...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3519/src/bin/button.rs
examples/mspm0g3519/src/bin/button.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::Config; use embassy_mspm0::gpio::{Input, Level, Output, Pull}; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { info!("Hello world!"); let p = embassy_mspm0::init(Con...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3519/src/bin/uart.rs
examples/mspm0g3519/src/bin/uart.rs
//! Example of using blocking uart //! //! This uses the virtual COM port provided on the LP-MSPM0G3519 board. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::uart::{Config, Uart}; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner)...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3519/src/bin/wwdt.rs
examples/mspm0g3519/src/bin/wwdt.rs
//! Example of using window watchdog timer in the MSPM0G3519 chip. //! //! It tests the use case when watchdog timer is expired and when watchdog is pet too early. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::gpio::{Level, Output}; use embassy_mspm0::wwdt::{ClosedWindowPercen...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0g3519/src/bin/blinky.rs
examples/mspm0g3519/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::Config; use embassy_mspm0::gpio::{Level, Output}; use embassy_time::Timer; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { info!("Hello world!"); let p = embassy_mspm...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0l2228/build.rs
examples/mspm0l2228/build.rs
//! This build script copies the `memory.x` file from the crate root into //! a directory where the linker can always find it at build time. //! For many projects this is optional, as the linker always searches the //! project root directory -- wherever `Cargo.toml` is. However, if you //! are using a workspace or have...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0l2228/src/bin/button.rs
examples/mspm0l2228/src/bin/button.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::Config; use embassy_mspm0::gpio::{Input, Level, Output, Pull}; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { info!("Hello world!"); let p = embassy_mspm0::init(Con...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0l2228/src/bin/uart.rs
examples/mspm0l2228/src/bin/uart.rs
//! Example of using blocking uart //! //! This uses the virtual COM port provided on the LP-MSPM0L2228 board. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::uart::{Config, Uart}; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner)...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0l2228/src/bin/wwdt.rs
examples/mspm0l2228/src/bin/wwdt.rs
//! Example of using window watchdog timer in the MSPM0L2228 chip. //! //! It tests the use case when watchdog timer is expired and when watchdog is pet too early. #![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::gpio::{Level, Output}; use embassy_mspm0::wwdt::{ClosedWindowPercen...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/mspm0l2228/src/bin/blinky.rs
examples/mspm0l2228/src/bin/blinky.rs
#![no_std] #![no_main] use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::Config; use embassy_mspm0::gpio::{Level, Output}; use embassy_time::Timer; use {defmt_rtt as _, panic_halt as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) -> ! { info!("Hello world!"); let p = embassy_mspm...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wl5x-lp/build.rs
examples/stm32wl5x-lp/build.rs
fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/examples/stm32wl5x-lp/src/bin/blinky.rs
examples/stm32wl5x-lp/src/bin/blinky.rs
// This example is configured for the nucleo-wl55jc board. Curret monitor should show just a few microamps when the device is in stop2 mode. #![no_std] #![no_main] use core::mem::MaybeUninit; use defmt::*; #[cfg(feature = "defmt-rtt")] use defmt_rtt as _; use embassy_executor::Spawner; use embassy_stm32::SharedData; ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false