tg-clock-0.1.0 has been yanked.
tg-clock
A tiny no_std clock helper crate for bare-metal RISC-V S-mode experiments.
It provides a minimal timer setup flow used in rCore tutorial style kernels:
- enable S-mode timer interrupts
- read current
timeCSR - schedule next timer event via SBI
Installation
[]
= "0.1.0"
Minimal Example
use ;
API Summary
init()- enables
sstatus.SIEandsie.STIE - schedules the first timer event
- enables
clock_set_next_event()- programs next timer interrupt through SBI
set_timer
- programs next timer interrupt through SBI
get_time() -> usize- reads current value from RISC-V
timeCSR
- reads current value from RISC-V
Notes
- Target:
riscv64gc-unknown-none-elf - Runtime: bare-metal /
no_std - Requires SBI implementation compatible with
tg-rcore-tutorial-sbi