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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

WIP: RP2040 PIO UART #248

wants to merge 14 commits into from

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

@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

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.

3 participants