2015-08-05 01:25 PM
Hi guys
I try to make a simpel sinusial tone / beep on the STM32F7-Discovery borad but can not find a solution.Do anybody have the time to show howto ?Hjalmar2015-08-13 04:01 AM
hi guys
Do Anybody have a simpel way to make a tone / a beep on the stm32f7 with the wm8994 on..I try something with :
This one give me a tone, but it do not stop...it continue and the stm32f7 do frezee ........anybody with an idea ?
//Sin table values
uint16_t Sine550hz = { 32767, 39811, 46526, 52597, 57741, 61717, 64340, 65486, 65102, 63207, 59888, 55301, 49660, 43230, 36310, 29224, 22304, 15874, 10233, 5646, 2327, 432, 48, 1194, 3817, 7793, 12937, 19008, 25723, 32767, 39811, 46526, 52597, 57741, 61717, 64340, 65486, 65102, 63207, 59888, 55301, 49660, 43230, 36310, 29224, 22304, 15874, 10233, 5646, 2327, 432, 48, 1194, 3817, 7793, 12937, 19008, 25723, 32767, 39811, 46526, 52597, 57741, 61717, 64340, 65486, 65102, 63207, 59888, 55301, 49660, 43230, 36310, 29224, 22304, 15874, 10233, 5646, 2327, 432, 48, 1194, 3817, 7793, 12937, 19008, 25723, 32767, 39811, 46526, 52597, 57741, 61717, 64340, 65486, 65102, 63207, 59888, 55301, 49660, 43230, 36310, 29224, 22304, 15874, 10233, 5646, 2327, 432, 48, 1194, 3817, 7793, 12937, 19008, 25723};static __IO uint32_t hjhVolume = 35;
void hjhAudioInit()
{ BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_BOTH, hjhVolume, I2S_AUDIOFREQ_8K); BSP_AUDIO_OUT_SetAudioFrameSlot(CODEC_AUDIOFRAME_SLOT_02); } void hjhAudioTone(){ BSP_AUDIO_OUT_SetVolume(hjhVolume); int res = BSP_AUDIO_OUT_Play((uint16_t*)&Sine550hz,sizeof(Sine550hz)); GUI_DispDecAt(res, 0, 60,5); }void BSP_AUDIO_OUT_TransferComplete_CallBack()
{ BSP_AUDIO_OUT_Stop(CODEC_PDWN_SW); }2015-08-13 04:12 AM
Hi skovholm_hansen.hjal,
wm8994 is used in the example available under STM32Cube_FW_F7_V1.1.0\Projects\STM32746G-Discovery\Applications\Audio\Audio_playback_and_record.If you can check how this example was implemented, it may bring you some help.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-08-13 11:51 AM
Hi mayla
I did ...but it takes a file and i can not figure out why it do continue in my code when it have played the array....I am newbie to stm32f7 so mabye thats the reason ;o)I did hope that somebody did have a quick fix otherwise i will make my own code to talk to the wm8994 but it is not easy so therefore i did want to use HAL ...Best regardsHjalmar2016-09-16 07:15 AM
Hi.
I've tried that code example you provided and can confirm that it does indeed seem to freeze the board. Have you sorted it out? I'm on the hunt for a very simple example that outputs stereo audio from a memory buffer but with no success.