You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andre Richter 4f4e88cfbe
Update binaries generated by newer rustc
5 years ago
..
.cargo Use aarch64-unknown-none target in nightly 🎉 6 years ago
raspi3_boot Add missing comment that triggered build errors in new nightly rust. 6 years ago
src Fix correct term usec for microseconds 6 years ago
Cargo.lock 🎉 Update to Rust 2018 🎉 6 years ago
Cargo.toml 🎉 Update to Rust 2018 🎉 6 years ago
Makefile Streamlining, cleanup, and minor fixes. 6 years ago
README.md Fix correct term usec for microseconds 6 years ago
kernel8 Update binaries generated by newer rustc 5 years ago
kernel8.img Add missing comment that triggered build errors in new nightly rust. 6 years ago
link.ld Alignment. Binaries from newer Rust version. 6 years ago

README.md

Tutorial 09 - Delays

It is very important to wait precise amounts of time while you are interfacing with low level hardware. In this tutorial, we'll cover thee ways. One is CPU frequency dependent (and useful if wait time is given in CPU clock cycles), the other two are µs based.

delays.rs

delays::wait_cycles(cyc: u32) this is very straightforward, we execute the nop instruction n times.

delays::wait_usec(n: u32) this implementation uses ARM system registers (available on all AArch64 CPUs).

delays::SysTmr::wait_usec_st(&self, n: u64) is a BCM specific implementation, which uses the System Timer peripheral (not available on qemu).

uart.rs

We can now conveniently use delays::wait_cycles() in Uart::init().

main.rs

We test our different wait implementations.