#[repr(packed(1))]pub struct SpiRegs { /* private fields */ }
Implementations§
source§impl SpiRegs
impl SpiRegs
sourcepub fn hsfsts_ctl(&self) -> HsfStsCtl
pub fn hsfsts_ctl(&self) -> HsfStsCtl
Examples found in repository?
examples/read.rs (line 14)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
fn main() {
let mut spi = unsafe { util::get_spi() };
eprintln!("SPI HSFSTS_CTL: {:?}", spi.regs.hsfsts_ctl());
let len = spi.len().unwrap();
eprintln!("SPI ROM: {} KB", len / 1024);
let mut data = Vec::with_capacity(len);
while data.len() < len {
let mut buf = [0; 65536];
let read = spi.read(data.len(), &mut buf).unwrap();
data.extend_from_slice(&buf[..read]);
eprint!("\rSPI READ: {} KB", data.len() / 1024);
}
eprintln!();
fs::write("read.rom", &data).unwrap();
}
pub fn set_hsfsts_ctl(&mut self, value: HsfStsCtl)
pub fn fdo(&mut self, section: FdoSection, index: u16) -> u32
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SpiRegs
impl Send for SpiRegs
impl Sync for SpiRegs
impl Unpin for SpiRegs
impl UnwindSafe for SpiRegs
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more