cancel
Showing results for 
Search instead for 
Did you mean: 

Audio Device Class simple example with STMStudio

Marek Pio
Associate II
Posted on June 22, 2018 at 13:36

Hello,

I'm trying to make STM32F3Discovery as an USB audio device. I want to stream audio to variable and use STMStudio to display graph for audio data. Later I want to feed PWM and control D amplifier.

0690X0000060PGhQAM.jpg

Pinout: Use Audio Device Class and PWM outputs.

0690X0000060PGiQAM.jpg

Clock configuration

0690X0000060PGoQAM.jpg

USB audio configuration

0690X0000060PGXQA2.jpg

PC see board as speaker.

0690X0000060PGtQAM.jpg

Timer configuration to generate 48kHz

0690X0000060PGOQA2.jpg

0690X0000060PGYQA2.jpg

I try to make driver to

receiving data

from USB.

0690X0000060PGvQAM.jpg

Timer 6 copy data to duty variable 48000 times per second. After receive half data execute audio synchronization and for full data execute audio synchronization.

0690X0000060PGkQAM.jpg

Private variables to handle pointer to audio buffer, it size and word counter to send data.

0690X0000060PGyQAM.jpg

Probably function below need something to work. Here i set buffer pointer, it size and set word counter to 0.

See Attachements 32942

Initialization for output periphery, here i don't need any.

See Attachements 32946

What changes I need to do in usbd_audio_if.c file in this simple example?

If you know pattern to implement BSP audio, you can share it.

Here I find interesing example for USB Audio

https://blog.csdn.net/wangjianzhongfj/article/details/72861557

It's hard for me to change

http://www.lyrebirdapp.com/doxygen/stm32f769i__discovery__audio_8c_source.html

audio example.

Sorry for my language. Thanks you for help

Mark

#usb-audio-simple-example #audio-device-class #usb-audio

0 REPLIES 0