pub struct R(/* private fields */);Expand description
Register UART_RX_CTRL reader
Implementations§
Source§impl R
impl R
Sourcepub fn stop_bits(&self) -> FieldReaderRaw<u8, u8>
pub fn stop_bits(&self) -> FieldReaderRaw<u8, u8>
Bits 0:2 - Stop bits. STOP_BITS + 1 is the duration of the stop period in terms of half bit periods. Valid range is [1, 7]; i.e. a stop period should last at least one bit period. Note that in case of a stop bits error, the successive data frames may get lost as the receiver needs to resynchronize its start bit detection. The amount of lost data frames depends on both the amount of stop bits, the idle time between data frames and the data frame value.
Sourcepub fn parity(&self) -> BitReaderRaw<bool>
pub fn parity(&self) -> BitReaderRaw<bool>
Bit 4 - Parity bit. When ‘0’, the receiver expects an even parity. When ‘1’, the receiver expects an odd parity. Only applicable in standard UART and SmartCard submodes.
Sourcepub fn parity_enabled(&self) -> BitReaderRaw<bool>
pub fn parity_enabled(&self) -> BitReaderRaw<bool>
Bit 5 - Parity checking enabled (‘1’) or not (‘0’). Only applicable in standard UART submode. In SmartCard submode, parity checking is always enabled through hardware. In IrDA submode, parity checking is always disabled through hardware.
Sourcepub fn polarity(&self) -> BitReaderRaw<bool>
pub fn polarity(&self) -> BitReaderRaw<bool>
Bit 6 - Inverts incoming RX line signal. Inversion is after local loopback. This functionality is intended for IrDA receiver functionality.
Sourcepub fn drop_on_parity_error(&self) -> BitReaderRaw<bool>
pub fn drop_on_parity_error(&self) -> BitReaderRaw<bool>
Bit 8 - Behavior when a parity check fails. When ‘0’, received data is sent to the RX FIFO. When ‘1’, received data is dropped and lost. Only applicable in standard UART and SmartCard submodes (negatively acknowledged SmartCard data frames may be dropped with this field).
Sourcepub fn drop_on_frame_error(&self) -> BitReaderRaw<bool>
pub fn drop_on_frame_error(&self) -> BitReaderRaw<bool>
Bit 9 - Behavior when an error is detected in a start or stop period. When ‘0’, received data is sent to the RX FIFO. When ‘1’, received data is dropped and lost.
Sourcepub fn mp_mode(&self) -> BitReaderRaw<bool>
pub fn mp_mode(&self) -> BitReaderRaw<bool>
Bit 10 - Multi-processor mode. When ‘1’, multi-processor mode is enabled. In this mode, RX_CTRL.DATA_WIDTH should indicate a 9-bit data frame. In multi-processor mode, the 9th received bit of a data frame separates addresses (bit is ‘1’) from data (bit is ‘0’). A received address is matched with RX_MATCH.DATA and RX_MATCH.MASK. In the case of a match, subsequent received data are sent to the RX FIFO. In the case of NO match, subsequent received data are dropped.
Sourcepub fn lin_mode(&self) -> BitReaderRaw<bool>
pub fn lin_mode(&self) -> BitReaderRaw<bool>
Bit 12 - Only applicable in standard UART submode. When ‘1’, the receiver performs break detection and baud rate detection on the incoming data. First, break detection counts the amount of bit periods that have a line value of ‘0’. BREAK_WIDTH specifies the minimum required amount of bit periods. Successful break detection sets the INTR_RX.BREAK_DETECT interrupt cause to ‘1’. Second, baud rate detection counts the amount of peripheral clock periods that are use to receive the synchronization byte (0x55; least significant bit first). The count is available through UART_RX_STATUS.BR_COUNTER. Successful baud rate detection sets the INTR_RX.BAUD_DETECT interrupt cause to ‘1’ (BR_COUNTER is reliable). This functionality is used to synchronize/refine the receiver clock to the transmitter clock. The receiver software can use the BR_COUNTER value to set the right IP clock (from the programmable clock IP) to guarantee successful receipt of the first LIN data frame (Protected Identifier Field) after the synchronization byte.
Sourcepub fn skip_start(&self) -> BitReaderRaw<bool>
pub fn skip_start(&self) -> BitReaderRaw<bool>
Bit 13 - Only applicable in standard UART submode. When ‘1’, the receiver skips start bit detection for the first received data frame. Instead, it synchronizes on the first received data frame bit, which should be a ‘1’. This functionality is intended for wake up from DeepSleep when receiving a data frame. The transition from idle (‘1’) to START (‘0’) on the RX line is used to wake up the CPU. The transition detection (and the associated wake up functionality) is performed by the GPIO2 IP. The woken up CPU will enable the SCB’s UART receiver functionality. Once enabled, it is assumed that the START bit is ongoing (the CPU wakeup and SCB enable time should be less than the START bit period). The SCB will synchronize to a ‘0’ to ‘1’ transition, which indicates the first data frame bit is received (first data frame bit should be ‘1’). After synchronization to the first data frame bit, the SCB will resume normal UART functionality: subsequent data frames will be synchronized on the receipt of a START bit.
Sourcepub fn break_width(&self) -> FieldReaderRaw<u8, u8>
pub fn break_width(&self) -> FieldReaderRaw<u8, u8>
Bits 16:19 - Break width. BREAK_WIDTH + 1 is the minimum width in bit periods of a break. During a break the transmitted/received line value is ‘0’. This feature is useful for standard UART submode and LIN submode (‘break field’ detection). Once, the break is detected, the INTR_RX.BREAK_DETECT bit is set to ‘1’. Note that break detection precedes baud rate detection, which is used to synchronize/refine the receiver clock to the transmitter clock. As a result, break detection operates with an unsynchronized/unrefined receiver clock. Therefore, the receiver’s definition of a bit period is imprecise and the setting of this field should take this imprecision into account. The LIN standard also accounts for this imprecision: a LIN start bit followed by 8 data bits allows for up to 9 consecutive ‘0’ bit periods during regular transmission, whereas the LIN break detection should be at least 13 consecutive ‘0’ bit periods. This provides for a margin of 4 bit periods. Therefore, the default value of this field is set to 10, representing a minimal break field with of 10+1 = 11 bit periods; a value in between the 9 consecutive bit periods of a regular transmission and the 13 consecutive bit periods of a break field. This provides for slight imprecisions of the receiver clock wrt. the transmitter clock. There should not be a need to program this field to any value other than its default value.
Sourcepub fn break_level(&self) -> BitReaderRaw<bool>
pub fn break_level(&self) -> BitReaderRaw<bool>
Bit 24 - 0: low level pulse detection, like Break field in LIN protocol 1: high level pulse detection, like IFS field in CXPI protocol, or idle line state in UART
Methods from Deref<Target = R<UART_RX_CTRL_SPEC>>§
Sourcepub fn bits(&self) -> <REG as RegisterSpec>::Ux
pub fn bits(&self) -> <REG as RegisterSpec>::Ux
Reads raw bits from register.