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
synthesizer.h
00001 /* 00002 COPYRIGHT(c) 2014 p.igmon 00003 */ 00004 00005 #ifndef SYNTHESIZER_H 00006 #define SYNTHESIZER_H 00007 00008 typedef signed long S32; 00009 typedef signed short S16; 00010 typedef signed char S8; 00011 typedef unsigned long U32; 00012 typedef unsigned short U16; 00013 typedef unsigned char U8; 00014 00015 #include "mbed.h" 00016 #include "cmsis.h" 00017 #include "stm32f401xe.h" 00018 #include "stm32f4xx.h" 00019 #include "stm32f4xx_hal.h" 00020 #include "stm32f4xx_hal_dma_ex.h" 00021 #include "stm32f4xx_hal_dma.h" 00022 #include "stm32f4xx_hal_i2s.h" 00023 00024 #include "stm32f4xx_hal_conf.h" 00025 #include "stm32f4xx_it.h" 00026 00027 #include "error.h" 00028 #include "pinmap.h" 00029 #include "PinNames.h" 00030 #include "gpio_irq_api.h" 00031 00032 #define I2S2 SPI2 00033 #define DMA_BUFFERSIZE 2048 00034 00035 00036 typedef enum 00037 { 00038 DMA_Idle = 0, 00039 DMA_HalfComplete, 00040 DMA_FullComplete, 00041 }BUFFER_StateTypeDef; 00042 00043 void MX_GPIO_Init(void); 00044 void uGen4_device_init(void); 00045 void init_dmabuffer(void); 00046 void i2s_dma_init(void); 00047 00048 void wave_generate(void); 00049 00050 void test_loop(void); 00051 void test_loop2(void); 00052 00053 #endif
Generated on Wed Jul 13 2022 10:27:32 by 1.7.2