2021-09-13 19:14:46 索煒達(dá)電子 964
項(xiàng)目編號(hào):E1166
文件大小:1.36M
源碼說明:帶中文注釋
開發(fā)環(huán)境:C編譯器
簡(jiǎn)要概述:
STM32串口DMA模式發(fā)送&接收實(shí)現(xiàn),高速串口通信(1.5Mbps)不丟數(shù)據(jù)
【1】環(huán)形FIFO作為發(fā)送和接收緩存
【2】DMA 接收半滿中斷、溢滿中斷、串口空閑中斷
【3】不定長(zhǎng)串口數(shù)據(jù)接收
【4】高波特率通信不翻車(實(shí)測(cè)1.5Mbps毫無壓力)
測(cè)試平臺(tái)
實(shí)現(xiàn)功能
-收/發(fā)環(huán)形緩沖區(qū)
-不定長(zhǎng)度接收處理
-高速(1.5Mbps)通信不丟數(shù)據(jù)
關(guān)鍵實(shí)現(xiàn)
DMA發(fā)送模式
-線程循環(huán)查詢發(fā)送環(huán)形緩沖區(qū)數(shù)據(jù),然后啟動(dòng)MDA傳輸
-DMA傳輸完成中斷,連續(xù)發(fā)送
-定時(shí)器中斷周期發(fā)送
DMA接收模式
-DMA緩存半滿中斷(如CPU硬件支持,可使用DMA雙緩存機(jī)制)
-DMA緩存?zhèn)鬏斖瓿芍袛?/p>
-串口空閑中斷實(shí)現(xiàn)
目錄│文件列表:
└ stm32-uart-dma
│ .editorconfig
├ stm32f0-uart-dma
│ ├ Projects
│ │ ├ EWARM
│ │ │ │ clear.bat
│ │ │ │ Project.dep
│ │ │ │ Project.ewd
│ │ │ │ Project.ewp
│ │ │ │ Project.ewt
│ │ │ │ Project.eww
│ │ │ └ stm32f030x8_app.icf
│ │ └ MDK
│ │ │ clear.bat
│ │ │ EventRecorderStub.scvd
│ │ │ JLinkSettings.ini
│ │ │ Project.uvoptx
│ │ └ Project.uvprojx
│ └ Source
│ ├ App
│ │ │ dev_uart.c
│ │ │ dev_uart.h
│ │ │ main.c
│ │ │ stm32f0xx_conf.h
│ │ └ system_stm32f0xx.c
│ ├ Bsp
│ │ │ bsp_uart.c
│ │ │ bsp_uart.h
│ │ │ stm32f0xx_it.c
│ │ └ stm32f0xx_it.h
│ ├ Components
│ │ │ fifo.c
│ │ └ fifo.h
│ └ Libraries
│ ├ CMSIS
│ │ ├ Core
│ │ │ │ arm_common_tables.h
│ │ │ │ arm_const_structs.h
│ │ │ │ arm_math.h
│ │ │ │ core_cm0.h
│ │ │ │ core_cm0plus.h
│ │ │ │ core_cm3.h
│ │ │ │ core_cm4.h
│ │ │ │ core_cm4_simd.h
│ │ │ │ core_cmFunc.h
│ │ │ │ core_cmInstr.h
│ │ │ │ core_sc000.h
│ │ │ └ core_sc300.h
│ │ └ Device
│ │ │ stm32f0xx.h
│ │ │ system_stm32f0xx.h
│ │ └ startup
│ │ ├ iar
│ │ │ │ startup_stm32f030.s
│ │ │ │ startup_stm32f031.s
│ │ │ │ startup_stm32f042.s
│ │ │ │ startup_stm32f051.s
│ │ │ │ startup_stm32f072.s
│ │ │ │ startup_stm32f0xx.s
│ │ │ └ startup_stm32f0xx_ld.s
│ │ └ mdk
│ │ │ startup_stm32f030.s
│ │ │ startup_stm32f031.s
│ │ │ startup_stm32f042.s
│ │ │ startup_stm32f051.s
│ │ │ startup_stm32f072.s
│ │ │ startup_stm32f0xx.s
│ │ └ startup_stm32f0xx_ld.s
│ └ STM32F0xx_StdPeriph_Driver
│ ├ inc
│ │ │ stm32f0xx_adc.h
│ │ │ stm32f0xx_can.h
│ │ │ stm32f0xx_cec.h
│ │ │ stm32f0xx_comp.h
│ │ │ stm32f0xx_crc.h
│ │ │ stm32f0xx_crs.h
│ │ │ stm32f0xx_dac.h
│ │ │ stm32f0xx_dbgmcu.h
│ │ │ stm32f0xx_dma.h
│ │ │ stm32f0xx_exti.h
│ │ │ stm32f0xx_flash.h
│ │ │ stm32f0xx_gpio.h
│ │ │ stm32f0xx_i2c.h
│ │ │ stm32f0xx_iwdg.h
│ │ │ stm32f0xx_misc.h
│ │ │ stm32f0xx_pwr.h
│ │ │ stm32f0xx_rcc.h
│ │ │ stm32f0xx_rtc.h
│ │ │ stm32f0xx_spi.h
│ │ │ stm32f0xx_syscfg.h
│ │ │ stm32f0xx_tim.h
│ │ │ stm32f0xx_usart.h
│ │ └ stm32f0xx_wwdg.h
│ └ src
│ │ stm32f0xx_adc.c
│ │ stm32f0xx_can.c
│ │ stm32f0xx_cec.c
│ │ stm32f0xx_comp.c
│ │ stm32f0xx_crc.c
│ │ stm32f0xx_crs.c
│ │ stm32f0xx_dac.c
│ │ stm32f0xx_dbgmcu.c
│ │ stm32f0xx_dma.c
│ │ stm32f0xx_exti.c
│ │ stm32f0xx_flash.c
│ │ stm32f0xx_gpio.c
│ │ stm32f0xx_i2c.c
│ │ stm32f0xx_iwdg.c
│ │ stm32f0xx_misc.c
│ │ stm32f0xx_pwr.c
│ │ stm32f0xx_rcc.c
│ │ stm32f0xx_rtc.c
│ │ stm32f0xx_spi.c
│ │ stm32f0xx_syscfg.c
│ │ stm32f0xx_tim.c
│ │ stm32f0xx_usart.c
│ └ stm32f0xx_wwdg.c
├ stm32f1-rtthread-nano
│ ├ Projects
│ │ ├ EWARM
│ │ │ │ clear.bat
│ │ │ │ Project.dep
│ │ │ │ Project.ewd
│ │ │ │ Project.ewp
│ │ │ │ Project.ewt
│ │ │ │ Project.eww
│ │ │ │ stm32f1x_app.icf
│ │ │ └ settings
│ │ │ │ Project.cspy.bat
│ │ │ │ Project.dbgdt
│ │ │ │ Project.dni
│ │ │ │ Project.wsdt
│ │ │ └ Project_App.jlink
│ │ └ MDK
│ │ │ clear.bat
│ │ │ EventRecorderStub.scvd
│ │ │ JLinkSettings.ini
│ │ │ Project.uvoptx
│ │ │ Project.uvprojx
│ │ └ RTE
│ │ ├ RTOS
│ │ │ │ board.c
│ │ │ └ rtconfig.h
│ │ └ _uart-dma
│ │ └ RTE_Components.h
│ └ Source
│ ├ App
│ │ │ dev_uart.c
│ │ │ dev_uart.h
│ │ └ main.c
│ ├ Bsp
│ │ │ bsp_uart.c
│ │ │ bsp_uart.h
│ │ │ stm32f10x_conf.h
│ │ │ stm32f10x_it.c
│ │ └ stm32f10x_it.h
│ ├ Components
│ │ │ fifo.c
│ │ └ fifo.h
│ ├ Libraries
│ │ ├ CMSIS
│ │ │ └ CM3
│ │ │ ├ CoreSupport
│ │ │ │ │ core_cm3.c
│ │ │ │ └ core_cm3.h
│ │ │ └ DeviceSupport
│ │ │ └ ST
│ │ │ │ Release_Notes_for_STM32F10x_CMSIS.html
│ │ │ └ STM32F10x
│ │ │ │ Release_Notes.html
│ │ │ │ stm32f10x.h
│ │ │ │ system_stm32f10x.c
│ │ │ │ system_stm32f10x.h
│ │ │ └ startup
│ │ │ ├ arm
│ │ │ │ │ startup_stm32f10x_cl.s
│ │ │ │ │ startup_stm32f10x_hd.s
│ │ │ │ │ startup_stm32f10x_hd_vl.s
│ │ │ │ │ startup_stm32f10x_ld.s
│ │ │ │ │ startup_stm32f10x_ld_vl.s
│ │ │ │ │ startup_stm32f10x_md.s
│ │ │ │ │ startup_stm32f10x_md_vl.s
│ │ │ │ └ startup_stm32f10x_xl.s
│ │ │ ├ gcc_ride7
│ │ │ │ │ startup_stm32f10x_cl.s
│ │ │ │ │ startup_stm32f10x_hd.s
│ │ │ │ │ startup_stm32f10x_hd_vl.s
│ │ │ │ │ startup_stm32f10x_ld.s
│ │ │ │ │ startup_stm32f10x_ld_vl.s
│ │ │ │ │ startup_stm32f10x_md.s
│ │ │ │ │ startup_stm32f10x_md_vl.s
│ │ │ │ └ startup_stm32f10x_xl.s
│ │ │ ├ iar
│ │ │ │ │ startup_stm32f10x_cl.s
│ │ │ │ │ startup_stm32f10x_hd.s
│ │ │ │ │ startup_stm32f10x_hd_vl.s
│ │ │ │ │ startup_stm32f10x_ld.s
│ │ │ │ │ startup_stm32f10x_ld_vl.s
│ │ │ │ │ startup_stm32f10x_md.s
│ │ │ │ │ startup_stm32f10x_md_vl.s
│ │ │ │ └ startup_stm32f10x_xl.s
│ │ │ └ TrueSTUDIO
│ │ │ │ startup_stm32f10x_cl.s
│ │ │ │ startup_stm32f10x_hd.s
│ │ │ │ startup_stm32f10x_hd_vl.s
│ │ │ │ startup_stm32f10x_ld.s
│ │ │ │ startup_stm32f10x_ld_vl.s
│ │ │ │ startup_stm32f10x_md.s
│ │ │ │ startup_stm32f10x_md_vl.s
│ │ │ └ startup_stm32f10x_xl.s
│ │ └ STM32F10x_StdPeriph_Driver
│ │ ├ inc
│ │ │ │ misc.h
│ │ │ │ stm32f10x_adc.h
│ │ │ │ stm32f10x_bkp.h
│ │ │ │ stm32f10x_can.h
│ │ │ │ stm32f10x_cec.h
│ │ │ │ stm32f10x_crc.h
│ │ │ │ stm32f10x_dac.h
│ │ │ │ stm32f10x_dbgmcu.h
│ │ │ │ stm32f10x_dma.h
│ │ │ │ stm32f10x_exti.h
│ │ │ │ stm32f10x_flash.h
│ │ │ │ stm32f10x_fsmc.h
│ │ │ │ stm32f10x_gpio.h
│ │ │ │ stm32f10x_i2c.h
│ │ │ │ stm32f10x_iwdg.h
│ │ │ │ stm32f10x_pwr.h
│ │ │ │ stm32f10x_rcc.h
│ │ │ │ stm32f10x_rtc.h
│ │ │ │ stm32f10x_sdio.h
│ │ │ │ stm32f10x_spi.h
│ │ │ │ stm32f10x_tim.h
│ │ │ │ stm32f10x_usart.h
│ │ │ └ stm32f10x_wwdg.h
│ │ └ src
│ │ │ misc.c
│ │ │ stm32f10x_adc.c
│ │ │ stm32f10x_bkp.c
│ │ │ stm32f10x_can.c
│ │ │ stm32f10x_cec.c
│ │ │ stm32f10x_crc.c
│ │ │ stm32f10x_dac.c
│ │ │ stm32f10x_dbgmcu.c
│ │ │ stm32f10x_dma.c
│ │ │ stm32f10x_exti.c
│ │ │ stm32f10x_flash.c
│ │ │ stm32f10x_fsmc.c
│ │ │ stm32f10x_gpio.c
│ │ │ stm32f10x_i2c.c
│ │ │ stm32f10x_iwdg.c
│ │ │ stm32f10x_pwr.c
│ │ │ stm32f10x_rcc.c
│ │ │ stm32f10x_rtc.c
│ │ │ stm32f10x_sdio.c
│ │ │ stm32f10x_spi.c
│ │ │ stm32f10x_tim.c
│ │ │ stm32f10x_usart.c
│ │ └ stm32f10x_wwdg.c
│ └ RT-Thread
│ │ board.c
│ │ rtconfig.h