E
E
eegmak2020-04-06 17:26:11
Do it yourself
eegmak, 2020-04-06 17:26:11

How to transfer data from usb audio to uart in stm32f103c8t6?

I am creating a project in CubeMX for TrueStudio, usbaudio class, the quality is the lowest (telephone connection) - so that the uart bandwidth is enough. The device is detected in windows, shows that the sound is being played.
Tell me, where can I find data coming via usb?
On what event to send this data to uart?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Buliterov, 2020-04-16
@bullitufa

I'm not sure, but I think something like this:
file usbd_audio.c
function static uint8_t USBD_AUDIO_DataOut (USBD_HandleTypeDef *pdev, uint8_t epnum)
Your callback function is called there:
((USBD_AUDIO_ItfTypeDef *)pdev->pUserData)->AudioCmd(&haudio->buffer[ 0], AUDIO_TOTAL_BUF_SIZE/2, AUDIO_CMD_START);
And synchronization by the StartOfFrame function or void USBD_AUDIO_Sync (USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset) is also there.
See examples from ST (there is a cube).
Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question