sync_api/
sync_api.rs

1use core::ptr::NonNull;
2
3use arm_pl011_rs::{Config, DataBits, Parity, Pl011, StopBits};
4use embedded_io::*;
5
6pub fn write() {
7    let mut uart = Pl011::new_sync(
8        NonNull::new(0x0900_0000 as *mut u8).unwrap(),
9        Some(Config {
10            baud_rate: 115200,
11            clock_freq: 24000000,
12            data_bits: DataBits::Bits8,
13            stop_bits: StopBits::STOP1,
14            parity: Parity::None,
15        }),
16    );
17
18    uart.write_all("uart output\n".as_bytes());
19}