I2S

所属分类:单片机开发
开发工具:C/C++
文件大小:187KB
下载次数:401
上传日期:2013-04-04 16:03:22
上 传 者suifeng010
说明:  STM32的I2S编程,开发板带的程序,有做I2S音频这块的同学可以看看
(STM32 I2S programming, development board with the program, has done I2S audio piece classmates can look)

文件列表:
I2S\Audio\i2c.c (4254, 2012-05-26)
I2S\Audio\i2c.h (1024, 2012-05-26)
I2S\Audio\i2s.c (4697, 2012-05-15)
I2S\Audio\i2s.h (2049, 2012-05-15)
I2S\Audio\main.c (1858, 2012-04-10)
I2S\Audio\main.h (2077, 2012-05-15)
I2S\Audio\MDK-ARM\JLinkLog.txt (383694, 2012-05-16)
I2S\Audio\MDK-ARM\JLinkSettings.ini (573, 2012-05-14)
I2S\Audio\MDK-ARM\Project.uvopt (28316, 2012-05-16)
I2S\Audio\MDK-ARM\Project.uvproj (23897, 2012-05-16)
I2S\Audio\stm32f4xx_conf.h (3614, 2011-10-03)
I2S\Audio\stm32f4xx_it.c (4859, 2012-05-15)
I2S\Audio\stm32f4xx_it.h (2063, 2011-10-03)
I2S\Audio\system_stm32f4xx.c (22875, 2012-05-16)
I2S\Audio\WaveData.c (738741, 2012-04-10)
I2S\Audio\MDK-ARM (0, 2013-04-04)
I2S\Audio (0, 2013-04-04)
I2S (0, 2013-04-04)

/** @page I2S_AUDIO How to use the Audio features with I2S peripheral @verbatim ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* * @file I2S/Audio/readme.txt * @author MCD Application Team * @version V1.0.0 * @date 30-September-2011 * @brief Description of the I2S Audio Example. ****************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. ****************************************************************************** @endverbatim @par Example Description This example provides basic implementation of audio features. It allows to play an audio file through the I2S peripheral and using the external codec implemented on the STM324xG-EVAL board. In this example the I2S input clock, provided by a dedicated PLL (PLLI2S), is configured to have an audio sampling frequency at 48 KHz with Master clock enabled. This example uses an audio codec driver which consists of three independent layers: - Codec Hardware layer: which controls and communicates with the audio codec (CS43L22) implemented on the evaluation board. - MAL (Media Access Layer): which controls and interfaces with storage media storing or providing the audio file/stream. - The high layer: which implements overall control and interfacing API allowing to perform basic audio operations (Init, Play, Pause, Resume, Stop, Volume control and audio file pointer management) In this example the audio file is stored in the internal flash memory (Stereo, 16-bit, 48 KHz). The analog output device is automatically detected (Speaker or Headphone) when the Headphone is plugged/unplugged in/from the audio jack of the evaluation board. The example also manages information display and control interface through push buttons: - When the application is Playing audio file: + Key : Pause + Tamper: Volume UP + Wakeup: Volume DOWN - When the application is Paused: + Key : Play + Tamper: Switch output target to Headphone + Wakeup: Switch output target to Speaker This example plays the audio file stored in internal flash memory and replay it when it reach end of file. But it can be tailored to used different media storage devices; SDCard (through SDIO), external Memory (through FSMC) ...) or to play in streaming mode (ie. from USB port in device or host mode). In this case, Circular DMA mode should be preferred (by enabling the define AUDIO_MAL_MODE_CIRCULAR in stm324xg_eval_audio_codec.h file). List of Known Limitations and more detailed user notes are provided in file stm324xg_eval_audio_codec.c (under Utilities\STM32_EVAL\STM3240_41_G_EVAL) The provided sample audio file (stored in internal flash memory) is extracted from: - Title: artofgardens-instr - Artist/Composer: Dan O'Connor - Creative Commons license: Attribution 3.0 United States Please read the license following this link: http://creativecommons.org/licenses/by/3.0/us/ @par Directory contents - I2S/Audio/system_stm32f4xx.c STM32F4xx system clock configuration file - I2S/Audio/stm32f4xx_conf.h Library Configuration file - I2S/Audio/stm32f4xx_it.c Interrupt handlers - I2S/Audio/stm32f4xx_it.h Interrupt handlers header file - I2S/Audio/main.c Main program - I2S/Audio/audio_sample.c Audio Sample file (in tab format) @note The "system_stm32f4xx.c" is generated by an automatic clock configuration tool and can be easily customized to your own configuration. To select different clock setup, use the "STM32F4xx_Clock_Configuration_V1.0.0.xls" provided with the AN3***8 package available on ST Microcontrollers @par Hardware and Software environment - This example runs only on STM32F4xx Devices. - This example has been tested with STM324xG-EVAL RevB (with no additional hardware), and can be easily tailored to any other development board. - STM324xG-EVAL Set-up - Make sure the jumper JP16 is in position 2<->3 @par How to use it ? In order to make the program work, you must do the following : - Copy all source files from this example folder to the template folder under Project\STM32F4xx_StdPeriph_Templates - Open your preferred toolchain - Add the files "audio_sample.c" and "stm324xg_eval_audio_codec.c" to the project source list - "stm324xg_eval_audio_codec.c" file is located under Utilities\STM32_EVAL\STM3240_41_G_EVAL - Rebuild all files and load your image into target memory - Run the example *

© COPYRIGHT 2011 STMicroelectronics

*/

近期下载者

相关文件


收藏者