-
Notifications
You must be signed in to change notification settings - Fork 203
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
Implement UART for sercom #1
Conversation
Many thanks for this! I'll have some time to properly review on saturday. |
👌 thanks @wez I'll probably update this a bit this weekend as well so no rush, at the very least I want to add a UART example but I need to clean up some of my code. |
I also pinned the nightly version to |
@wez any chance you've had some time to take a look at this? |
@zklapow sorry for not getting back to you already; I'll look at this tomorrow! |
I've been using this branch, seems to be okay on a samd21g18a. Is there a reason that The version which I'm using is (the struct is only there to get around the orphan issue):
*: since |
@djmcgill glad its working for you! I actually had a commit with implemented the |
Sorry for the long lag in reviewing; this looks great and I've pushed it to master! Many thanks! |
Co-authored-by: Jacob Rosenthal <[email protected]>
…nd USB reset (#154) * samd51 UsbBus: Fix interrupts not enabling & missing events around bus reset Fixes #105. * Only clear endpoint _bank ready_ bit during configuration/protocol-reset * Pair programmin jammin (#1) Co-authored-by: Jacob Rosenthal <[email protected]> * Cleanup ep init logic & improve comments. Co-authored-by: Jacob Rosenthal <[email protected]> * Bump HAL version * cleanup rxstp interrupts Co-authored-by: Jacob Rosenthal <[email protected]> * Remove unnecessary handling of trfail status in poll Co-authored-by: Jacob Rosenthal <[email protected]> Co-authored-by: Jacob Rosenthal <[email protected]>
…155) * samd51 UsbBus: Fix interrupts not enabling & missing events around bus reset Fixes #105. * Only clear endpoint _bank ready_ bit during configuration/protocol-reset * Pair programmin jammin (#1) Co-authored-by: Jacob Rosenthal <[email protected]> * Cleanup ep init logic & improve comments. Co-authored-by: Jacob Rosenthal <[email protected]> * Bump HAL version * cleanup rxstp interrupts Co-authored-by: Jacob Rosenthal <[email protected]> * Remove unnecessary handling of trfail status in poll Co-authored-by: Jacob Rosenthal <[email protected]> * WIP getting USB working on samd21 * samd21 UsbBus: Fix implementation & get itsybitsy_m0 example working * Bump crate versions * Remove dangling reference to uart_debug Co-authored-by: Jacob Rosenthal <[email protected]>
* Refactored method of enabling interrupts. Added 'static bounds to Transfer::new * Removed the need to pass &mut DmaController references to DMA Channels and Transfers * Added waker to Transfers * Waker is now ZST by default * Read/write proxy for DMA channel registers * Refactored DMAC register proxys macro * Finish callback implementation Track a DMAC Transfer's completed status. * Begin implementing DMA enabled SPI transfers for atsamd11/atsamd21 * Some interrupt stuff, Transfer::recycle() (#1) * Extend the API around DMAC interrupts * Fix in DMAC Buffer::dma_ptr() documentation * Introduce DmacError enum * Add DMAC Transfer::recycle() * Fix some CI issues * Fix DMA SPI transfers according to the new Pads API * DmaController::free takes back ownership of the Channels struct * Improve documentation * rustfmt * Add single-buffer recycle methods Transfers can now be recycled on either source, destination, or both. * Added missing #[inline] attributes * Now with lock-free with_chid! * DMA-enabled SPI transfers for thumbv7em targets * Added module-level docs for SPI/DMA transfers Co-authored-by: Ian <[email protected]>
…nd USB reset (atsamd-rs#154) * samd51 UsbBus: Fix interrupts not enabling & missing events around bus reset Fixes atsamd-rs#105. * Only clear endpoint _bank ready_ bit during configuration/protocol-reset * Pair programmin jammin (atsamd-rs#1) Co-authored-by: Jacob Rosenthal <[email protected]> * Cleanup ep init logic & improve comments. Co-authored-by: Jacob Rosenthal <[email protected]> * Bump HAL version * cleanup rxstp interrupts Co-authored-by: Jacob Rosenthal <[email protected]> * Remove unnecessary handling of trfail status in poll Co-authored-by: Jacob Rosenthal <[email protected]> Co-authored-by: Jacob Rosenthal <[email protected]>
…tsamd-rs#155) * samd51 UsbBus: Fix interrupts not enabling & missing events around bus reset Fixes atsamd-rs#105. * Only clear endpoint _bank ready_ bit during configuration/protocol-reset * Pair programmin jammin (atsamd-rs#1) Co-authored-by: Jacob Rosenthal <[email protected]> * Cleanup ep init logic & improve comments. Co-authored-by: Jacob Rosenthal <[email protected]> * Bump HAL version * cleanup rxstp interrupts Co-authored-by: Jacob Rosenthal <[email protected]> * Remove unnecessary handling of trfail status in poll Co-authored-by: Jacob Rosenthal <[email protected]> * WIP getting USB working on samd21 * samd21 UsbBus: Fix implementation & get itsybitsy_m0 example working * Bump crate versions * Remove dangling reference to uart_debug Co-authored-by: Jacob Rosenthal <[email protected]>
* Refactored method of enabling interrupts. Added 'static bounds to Transfer::new * Removed the need to pass &mut DmaController references to DMA Channels and Transfers * Added waker to Transfers * Waker is now ZST by default * Read/write proxy for DMA channel registers * Refactored DMAC register proxys macro * Finish callback implementation Track a DMAC Transfer's completed status. * Begin implementing DMA enabled SPI transfers for atsamd11/atsamd21 * Some interrupt stuff, Transfer::recycle() (atsamd-rs#1) * Extend the API around DMAC interrupts * Fix in DMAC Buffer::dma_ptr() documentation * Introduce DmacError enum * Add DMAC Transfer::recycle() * Fix some CI issues * Fix DMA SPI transfers according to the new Pads API * DmaController::free takes back ownership of the Channels struct * Improve documentation * rustfmt * Add single-buffer recycle methods Transfers can now be recycled on either source, destination, or both. * Added missing #[inline] attributes * Now with lock-free with_chid! * DMA-enabled SPI transfers for thumbv7em targets * Added module-level docs for SPI/DMA transfers Co-authored-by: Ian <[email protected]>
This adds structs and corresponding
serial::{Read, Write}
impls for a UART on each sercom.This works as is but needs some improvement to fully support all the features available on the samd21. Currently this is:
@wez