#[repr(C)]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)
11fn main() {
12 let mut spi = unsafe { util::get_spi() };
13
14 eprintln!("SPI HSFSTS_CTL: {:?}", spi.regs.hsfsts_ctl());
15
16 let len = spi.len().unwrap();
17 eprintln!("SPI ROM: {} KB", len / 1024);
18
19 let mut data = Vec::with_capacity(len);
20 while data.len() < len {
21 let mut buf = [0; 65536];
22 let read = spi.read(data.len(), &mut buf).unwrap();
23 data.extend_from_slice(&buf[..read]);
24 eprint!("\rSPI READ: {} KB", data.len() / 1024);
25 }
26
27 eprintln!();
28
29 fs::write("read.rom", &data).unwrap();
30}
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 Freeze for SpiRegs
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