文件名称:STM32-SPI.rar
介绍说明--下载内容来自于网络,使用问题请自行百度
本例展示了如何实现2个SPI之间的在全双工(full-duplex)模式下通信,通过NSS软件管理,实现了由主向从,接着又从向主发送数据。
在本例程中,设置SPI1和SPI2为8bit数据帧,9Mbit/s传输速率。
在第一阶段,由主SPI1把SPI1_Buffer_Tx发送到SPI2,由从SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
由于NSS管脚由软件管理,因此,可以在不改变硬件配置的情况下使SPI1由主变从,而SPI2由从变主。在第二阶段,由从SPI1把SPI1_Buffer_Tx发送到SPI2,由主SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
在STM3210B-LK1上,如果以上4个传输都正确,则亮起LED1(LD4),否则亮起LED2(LD3)。,err
在本例程中,设置SPI1和SPI2为8bit数据帧,9Mbit/s传输速率。
在第一阶段,由主SPI1把SPI1_Buffer_Tx发送到SPI2,由从SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
由于NSS管脚由软件管理,因此,可以在不改变硬件配置的情况下使SPI1由主变从,而SPI2由从变主。在第二阶段,由从SPI1把SPI1_Buffer_Tx发送到SPI2,由主SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
在STM3210B-LK1上,如果以上4个传输都正确,则亮起LED1(LD4),否则亮起LED2(LD3)。,err
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Example1/readme.txt
Example1/stm32f10x_it.c
Example1/stm32f10x_it.h
Example1/stm32f10x_exti.h
Example1/stm32f10x_flash.h
Example1/stm32f10x_gpio.h
Example1/stm32f10x_i2c.h
Example1/stm32f10x_iwdg.h
Example1/stm32f10x_lib.h
Example1/stm32f10x_map.h
Example1/stm32f10x_nvic.h
Example1/stm32f10x_pwr.h
Example1/stm32f10x_rcc.h
Example1/stm32f10x_rtc.h
Example1/stm32f10x_spi.h
Example1/stm32f10x_systick.h
Example1/stm32f10x_tim.h
Example1/stm32f10x_tim1.h
Example1/stm32f10x_type.h
Example1/stm32f10x_usart.h
Example1/stm32f10x_wwdg.h
Example1/cortexm3_macro.h
Example1/stm32f10x_adc.h
Example1/stm32f10x_bkp.h
Example1/stm32f10x_can.h
Example1/stm32f10x_dma.h
Example1/stm32f10x_exti.c
Example1/stm32f10x_flash.c
Example1/stm32f10x_i2c.c
Example1/stm32f10x_iwdg.c
Example1/stm32f10x_lib.c
Example1/stm32f10x_nvic.c
Example1/stm32f10x_pwr.c
Example1/stm32f10x_rcc.c
Example1/stm32f10x_rtc.c
Example1/stm32f10x_systick.c
Example1/stm32f10x_tim.c
Example1/stm32f10x_tim1.c
Example1/stm32f10x_usart.c
Example1/stm32f10x_wwdg.c
Example1/TIMX_TEXT1.C
Example1/stm32f10x_adc.c
Example1/stm32f10x_bkp.c
Example1/stm32f10x_can.c
Example1/stm32f10x_dma.c
Example1/settings/SPI_text1.cspy.bat
Example1/settings/spi_text1.wsdt
Example1/settings/SPI_text1.dni
Example1/settings/SPI_text1.dbgdt
Example1/settings/SPI_text2.cspy.bat
Example1/settings/SPI_text2.dni
Example1/settings/SPI_text2.dbgdt
Example1/spi_text1.eww
Example1/SPI_text1.ewp
Example1/SPI_text1.ewd
Example1/SPI_text1.dep
Example1/stm32f10x_conf.h
Example1/stm32f10x_spi.c
Example1/SPI_text2.ewp
Example1/SPI_text2.ewd
Example1/SPI_text2.dep
Example1/main.c
Example1/stm32f10x_gpio.c
Example1/settings
Example1/Debug
Example1
Example1/stm32f10x_it.c
Example1/stm32f10x_it.h
Example1/stm32f10x_exti.h
Example1/stm32f10x_flash.h
Example1/stm32f10x_gpio.h
Example1/stm32f10x_i2c.h
Example1/stm32f10x_iwdg.h
Example1/stm32f10x_lib.h
Example1/stm32f10x_map.h
Example1/stm32f10x_nvic.h
Example1/stm32f10x_pwr.h
Example1/stm32f10x_rcc.h
Example1/stm32f10x_rtc.h
Example1/stm32f10x_spi.h
Example1/stm32f10x_systick.h
Example1/stm32f10x_tim.h
Example1/stm32f10x_tim1.h
Example1/stm32f10x_type.h
Example1/stm32f10x_usart.h
Example1/stm32f10x_wwdg.h
Example1/cortexm3_macro.h
Example1/stm32f10x_adc.h
Example1/stm32f10x_bkp.h
Example1/stm32f10x_can.h
Example1/stm32f10x_dma.h
Example1/stm32f10x_exti.c
Example1/stm32f10x_flash.c
Example1/stm32f10x_i2c.c
Example1/stm32f10x_iwdg.c
Example1/stm32f10x_lib.c
Example1/stm32f10x_nvic.c
Example1/stm32f10x_pwr.c
Example1/stm32f10x_rcc.c
Example1/stm32f10x_rtc.c
Example1/stm32f10x_systick.c
Example1/stm32f10x_tim.c
Example1/stm32f10x_tim1.c
Example1/stm32f10x_usart.c
Example1/stm32f10x_wwdg.c
Example1/TIMX_TEXT1.C
Example1/stm32f10x_adc.c
Example1/stm32f10x_bkp.c
Example1/stm32f10x_can.c
Example1/stm32f10x_dma.c
Example1/settings/SPI_text1.cspy.bat
Example1/settings/spi_text1.wsdt
Example1/settings/SPI_text1.dni
Example1/settings/SPI_text1.dbgdt
Example1/settings/SPI_text2.cspy.bat
Example1/settings/SPI_text2.dni
Example1/settings/SPI_text2.dbgdt
Example1/spi_text1.eww
Example1/SPI_text1.ewp
Example1/SPI_text1.ewd
Example1/SPI_text1.dep
Example1/stm32f10x_conf.h
Example1/stm32f10x_spi.c
Example1/SPI_text2.ewp
Example1/SPI_text2.ewd
Example1/SPI_text2.dep
Example1/main.c
Example1/stm32f10x_gpio.c
Example1/settings
Example1/Debug
Example1
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.