Closed DmitriLyalikov closed 1 year ago
The current SPI traits are intentionally for SPI master mode only. The reason is for slave mode the API should be different, so it should be a different trait, not a "mode" bit in the existing trait. See previous discussion at https://github.com/rust-embedded/embedded-hal/pull/396
I am working on a downstream implementation for a spi slave, and would like to ask, is there a reason that the Spi Mode struct does not include a master or slave type as well? I would like to add this, and I am working actually on the driver for the rp2040 hal. What is the philosophy for not doing this at the generic hal level?
/// SPI mode
[derive(Clone, Copy, PartialEq, Eq)]
pub struct Mode { /// Clock polarity pub polarity: Polarity, /// Clock phase pub phase: Phase, }