Implement functions to allow for DMA usage in audio driver.#804
Conversation
- Add tud_audio_n_get_ep_out_ff(), tud_audio_n_get_ep_in_ff(), tud_audio_n_get_rx_support_ff(), and tud_audio_n_get_tx_support_ff() - Change get_linear_read/write_info() to return linear and wrapped part at once - Adjusted affected code in audio_device.c and tested with audio_4_channel.
Oh thanks you are quick 😅, I think I would write it this weekend... |
Compilers always complain that variables set by function via pointer might be uninitialized so to avoid that return values are now delivered via struct.
|
@hathach Could you have a look into this include hassle with |
|
Seems there is a dependency loop: |
|
Ah yes again. This already was once an issue, but @hathach took care of it. I don't know how exactly. I guess this came up again somehow as i needed to include |
hathach
left a comment
There was a problem hiding this comment.
thanks @PanRe for another great PR. Sorry the in cross include between pico and fifo is getting out of control. I temporarily fixed it by alternating the include order a bit and push the update. Will definitely fix it more properly later on with an overall include revise.
Except from that, I have an a couple of feedback, that I think we could simplify the API for the read/write buffer info. Let me know if that makes sense to you.
|
OK all set up as desired! |
hathach
left a comment
There was a problem hiding this comment.
superb ! Thank you for your effort, great PR as usual. the removal of offset make the whole fifo API much cleaner any easier to read/understand. FIFO should be supported offset (random) in the first place. It is my bad to introduce such operation with peek (since I thought it could be handy). Should user need to peek randomly, the new get_read_info() can be used to do it. I have a couple of minor clean up, along with a couple of unit test for new read/write info will push and merge it asap.
|
Thanks a lot! :) |
I am the one to say thanks 👍 |
Describe the PR
Follow the discussion in #593, this attempts to implement functions to allow for DMA usage in audio functions.
tud_audio_n_get_rx_support_ff(), and tud_audio_n_get_tx_support_ff()
at once
audio_4_channel.