/**
@page I2S_DataExchangePolling I2S communication example using polling mode
@verbatim
******************** (C) COPYRIGHT 2016 STMicroelectronics *******************
* @file I2S/I2S_TwoBoards/I2S_DataExchangePolling/readme.txt
* @author MCD Application Team
* @version V1.8.0
* @date 04-November-2016
* @brief Description of the I2S full duplex communication example.
******************************************************************************
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
@endverbatim
@par Example Description
This example shows how to to configure the I2S for full duplex communication,
based on polling mode and through I2S firmware library.
- Hardware Description
To use this example, you need to load it on two STM32 boards (let's call them
BoardA and BoardB) then connect these two boards through I2S lines and GND.
In the firmware example uncomment the dedicated line in the main.h file to use
the I2S peripheral as STM32 Master device or as STM32 Slave device.
@verbatim
*------------------------------------------------------------------------------*
| BoardA BoardB |
| ____________________ ____________________ |
| | __________ | | __________ | |
| | | |____|_______WS________|____| | | |
| | |I2S Master|____|_______CK________|____|I2S Slave | | |
| | | TX |____|_______SD________|____| RX | | |
| | |__________| | | |__________| | |
| | | I2S_ext | | | | I2S_ext | | |
| | | Slave RX |____|_____ext_SD______|____| Slave TX | | |
| | |__________| | | |__________| | |
| | | | | |
| | O LED1 | | O LED1 | |
| | O LED2 | | O LED2 | |
| | O LED3 | | O LED3 | |
| | O LED4 | | O LED4 | |
| | | | | |
| | GND O--|-----------------|--O GND | |
| |____________________| |____________________| |
| |
| |
*------------------------------------------------------------------------------*
@endverbatim
@note The connection between the pins should use a short wires and a common Ground.
- Software Description
In this example, the I2S full duplex interface is based on the I2S2 peripheral with
an extra instance called I2S_ext used only for full duplex communication and can
operate only in Slave Mode.
Both I2Ss are configured as follows:
- Audio Frequency: 8 KHz
- Standard: Phillips
- MCLK Output: disabled
- CPOL: Low
- Data Format: 16b
In master board, I2S2 and I2S2_ext are enabled so I2S2 can deliver CK and WS to I2S2_ext.
The I2S2 peripheral is configured as Master Transmitter and I2S2_ext is configured
as Slave Receiver. Whereas in Slave Board, the I2S2 peripheral is configured as Slave
Receiver ans I2S2_ext is configured as Slave Transmitter.
- The Slave must be launched before the Master.
- The Master start the communication by sending aTxMasterBuffer buffer through SD pin
in the same time he receive a buffer through ext_SD pin, which is stored in aRxMasterBuffer.
- The Slave Start the communication when the clock is already available on CK pin
the Buffer received from master through SD pin,is stored in RxSlaveBuffer, in the
same time the aTxSlaveBuffer buffer is transmitted through ext_SD pin.
- In Master Board, after the Communication end, if the received buffer is correct
the LED2 and LED4 turns ON.
- In Slave Board, after the Communication end, if the received buffer is correct
the LED 3 turns ON.
@note In this example the I2S_MCK signal is not used in the communication, this
signal is needed to be provided to external codec audio component.
In both boards, the SysTick is configured to generate interrupt each 10ms. A dedicated
counter inside the SysTick ISR is used to toggle LED1 each 100ms indicating that the
firmware is running.
@par Directory contents
- I2S/I2S_TwoBoards/I2S_DataExchangePolling/system_stm32f4xx.c STM32F4xx system clock configuration file
- I2S/I2S_TwoBoards/I2S_DataExchangePolling/stm32f4xx_conf.h Library Configuration file
- I2S/I2S_TwoBoards/I2S_DataExchangePolling/stm32f4xx_it.c Interrupt handlers
- I2S/I2S_TwoBoards/I2S_DataExchangePolling/stm32f4xx_it.h Interrupt handlers header file
- I2S/I2S_TwoBoards/I2S_DataExchangePolling/main.c Main program
- I2S/I2S_TwoBoards/I2S_DataExchangePolling/main.h Main program header file
@par Hardware and Software environment
- This example runs on STM32F405xx/407xx and STM32F415xx/417xx, STM32F427xx/437xx devices.
- This example has been tested with STMicroelectronics STM324xG-EVAL (STM32F40xx/
STM32F41xx Devices) and STM32437I-EVAL (STM32F427xx/STM32F437xx Devices)
evaluation boards and can be easily tailored to any other supported device
and development board.
- STM324xG-EVAL/STM32437I-EVAL Set-up
- Use LED1, LED2, LED3 and LED4 connected respectively to PG.06, PG.08, PI.09
and PC.07 pins
- Connect BoardA I2S2_WS pin (PB12) to BoardB I2S2_WS pin (PB12)
- Connect BoardA I2S2_CK pin (PB13) to BoardB I2S2_CK pin (PB13)
- Connect BoardA I2S2_SD pin (PB15) to BoardB I2S2_SD pin (PB15)
- Connect BoardA I2S2ext_SD pin (PI2) to BoardB I2S2ext_SD pin (PI2)
@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
- Select the project workspace related to the used device
- If "STM32F40_41xxx" is selected as default project Add the following files in the project source list:
- Utilities\STM32_EVAL\STM3240_41_G_EVAL\stm324xg_eval.c
- If "STM32F427_437xx" is selected as default project Add the following files in the project source list:
- Utilities\STM32_EVAL\STM324x7I_EVAL\stm324x7i_eval.c
- Rebuild all files and load your image into target memory
- Run the example
* <h3><center>© COPYRIGHT STMicroelectronics</center></h3>
*/
没有合适的资源?快使用搜索试试~ 我知道了~
STM32f4标准固件库
共2000个文件
html:1061个
c:755个
h:461个
需积分: 30 49 下载量 198 浏览量
2022-07-23
13:39:14
上传
评论 8
收藏 75.43MB ZIP 举报
温馨提示
1._htmresc文件夹内是官方Logo图片,可以忽略。 2. Libraries 文件夹下面有 CMSIS 和 STM32F4xx_StdPeriph_Driver 两个目录,这两个目录包 含固件库核心的所有子文件夹和文件,是代码移植的重头戏。CMSIS 文件夹存放的是符合 CMSIS 规范的一些文件, Driver 文件夹下是STM32F4 标准外设固件库源码文件和对应的头文件,说白了就是将寄存器封装好的函数接口。 3.Project 文件夹下面有STM32F4xx_StdPeriph_Examples 和STM32F4xx_StdPeriph_Template 两个文件夹,Examples文件夹下是固件示例源码,Template文件夹下是工程模板。这些源码的学习对以后的开发学习非常重要。 4. Utilities 文件夹下就是官方评估板的一些对应源码,可以忽略不看。 5. 根目录中还有一个固件库的帮助文档 stm32f4xx_dsp_stdperiph_lib_um.chm 文件。
资源详情
资源评论
资源推荐
收起资源包目录
STM32f4标准固件库 (2000个子文件)
arm_linear_interp_data.c 4.1MB
audio_sample.c 3.67MB
arm_common_tables.c 868KB
arm_dct4_init_f32.c 786KB
cc936.c 707KB
cc949.c 554KB
cc950.c 440KB
arm_dct4_init_q31.c 417KB
arm_rfft_init_f32.c 362KB
arm_dct4_init_q15.c 272KB
cc932.c 244KB
arm_rfft_init_q31.c 215KB
arm_rfft_init_q15.c 141KB
ff.c 138KB
stm32f4xx_rcc.c 134KB
stm32f4xx_tim.c 122KB
stm32f4xx_rtc.c 101KB
stm324x9i_eval_sdio_sd.c 91KB
stm324x7i_eval_sdio_sd.c 91KB
stm324xg_eval_sdio_sd.c 91KB
stm32f4xx_dfsdm.c 85KB
stm32f4xx_adc.c 67KB
stm324x9i_eval_lcd.c 66KB
stm32f4xx_can.c 65KB
stm32f4xx_flash.c 62KB
stm32f4xx_fmc.c 61KB
stm32f4xx_dsi.c 61KB
system_stm32f4xx.c 60KB
system_stm32f4xx.c 60KB
system_stm32f4xx.c 60KB
system_stm32f4xx.c 60KB
system_stm32f4xx.c 60KB
system_stm32f4xx.c 60KB
system_stm32f4xx.c 59KB
stm324x9i_eval_audio_codec.c 58KB
stm324xg_eval_ioe.c 58KB
stm324x7i_eval_ioe.c 58KB
stm32f4xx_cryp_aes.c 57KB
stm32f4xx_fmpi2c.c 57KB
stm32f4xx_usart.c 57KB
arm_cfft_radix4_q15.c 56KB
system_stm32f4xx.c 53KB
system_stm32f4xx.c 53KB
system_stm32f4xx.c 53KB
stm32f4xx_i2c.c 53KB
stm324x7i_eval_audio_codec.c 53KB
stm324xg_eval_audio_codec.c 53KB
stm32f4xx_dma.c 52KB
stm32f4xx_spi.c 52KB
stm32f4xx_sai.c 48KB
system_stm32f4xx.c 47KB
system_stm32f4xx.c 47KB
system_stm32f4xx.c 47KB
system_stm32f4xx.c 47KB
fonts.c 46KB
stm32f4xx_fsmc.c 45KB
stm324xg_eval_lcd.c 44KB
stm324x7i_eval_lcd.c 44KB
arm_conv_partial_fast_q15.c 44KB
arm_fft_bin_data.c 43KB
arm_fft_bin_data.c 43KB
stm32f4xx_pwr.c 42KB
arm_cfft_radix4_q31.c 40KB
arm_conv_fast_q15.c 40KB
system_stm32f4xx.c 39KB
system_stm32f4xx.c 39KB
stm32f4xx_ltdc.c 39KB
stm324x9i_eval_ioe8.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
system_stm32f4xx.c 38KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
zhangevolxuan
- 粉丝: 8
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0