embedded-trainings-2020/down-the-stack/apps/src/bin/uarte_print.rs

29 lines
728 B
Rust
Raw Normal View History

2023-02-14 17:48:13 +00:00
#![no_main]
#![no_std]
use cortex_m::asm;
use cortex_m_rt::entry;
use core::fmt::Write;
2023-02-27 16:01:02 +00:00
2023-02-21 15:22:03 +00:00
// this imports `down-the-stack/apps/lib.rs` to retrieve our global logger + panicking-behavior
2023-02-14 17:48:13 +00:00
use apps as _;
2023-03-10 16:13:28 +00:00
// ⚠️ ⚠️ ⚠️ Don't change this file! ⚠️ ⚠️ ⚠️
2023-02-14 17:48:13 +00:00
#[entry]
fn main() -> ! {
// to enable more verbose logs, go to your `Cargo.toml` and set defmt logging levels
// to `defmt-trace` by changing the `default = []` entry in `[features]`
2023-02-21 12:20:04 +00:00
let board = dk_bsc::init().unwrap();
2023-02-14 17:48:13 +00:00
let mut uarte = board.uarte;
2023-02-27 16:01:02 +00:00
2023-03-07 16:53:42 +00:00
let tx_buffer = "Hello, World!\n";
2023-02-27 16:01:02 +00:00
uarte.write_str(tx_buffer).unwrap();
2023-02-14 17:48:13 +00:00
2023-02-21 15:22:03 +00:00
// this program does not `exit`; use Ctrl+C to terminate it
2023-02-14 17:48:13 +00:00
loop {
2023-02-27 16:01:02 +00:00
asm::nop();
2023-02-14 17:48:13 +00:00
}
}