syscon-rs

Crates.iosyscon-rs
lib.rssyscon-rs
version0.1.1
sourcesrc
created_at2023-01-31 21:56:32.445595
updated_at2023-02-02 03:31:59.962935
descriptionA driver for syscon poweroff, and reboot in rust
homepage
repositoryhttps://github.com/archaic-archea/syscon-rs
max_upload_size
id773055
size3,264
(archaic-archea)

documentation

README

Syscon-rs

A basic syscon-poweroff and syscon-reboot driver. Relies on log and fdt crates.

Usage

extern "C" fn kmain(_hartid: u64, devicetree_ptr: *const u8) {
    // Initialize logger
    
    syscon_rs::init(devicetree_ptr);
    
    syscon_rs::power_off().expect("Failed to power off");
}

Or

extern "C" fn kmain(_hartid: u64, devicetree_ptr: *const u8) {
    // Initialize logger
    
    syscon_rs::init(devicetree_ptr);
    
    syscon_rs::reboot().expect("Failed to reboot");
}
Commit count: 12

cargo fmt