Make a simpel tone on Stm32F7
HI
This one give me a tone, but it do not stop...it continue and the stm32f7 do frezee ........anybody with an idea ?
- include “stm32746g_discovery_audio.h”
- include “stm32f7xx_hal_sai.h”
- include “stm32f7xx_hal_i2s.h”
- include “main.h”
- include “GUI.h”
- include “DIALOG.h”
- include “WM.h”
//Sin table values
uint16_t Sine550hz128 = { 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*)&Sine550hz0,sizeof(Sine550hz));
GUI_DispDecAt(res, 0, 60,5);
}
void BSP_AUDIO_OUT_TransferComplete_CallBack()
{
BSP_AUDIO_OUT_Stop(CODEC_PDWN_SW);
}