[][src]Crate spidriver

SPIDriver client library

This library implements the SPIDriver protocol, allowing Rust programs to interact with an SPIDriver device and in turn to interact with SPI devices.

The entry point is SPIDriver::new, which takes (and consumes) a serial writer and a serial reader as defined by embedded_hal::serial. If you are running on a general computing platform then you can use serial_embedded_hal to connect with a serial port provided by your operating system:

let port = Serial::new(
    "/dev/ttyUSB0",
    &PortSettings {
        baud_rate: serial_embedded_hal::BaudRate::BaudOther(460800),
        char_size: serial_embedded_hal::CharSize::Bits8,
        parity: serial_embedded_hal::Parity::ParityNone,
        stop_bits: serial_embedded_hal::StopBits::Stop1,
        flow_control: serial_embedded_hal::FlowControl::FlowNone,
    },
)?;
let (tx, rx) = port.split();
let sd = SPIDriver::new(tx, rx);

Structs

SPIDriver

SPIDriver represents a connected SPIDriver device.

Enums

Error

Error represents communication errors.