mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 13:01:30 +11:00
Disable the UART for real when disabling UART.
This commit is contained in:
parent
c50a5b6001
commit
aa3fe8fd20
|
@ -184,6 +184,15 @@ impl<D: UARTDevice> UARTPeripheral<Enabled, D> {
|
|||
|
||||
/// Disable this UART Peripheral, falling back to the Disabled state.
|
||||
pub fn disable(self) -> UARTPeripheral<Disabled, D> {
|
||||
|
||||
// Disable the UART, both TX and RX
|
||||
self.device.uartcr.write(|w| {
|
||||
w.uarten().clear_bit();
|
||||
w.txe().clear_bit();
|
||||
w.rxe().clear_bit();
|
||||
w
|
||||
});
|
||||
|
||||
self.transition(Disabled)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue