-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release Rx, Tx resource back to Pin #748
Comments
You just need to unwrap let (usart, (txpin, rxpin)) = serial.release();
let txpin: gpio::PA9<Output> = txpin.try_into().unwrap(); // Now it is already in `Output<PushPull>>` |
Works! Much thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I have a use case that I need to send a pulse with UART before communicating.
So my approach was to call
set_high
,set_low
anddelay
to send a pulse.But once the USART consumes the pin, I couldn't release the pin back to output pin.
From what I see,
Serial::new()
andSerial::release()
is not bidirectional because Tx takes the ownership of the underlying pin.I was wondering if there's a way to release
Tx
back toPin
?(so I can call into_push_pull_output)
Thanks in advance
The text was updated successfully, but these errors were encountered: