-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat: add spi rx dma (and migrate to embedded-dma) #165
Conversation
|
||
// Tell DMA to request from serial | ||
channel.cselr().modify(|_, w| { | ||
w.$dmacst().bits(0b0010) // TODO: Fix this, not valid for DMA2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this it seems to always be map2
Hi, what is the status of this PR? |
Ping again :) |
72163bc
to
299feb5
Compare
@korken89 it is / was marked as a draft because it depends on the SPI slave PR |
Just merged that one for you :) |
Thanks @MathiasKoch! I'll review this today! |
Ah, right I also noticed the Frame Reader is in a bit of a weird state with this Not sure if the |
@ForsakenHarmony Not quite sure I am following, could you expand on that? |
See the failing test error[E0599]: no method named `is_character_match` found for mutable reference `&mut Rx<stm32l4xx_hal::pac::USART2>` in the current scope
Error: --> examples/rtic_frame_serial_dma.rs:115:28
|
115 | if cx.resources.rx.is_character_match(true) {
| ^^^^^^^^^^^^^^^^^^ method not found in `&mut Rx<stm32l4xx_hal::pac::USART2>` rx is consumed by the dma with the new API, so I also haven't found the |
Ah, I see waht you mean. The frame reader works like this:
E.g.: The following is received: A common use-case is if you encode data with COBS ( So we need to find someway to make it work, what are you suggestions? |
31ebfb0
to
0d111eb
Compare
@korken89 added a trait for the character match and added it to the |
Signed-off-by: Leah <github.leah@hrmny.sh>
0d111eb
to
d84549f
Compare
matching_character, | ||
} | ||
} | ||
} | ||
|
||
impl<BUFFER, PAYLOAD, CHANNEL, const N: usize> FrameReader<BUFFER, RxDma<PAYLOAD, CHANNEL>, N> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I suppose it would also be possible to just implement the trait here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right place :)
Super, we are getting close! :D One question, the DMA for SPI is setup for RX are you planning to support TX and TX/RX transaction, or is this left out for now? |
Could you have a look at fixing the failing tests? |
Hi, @ForsakenHarmony , I provided fixes for the errors here: #230 One questions has popped up for me, how is it planned that this will be used? |
Sorry, I keep missing these GitHub notifications, I have too many https://github.com/ForsakenHarmony/roboclub-lighting/blob/main/stm/src/main.rs#L225-L228 Here's how I'm using it, I've only used it in slave mode, which means a master sends data and clock |
Ahh, makes sense - thanks! |
SPI RX/TX DMA and move to `embedded-dma` (continuation of #165)
This was merged as a part of the work in #230. |
No description provided.