Enum stm32_hal2::spi::SlaveSelect
source · [−]pub enum SlaveSelect {
Software,
HardwareOutEnable,
HardwareOutDisable,
}
Expand description
Used for managing NSS / CS pin. Sets CR1 register, SSM field.
Variants
Software
In this configuration, slave select information is driven internally by the SSI bit value in register SPIx_CR1. The external NSS pin is free for other application uses.
HardwareOutEnable
This configuration is only used when the MCU is set as master. The NSS pin is managed by the hardware. The NSS signal is driven low as soon as the SPI is enabled in master mode (SPE=1), and is kept low until the SPI is disabled (SPE =0). A pulse can be generated between continuous communications if NSS pulse mode is activated (NSSP=1). The SPI cannot work in multimaster configuration with this NSS setting.
HardwareOutDisable
If the microcontroller is acting as the master on the bus, this configuration allows multimaster capability. If the NSS pin is pulled low in this mode, the SPI enters master mode fault state and the device is automatically reconfigured in slave mode. In slave mode, the NSS pin works as a standard “chip select” input and the slave is selected while NSS line is at low level.
Trait Implementations
sourceimpl Clone for SlaveSelect
impl Clone for SlaveSelect
sourcefn clone(&self) -> SlaveSelect
fn clone(&self) -> SlaveSelect
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl PartialEq<SlaveSelect> for SlaveSelect
impl PartialEq<SlaveSelect> for SlaveSelect
impl Copy for SlaveSelect
impl StructuralPartialEq for SlaveSelect
Auto Trait Implementations
impl RefUnwindSafe for SlaveSelect
impl Send for SlaveSelect
impl Sync for SlaveSelect
impl Unpin for SlaveSelect
impl UnwindSafe for SlaveSelect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more