[][src]Crate embedded_spi

Embedded SPI helper package This defines a higher level Transactional SPI interface, as well as an SPI Transaction enumeration that more closely map to the common uses of SPI peripherals, as well as some other common driver helpers.

An embedded_spi::wrapper::Wrapper type is provided to wrap existing SPI implementations in this embedded_spi::Transactional interface, as well as a set of helpers for C compatibility enabled with the compat feature, and a basic mocking adaptor enabled with the mock feature.

Modules

ffi

Compatibility shims to allow C use of rust SPI peripherals This module provides mechanisms to convert an abstract Wrapper object to and from c void pointers, as well as C ffi compatible spi_read and spi_write functions using these context pointers.

mock
utils
wrapper

Transactional SPI wrapper implementation This provides a Wrapper type that is generic over an embedded_hal::blocking::spi and embedded_hal::digital::v2::OutputPin to provide a transactional API for SPI transactions.

Enums

Error

Error type combining SPI and Pin errors for utility

PinState

PinState enum used for busy indication

Transaction

Transaction enum defines possible SPI transactions

Traits

Busy

Busy trait for peripherals that support a busy signal

Ready

Ready trait for peripherals that support a ready signal (or IRQ)

Reset

Reset trait for peripherals that have a reset or shutdown pin

Transactional

Transaction trait provides higher level, transaction-based, SPI constructs These are executed in a single SPI transaction (without de-asserting CS).