Document that UART TX should be set up first
This commit is contained in:
parent
9f553b1b0e
commit
706879e085
@ -830,6 +830,11 @@ where
|
||||
/// Assign the RX pin for UART instance.
|
||||
///
|
||||
/// Sets the specified pin to input and connects it to the UART RX signal.
|
||||
///
|
||||
/// Note: when you listen for the output of the UART peripheral, you should
|
||||
/// configure the driver side (i.e. the TX pin), or ensure that the line is
|
||||
/// initially high, to avoid receiving a non-data byte caused by an
|
||||
/// initial low signal level.
|
||||
pub fn with_rx(self, rx: impl Peripheral<P = impl PeripheralInput> + 'd) -> Self {
|
||||
crate::into_mapped_ref!(rx);
|
||||
rx.init_input(Pull::Up, Internal);
|
||||
@ -1046,6 +1051,11 @@ where
|
||||
/// Assign the RX pin for UART instance.
|
||||
///
|
||||
/// Sets the specified pin to input and connects it to the UART RX signal.
|
||||
///
|
||||
/// Note: when you listen for the output of the UART peripheral, you should
|
||||
/// configure the driver side (i.e. the TX pin), or ensure that the line is
|
||||
/// initially high, to avoid receiving a non-data byte caused by an
|
||||
/// initial low signal level.
|
||||
pub fn with_rx(self, rx: impl Peripheral<P = impl PeripheralInput> + 'd) -> Self {
|
||||
crate::into_mapped_ref!(rx);
|
||||
rx.init_input(Pull::Up, Internal);
|
||||
|
||||
@ -26,9 +26,7 @@ mod tests {
|
||||
fn init() -> Context {
|
||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
||||
|
||||
let (_, pin) = hil_test::common_test_pins!(peripherals);
|
||||
|
||||
let (rx, tx) = pin.split();
|
||||
let (rx, tx) = hil_test::common_test_pins!(peripherals);
|
||||
|
||||
let uart = Uart::new(peripherals.UART1, uart::Config::default())
|
||||
.unwrap()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user