pub struct Parts<'a, SD>where
SD: Comms + 'a,{
pub spi: SPI<'a, SD>,
pub cs: CS<'a, SD>,
pub pin_a: PinA<'a, SD>,
pub pin_b: PinB<'a, SD>,
}Expand description
Parts is a container for the various parts of a SPIDriver that can be
used separately via distinct HAL traits.
The HAL objects inside a particular Parts all share a single underlying
communications channel, so it is not possible to access them concurrently
on multiple threads. Instead, coordinate all interactions with a single
SPIDriver on a single thread.
Fields§
§spi: SPI<'a, SD>spi is an implementation of the blocking SPI Write and Transfer
traits with an 8-bit word size.
cs: CS<'a, SD>cs is an implementation of the digital I/O OutputPin trait that
controls the SPIDriver’s Chip Select pin.
Setting this pin to low is implemented as “select” on the SPIDriver and setting it to high is implemented as “unselect”, for consistency with the way driver crates tend to expect a CS pin to behave.
pin_a: PinA<'a, SD>pin_a is an implementation of the digital I/O OutputPin trait that
controls the SPIDriver’s auxillary output pin “A”.
pin_b: PinB<'a, SD>pin_a is an implementation of the digital I/O OutputPin trait that
controls the SPIDriver’s auxillary output pin “B”.