欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 發一個W5500的STM32源代碼 DMA [打印本頁]

作者: rcvip520    時間: 2020-5-8 20:19
標題: 發一個W5500的STM32源代碼 DMA

  1. /**
  2. ******************************************************************************
  3. * @file                            main.c
  4. * @author                          fire
  5. * @version                         V1.0
  6. * @brief                           用3.5.0版本庫建的工程模板
  7. ******************************************************************************
  8. **@attention          內網測試,請保證W5500的IP與測試PC機在同一網段內,且不沖突;
  9. * @attention          如果是用網線跟PC機直連,請設置PC機本地連接地址IP為靜態IP;
  10. * @attention          網絡調試助手打開時的IP地址若是你本地連接地址,請自行設定;
  11. *
  12. * 使用本程序,先將w5500_conf.C 文件中的PC_IP,設定為PC機的IP地址,端口號可任意,默認為5000
  13. *
  14. ******************************************************************************
  15. */
  16. #include <stdio.h>
  17. #include <string.h>

  18. #include "stm32f10x.h"
  19. #include "bsp_spi_flash.h"
  20. #include "bsp_usart1.h"
  21. #include "bsp_i2c_ee.h"
  22. #include "bsp_i2c_gpio.h"
  23. #include "bsp_led.h"
  24. #include "bsp_dht11.h"

  25. #include "w5500.h"
  26. #include "W5500_conf.h"
  27. #include "socket.h"
  28. #include "utility.h"
  29. /*app函數頭文件*/
  30. #include "tcp_demo.h"
  31. uint8 buffer[2048];
  32. int main(void)
  33. {         
  34.     uint16 size=0;
  35.         systick_init(72);/* 初始化Systick工作時鐘*/
  36.         NVIC_Configuration();
  37.                 USART1_Config(); /*初始化串口通信:115200@8-n-1*/
  38.         i2c_CfgGpio();/*初始化eeprom*/
  39.         LED_GPIO_Config();
  40.         
  41.         printf(" 初始化W5500…… \r\n");         
  42.         gpio_for_w5500_config();/* 初始化MCU相關引腳*/
  43. //        SPI_DMA_Config();
  44.         reset_w5500();/*復位W5500*/
  45.         printf(" W5500 Hardware initialized! \r\n");
  46.         
  47.         set_w5500_mac();/*配置W5500MAC地址*/

  48.         if(use_define==1||use_eeprom==1)/*不DHCP獲取IP地址,就配置默認IP地址*/
  49.         set_w5500_ip();/*配置W5500IP地址*/
  50.         printf(" 電腦作為TCP客戶端連接W5500TCP服務器 \r\n");
  51.         printf(" W5500服務器端口默認為: %d \r\n",W5500_tcp_server_port);
  52.         printf(" 連接成功后,PC機發送數據給W5500,W5500將返回對應數據 \r\n");
  53.         socket_buf_init(txsize, rxsize); /*初始化8個Socket的發送接收緩存大小*/
  54.         printf(" 應用程序執行中……\r\n");
  55.         while(1)//循環執行的函數
  56.         {
  57.                 do_tcp_server();/*TCP_Server 數據回環測試程序*/
  58.         }

  59. }

復制代碼

如圖,某寶提供的源代碼,分享給大家

DMA-W5500.rar (384.08 KB, 下載次數: 125)


作者: maxwelllv    時間: 2021-6-28 23:35
好像不是用DMA實現的吧
作者: maxwelllv    時間: 2021-6-28 23:39
這一個一個寫而且里面還有一個while等待,完全沒有發揮DMA的作用




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1