pub struct W(_);
Expand description
Register CR2
writer
Implementations
sourceimpl W
impl W
sourcepub fn slven(&mut self) -> SLVEN_W<'_, 0>
pub fn slven(&mut self) -> SLVEN_W<'_, 0>
Bit 0 - Synchronous Slave mode enable When the SLVEN bit is set, the synchronous slave mode is enabled. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn dis_nss(&mut self) -> DIS_NSS_W<'_, 3>
pub fn dis_nss(&mut self) -> DIS_NSS_W<'_, 3>
Bit 3 - When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn addm7(&mut self) -> ADDM7_W<'_, 4>
pub fn addm7(&mut self) -> ADDM7_W<'_, 4>
Bit 4 - 7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UEÂ =Â 0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively.
sourcepub fn lbdl(&mut self) -> LBDL_W<'_, 5>
pub fn lbdl(&mut self) -> LBDL_W<'_, 5>
Bit 5 - LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn lbdie(&mut self) -> LBDIE_W<'_, 6>
pub fn lbdie(&mut self) -> LBDIE_W<'_, 6>
Bit 6 - LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn lbcl(&mut self) -> LBCL_W<'_, 8>
pub fn lbcl(&mut self) -> LBCL_W<'_, 8>
Bit 8 - Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn cpha(&mut self) -> CPHA_W<'_, 9>
pub fn cpha(&mut self) -> CPHA_W<'_, 9>
Bit 9 - Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn cpol(&mut self) -> CPOL_W<'_, 10>
pub fn cpol(&mut self) -> CPOL_W<'_, 10>
Bit 10 - Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn clken(&mut self) -> CLKEN_W<'_, 11>
pub fn clken(&mut self) -> CLKEN_W<'_, 11>
Bit 11 - Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UEÂ =Â 0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1
sourcepub fn stop(&mut self) -> STOP_W<'_, 12>
pub fn stop(&mut self) -> STOP_W<'_, 12>
Bits 12:13 - stop bits These bits are used for programming the stop bits. This bitfield can only be written when the USART is disabled (UEÂ =Â 0).
sourcepub fn linen(&mut self) -> LINEN_W<'_, 14>
pub fn linen(&mut self) -> LINEN_W<'_, 14>
Bit 14 - LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UEÂ =Â 0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn swap(&mut self) -> SWAP_W<'_, 15>
pub fn swap(&mut self) -> SWAP_W<'_, 15>
Bit 15 - Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0).
sourcepub fn rxinv(&mut self) -> RXINV_W<'_, 16>
pub fn rxinv(&mut self) -> RXINV_W<'_, 16>
Bit 16 - RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0).
sourcepub fn txinv(&mut self) -> TXINV_W<'_, 17>
pub fn txinv(&mut self) -> TXINV_W<'_, 17>
Bit 17 - TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UEÂ =Â 0).
sourcepub fn datainv(&mut self) -> DATAINV_W<'_, 18>
pub fn datainv(&mut self) -> DATAINV_W<'_, 18>
Bit 18 - Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0).
sourcepub fn msbfirst(&mut self) -> MSBFIRST_W<'_, 19>
pub fn msbfirst(&mut self) -> MSBFIRST_W<'_, 19>
Bit 19 - Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UEÂ =Â 0).
sourcepub fn abren(&mut self) -> ABREN_W<'_, 20>
pub fn abren(&mut self) -> ABREN_W<'_, 20>
Bit 20 - Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn abrmod(&mut self) -> ABRMOD_W<'_, 21>
pub fn abrmod(&mut self) -> ABRMOD_W<'_, 21>
Bits 21:22 - Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UEÂ =Â 0). Note: If DATAINVÂ =Â 1 and/or MSBFIRSTÂ =Â 1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn rtoen(&mut self) -> RTOEN_W<'_, 23>
pub fn rtoen(&mut self) -> RTOEN_W<'_, 23>
Bit 23 - Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to .
sourcepub fn add(&mut self) -> ADD_W<'_, 24>
pub fn add(&mut self) -> ADD_W<'_, 24>
Bits 24:31 - Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UEÂ =Â 0).
Methods from Deref<Target = W<CR2_SPEC>>
Trait Implementations
Auto Trait Implementations
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