This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usb asynchronous

How do I set the usb audio code up for usb asynchronous transfers.

Do I just have to change bmAttributes

USB_ENDPOINT_TYPE_ISOCHRONOUS,

to

USB_ENDPOINT_SYNC_ASYNCHRONOUS

or is it more complexed than that.

Parents
  • I think I got the answer anyway don't want to ruin this thread maybe you should delete the last couple of posts

    use a ringbuffer and read and write in opposite directions.
    DMA can only do one direction AFAIK (counting up) so you need to write a buffer in reverse direction in software and let the DMA do the playback part. You can use two buffers and switch them on the 'end-of-DMA' interrupt for example. You can also use a simple ticker interrupt and read and write a ringbuffer on each 'tick', again with opposite directions.

Reply
  • I think I got the answer anyway don't want to ruin this thread maybe you should delete the last couple of posts

    use a ringbuffer and read and write in opposite directions.
    DMA can only do one direction AFAIK (counting up) so you need to write a buffer in reverse direction in software and let the DMA do the playback part. You can use two buffers and switch them on the 'end-of-DMA' interrupt for example. You can also use a simple ticker interrupt and read and write a ringbuffer on each 'tick', again with opposite directions.

Children
No data