xistor 910619de4c fix missing semicolon | 1 سال پیش | |
---|---|---|
.. | ||
Makefile | 5 سال پیش | |
Makefile.clang | 2 سال پیش | |
Makefile.gcc | 2 سال پیش | |
OLVASSEL.md | 7 سال پیش | |
README.md | 7 سال پیش | |
delays.c | 1 سال پیش | |
delays.h | 7 سال پیش | |
gpio.h | 7 سال پیش | |
kernel8.img | 4 سال پیش | |
link.ld | 7 سال پیش | |
main.c | 7 سال پیش | |
mbox.c | 6 سال پیش | |
mbox.h | 7 سال پیش | |
start.S | 3 سال پیش | |
uart.c | 3 سال پیش | |
uart.h | 7 سال پیش |
It is very important to wait precise amounts of time while you're interfacing with low level hardware. In this tutorial we'll cover there ways. One is CPU frequency dependent (and useful if wait time is given in CPU clock cycles), the other two are microsec (millionth of a second) based.
wait_cycles(n)
this is a very straightforward thing, we execute the 'nop' instruction n times.
wait_msec(n)
this implementation uses ARM system registers (available on all AArch64 CPUs).
wait_msec_st(n)
is a BCM specific implementation, which uses the System Timer peripheral (not available on qemu).
We use different wait implementations between printing strings on serial console.