mirror of
https://github.com/iceHtwoO/novaOS.git
synced 2026-04-17 04:32:27 +00:00
migrate read and write volatile to a function
This commit is contained in:
11
src/lib.rs
11
src/lib.rs
@@ -1,6 +1,17 @@
|
||||
#![no_std]
|
||||
|
||||
use core::ptr::{read_volatile, write_volatile};
|
||||
|
||||
pub mod peripherals;
|
||||
|
||||
pub mod irq_interrupt;
|
||||
pub mod mailbox;
|
||||
pub mod timer;
|
||||
|
||||
pub fn mmio_read(address: u32) -> u32 {
|
||||
unsafe { read_volatile(address as *const u32) }
|
||||
}
|
||||
|
||||
pub fn mmio_write(address: u32, data: u32) {
|
||||
unsafe { write_volatile(address as *mut u32, data) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user