diff --git a/rp2040-hal/src/uart/pins.rs b/rp2040-hal/src/uart/pins.rs index 0cbfb03..8de6687 100644 --- a/rp2040-hal/src/uart/pins.rs +++ b/rp2040-hal/src/uart/pins.rs @@ -1,8 +1,10 @@ use crate::gpio::{bank0, FunctionUart, Pin}; use crate::pac::{UART0, UART1}; +use super::UartDevice; + /// Declares a valid UART pinout. -pub trait ValidUartPinout { +pub trait ValidUartPinout { /// Indicates TX should be enabled for this pinout const TX_ENABLED: bool; /// Indicates RX should be enabled for this pinout @@ -15,6 +17,7 @@ pub trait ValidUartPinout { impl ValidUartPinout for Pins where + UART: UartDevice, TX: Tx, RX: Rx, CTS: Cts, @@ -28,6 +31,7 @@ where impl ValidUartPinout for (TX, RX) where + UART: UartDevice, TX: Tx, RX: Rx, { @@ -39,6 +43,7 @@ where impl ValidUartPinout for (TX, RX, CTS, RTS) where + UART: UartDevice, TX: Tx, RX: Rx, CTS: Cts, @@ -136,36 +141,36 @@ impl Pins { } /// Indicates a valid TX pin for UART0 or UART1 -pub trait Tx { +pub trait Tx { #[allow(missing_docs)] const ENABLED: bool; } /// Indicates a valid RX pin for UART0 or UART1 -pub trait Rx { +pub trait Rx { #[allow(missing_docs)] const ENABLED: bool; } /// Indicates a valid CTS pin for UART0 or UART1 -pub trait Cts { +pub trait Cts { #[allow(missing_docs)] const ENABLED: bool; } /// Indicates a valid RTS pin for UART0 or UART1 -pub trait Rts { +pub trait Rts { #[allow(missing_docs)] const ENABLED: bool; } -impl Tx for () { +impl Tx for () { const ENABLED: bool = false; } -impl Rx for () { +impl Rx for () { const ENABLED: bool = false; } -impl Cts for () { +impl Cts for () { const ENABLED: bool = false; } -impl Rts for () { +impl Rts for () { const ENABLED: bool = false; }