DISCO-F746NGのAudioOutから正弦波をスイープとして出力します。ダブルバッファリングを使って、リアルタイムにデータ生成をしています。 This program outputs sine sweep from AudioOut on DISCO-F746NG. The program uses double buffering when generates data signals.

Dependencies:   BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

00001 #include "mbed.h"
00002 #include "stm32746g_discovery_audio.h"
00003 #include "LCD_DISCO_F746NG.h"
00004 
00005 #define PI              ((double)3.1415926535897932384626433832795028)
00006 #define SamplingFreq    I2S_AUDIOFREQ_16K
00007 #define BufferSize      (1024)                          /* Sample Size */
00008 #define BufferByteSize  (BufferSize * AUDIODATA_SIZE)   /* Byte Size */
00009 
00010 #define AudioVolume     ((uint8_t)8)
00011 #define Amplifier       ((double)0.25)
00012 
00013 #define MaxFreq         ((double)8000)
00014 #define MinFreq         ((double)50)
00015 #define SweepSpeed      ((double)0.01)
00016 
00017 extern LCD_DISCO_F746NG lcd;
00018 extern DigitalOut led1;
00019 extern int16_t sweep_buffer[BufferSize];
00020 
00021 void AUDIO_OUT_SAIx_DMAx_IRQHandler();
00022 
00023 void error_trap();
00024 void printlcd(const char *str);
00025 void printlcdAt(const char *str, uint16_t line);
00026 
00027 void fill_buffer(uint32_t offset, uint32_t size);