Part of MicroGen4 Music Synthesizer Program. (But not test it yet.) I2S ,DMA ,Stereo ,16Bit Dac(PCM1781) See detail: http://www.geocities.jp/micro_diys/index2

Dependencies:   mbed

Now added generate Saw Wave to DAC function in generate(); You will hear Stereo saw wave sound now. /media/uploads/p_igmon/i2s_sample_test_audacity.png

more info: http://www.geocities.jp/micro_diys/i2s_test_sample/i2s_test_sample.html

Committer:
p_igmon
Date:
Thu Jul 03 11:59:07 2014 +0000
Revision:
0:dc88722ab141
Part of MicroGen4 Music Syntesizer program.
; I2S DMA Stereo DAC (PCM1781)
; http://www.geocities.jp/micro_diys/index2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
p_igmon 0:dc88722ab141 1 /*
p_igmon 0:dc88722ab141 2 COPYRIGHT(c) 2014 p.igmon
p_igmon 0:dc88722ab141 3 */
p_igmon 0:dc88722ab141 4
p_igmon 0:dc88722ab141 5 #include "synthesizer.h"
p_igmon 0:dc88722ab141 6
p_igmon 0:dc88722ab141 7 Serial pc(SERIAL_TX, SERIAL_RX);
p_igmon 0:dc88722ab141 8
p_igmon 0:dc88722ab141 9 DigitalOut myled(LED1);
p_igmon 0:dc88722ab141 10
p_igmon 0:dc88722ab141 11 extern S16 * DMA_Buffer;
p_igmon 0:dc88722ab141 12 extern __IO BUFFER_StateTypeDef BufferOffset;
p_igmon 0:dc88722ab141 13
p_igmon 0:dc88722ab141 14 int main(){
p_igmon 0:dc88722ab141 15 uGen4_device_init();
p_igmon 0:dc88722ab141 16 pc.baud(9600);
p_igmon 0:dc88722ab141 17 // pc.printf("CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock);
p_igmon 0:dc88722ab141 18
p_igmon 0:dc88722ab141 19 i2s_dma_init();
p_igmon 0:dc88722ab141 20
p_igmon 0:dc88722ab141 21 while(1) {
p_igmon 0:dc88722ab141 22 if(BufferOffset != DMA_Idle) wave_generate();
p_igmon 0:dc88722ab141 23
p_igmon 0:dc88722ab141 24 /* other work */
p_igmon 0:dc88722ab141 25
p_igmon 0:dc88722ab141 26 }
p_igmon 0:dc88722ab141 27 }
p_igmon 0:dc88722ab141 28
p_igmon 0:dc88722ab141 29