Skip to content
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

WIP: RP2040 PIO UART #248

Merged
merged 21 commits into from
Feb 24, 2025
Merged

WIP: RP2040 PIO UART #248

merged 21 commits into from
Feb 24, 2025

Conversation

grabpot
Copy link

@grabpot grabpot commented Jan 15, 2025

First draft of implementing a half-duplex, single wire UART serial driver, BufferedHalfDuplexUart, using the RP2040 PIO subsystem. Requires PR #235. Not complete, and still to do, in no particular order:

  • rp2040_pio feature and optional dependencies
  • RP module and PIO UART implementation
  • Rust example project
  • Refactor IRQ handling to use Embassy tasks
  • Code and Example keyboard.toml configuration
  • Add support for full-duplex UART on any pin
  • Write documentation

Sorry, something went wrong.

@whitelynx
Copy link
Contributor

@grabpot I think full-duplex could probably be pushed out to a separate PR, if that would help. It would be nice to get this one merged.

Stuart Andrews added 2 commits January 30, 2025 18:30
* Added new_half_duplex() and new_full_duplex() methods,
  where the former accepts one pin/buffer and the latter two
* In Half Duplex mode, write() disables RX SM, writes buffer
  to TX FIFO, waiting for TX_NFULL interrupt if necessary,
  then re-enables RX SM
* In Full Duplex mode, write() adds buffer to internal ring
  buffer, enables TX_NFULL interrupt and returns. Interrupt
  is then responsible for pushing data into TX FIFO.
* In both modes, TX SM is programmed to toggle pin direction,
  rather than pin level
@hitsmaxft
Copy link

hitsmaxft commented Jan 31, 2025

My wired lily58 use pio and half duplex uart, looking forward a milestone for testing

Stuart Andrews added 2 commits February 19, 2025 18:47
@HaoboGu
Copy link
Owner

HaoboGu commented Feb 20, 2025

@grabpot Thanks very much! Looks good to me. Can I get this PR merged now?

Stuart Andrews added 2 commits February 22, 2025 10:20
@grabpot
Copy link
Author

grabpot commented Feb 22, 2025

Single wire half-duplex is tested and working, both rust and config examples.
@whitelynx Would you be able test full-duplex on your Svalboard?

Stuart Andrews added 2 commits February 22, 2025 21:58
@HaoboGu
Copy link
Owner

HaoboGu commented Feb 24, 2025

Seems no issue for this PR, I'm merging it. Thanks very much @grabpot

@HaoboGu HaoboGu merged commit 652e059 into HaoboGu:main Feb 24, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants