[][src]Crate spidriver_hal

SPIDriver implementations of some embedded-hal traits.

This library provides implementations of several embedded-hal crates in terms of the SPIDriver protocol. This allows driver crates that are written in terms of those traits to control their corresponding devices via an SPIDriver module.

Specifically, this library provides:

  • Implementations of the blocking SPI Write and Transfer traits that transmit data via the SPIDriver.
  • An implementation of the v2 Digital IO OutputPin trait for the chip select output of the SPIDriver.
  • Implementations of the v2 Digital IO OutputPin trait for the auxillary output pins A and B on the SPIDriver.

To use it, first instantiate and configure an SPIDriver object from the spidriver crate, and then pass it to SPIDriverHAL::new before calling split to obtain the individual interface objects:

let sd = SPIDriver::new(rx, tx); // rx and tx obtained from some underlying platform crate
let parts = SPIDriverHAL::new(sd).split();





SPIDriverHAL is the entry point for this library.