pub struct Rx<I, State> { /* private fields */ }Expand description
USART receiver
Can be accessed through USART.
§embedded-hal traits
embedded_hal::serial::Readfor non-blocking reads
Implementations§
Source§impl<I, W, Mode> Rx<I, Enabled<W, Mode>>
impl<I, W, Mode> Rx<I, Enabled<W, Mode>>
Sourcepub fn start_address_detection(&mut self, address: u8)
pub fn start_address_detection(&mut self, address: u8)
Put the receiver into address detection mode
After this method is called, all received data that does not have the most significant bit set will be ignored. Data that does have the most significant bit set will be matched against the provided address.
While the receiver is operating that way, only matched addresses will be
received. Once you have received a matched address and inspected it to
your satisfaction, you must call stop_address_detection to start
receiving regular data again.
You can call this method multiple times, without calling
stop_address_detection in between. The only effect this has, is to
change the address that is being matched to the one provided by the most
recent call.
Sourcepub fn stop_address_detection(&mut self)
pub fn stop_address_detection(&mut self)
Put the receiver out of address detection mode
After you’ve put the receiver into address detection mode using the
start_address_detection method, you can start receiving data normally
again by calling this method. Typically you would do this after
receiving a matched address.
Calling this method while the receiver is not in address detection mode has no effect.
Sourcepub fn is_flag_set(&self, flag: Flag) -> bool
pub fn is_flag_set(&self, flag: Flag) -> bool
Query whether the provided flag is set
Flags that need to be reset by software will be reset by this operation.
Sourcepub fn enable_interrupts(&mut self, interrupts: Interrupts)
pub fn enable_interrupts(&mut self, interrupts: Interrupts)
Enable interrupts
Enables all interrupts set to true in interrupts. Interrupts set to
false are not affected.
§Example
use lpc8xx_hal::usart;
// Enable only RXRDY and TXRDY, leave other interrupts untouched.
usart.enable_interrupts(usart::Interrupts {
RXRDY: true,
TXRDY: true,
.. usart::Interrupts::default()
});Sourcepub fn disable_interrupts(&mut self, interrupts: Interrupts)
pub fn disable_interrupts(&mut self, interrupts: Interrupts)
Disable interrupts
Disables all interrupts set to true in interrupts. Interrupts set to
false are not affected.
§Example
use lpc8xx_hal::usart;
// Disable only RXRDY and TXRDY, leave other interrupts untouched.
usart.disable_interrupts(usart::Interrupts {
RXRDY: true,
TXRDY: true,
.. usart::Interrupts::default()
});