Struct bcm2709_spi::DirectMemory
[−]
[src]
pub struct DirectMemory { /* fields omitted */ }
Interface for getting structs to map to /dev/mem blocks
Methods
impl DirectMemory
[src]
Lifetimes and mmap(...) access:
On file descriptor close, memory is not unmapped. From POSIX, the memory mapped from a file can continue to be used until it is unmapped, even if the file is closed before the unmap.
This means that the GPIO and SPI (mmapped access) to /dev/mem can remain active and call munmap(...) when Dropped, which will fully close out the resource.
pub fn get() -> Result<Self, &'static str>
[src]
Opens /dev/mem; may not succeed.
pub fn gpio(&mut self) -> Result<GPIOInterface, &'static str>
[src]
Creates the GPIO interface
pub fn spi(&mut self) -> Result<SPIInterface, &'static str>
[src]
Creates the SPI interface; takes ownership via GPIO of all SPI pins: SPI_CE1, SPI_CE0, SPI_MISO, SPI_MOSI, SPI_CLK