From aa3fe8fd2023e02a7c7ea22ea43533a49ccf23dc Mon Sep 17 00:00:00 2001 From: Nic0w Date: Sun, 25 Apr 2021 20:25:29 +0200 Subject: [PATCH] Disable the UART for real when disabling UART. --- rp2040-hal/src/uart.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rp2040-hal/src/uart.rs b/rp2040-hal/src/uart.rs index d04b054..f68ac21 100644 --- a/rp2040-hal/src/uart.rs +++ b/rp2040-hal/src/uart.rs @@ -184,6 +184,15 @@ impl UARTPeripheral { /// Disable this UART Peripheral, falling back to the Disabled state. pub fn disable(self) -> UARTPeripheral { + + // 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) }