pub struct SpiDev<'m, M: Mapper> {
pub regs: &'m mut SpiRegs,
/* private fields */
}
51
52
53
54
55
pub unsafe fn get_spi() -> SpiDev<'static, LinuxMapper> {
static mut LINUX_MAPPER: LinuxMapper = LinuxMapper;
let mcfg = fs::read("/sys/firmware/acpi/tables/MCFG").expect("failed to read MCFG");
SpiDev::new(&mcfg, &mut LINUX_MAPPER).expect("failed to get SPI device")
}
Executes the destructor for this type.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.