Struct spidev::Spidev [] [src]

pub struct Spidev {
    // some fields omitted
}

Provide high-level access to Linux Spidev Driver

Methods

impl Spidev

fn open<P: AsRef<Path>>(path: P) -> Result<Spidev>

Open the spidev device with the provided path

Typically, the path will be something like "/dev/spidev0.0" where the first number if the bus and the second number is the chip select on that bus for the device being targetted.

fn configure(&mut self, options: &SpidevOptions) -> Result<()>

Write the provided configuration to this device

fn transfer(&self, transfer: &mut SpidevTransfer) -> Result<()>

Perform a single transfer

fn transfer_multiple(&self, transfers: &Vec<SpidevTransfer>) -> Result<()>

Perform multiple transfers in a single system call to the kernel

Chaining together multiple requests like this can reduce latency and be used for conveniently and efficient implementing some protocols without extra round trips back to userspace.

Trait Implementations

impl Read for Spidev

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl Write for Spidev

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write