久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

標題: STM32以太網lwip服務器實現程序 [打印本頁]

作者: matthewroy    時間: 2019-7-2 10:16
標題: STM32以太網lwip服務器實現程序
更具lwip移植到stm32上實現以太網服務器

單片機源程序如下:
  1. #include "led.h"
  2. #include "lcd.h"
  3. #include "key.h"

  4. #include "stm32f4x7_eth.h"
  5. #include "stm32f4x7_eth_bsp.h"
  6. #include "netconf.h"
  7. #include "tcp.h"
  8. #include "udp.h"
  9. #include "string.h"

  10. #include "TCP_SERVER.h"

  11. #define SYSTEMTICK_PERIOD_MS  10
  12.        
  13. /* Private macro -------------------------------------------------------------*/
  14. /* Private variables ---------------------------------------------------------*/
  15. __IO uint32_t LocalTime = 0; /* this variable is used to create a time reference incremented by 10ms */
  16. uint32_t timingdelay;

  17. int main(void)
  18. {       
  19.         NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//設置系統中斷優先級分組2
  20.         delay_init();         //初始化延時函數
  21.         LED_Init();                                          //初始化LED
  22.         //LCD_Init();                                          //初始化LCD
  23.         KEY_Init();           //初始化KEY
  24.        
  25. //        BRUSH_COLOR=RED;
  26. //        LCD_DisplayString(10,10,24,"Illuminati STM32F4");       
  27. //  LCD_DisplayString(10,40,16,"Author:Clever");
  28. //        LCD_DisplayString(20,70,24,"23 TCP_Server ");
  29. //       
  30. //        BRUSH_COLOR=BLUE;
  31. //        LCD_DisplayString(20,110,16,"IMT407G_IP:192.168.1.240");  //開發板作為服務器時的IP
  32. //        LCD_DisplayString(20,130,16,"TCP_Server_PORT:2040 ");     //開發板作為服務器時的端口號
  33.   
  34.         ETH_BSP_Config();     //DP83848相關IO初始化與ETH相關初始化
  35.         LwIP_Init();          //LWIP初始化
  36.         TCP_server_init();    //初始化開發板為服務器

  37.         while (1)
  38.         {  
  39.      LwIP_Periodic_Handle(LocalTime);                   /* handle periodic timers for LwIP */
  40.   }               
  41. }

  42. /**
  43.   * @brief  Inserts a delay time.
  44.   * @param  nCount: number of 10ms periods to wait for.
  45.   * @retval None
  46.   */
  47. void Delay(uint32_t nCount)
  48. {
  49.   /* Capture the current local time */
  50.   timingdelay = LocalTime + nCount;  

  51.   /* wait until the desired delay finish */  
  52.   while(timingdelay > LocalTime)
  53.   {     
  54.   }
  55. }

  56. /**
  57.   * @brief  Updates the system local time
  58.   * @param  None
  59.   * @retval None
  60.   */
  61. void Time_Update(void)
  62. {
  63.   LocalTime += SYSTEMTICK_PERIOD_MS;
  64. }

  65. #ifdef  USE_FULL_ASSERT

  66. /**
  67.   * @brief  Reports the name of the source file and the source line number
  68.   *   where the assert_param error has occurred.
  69.   * @param  file: pointer to the source file name
  70.   * @param  line: assert_param error line source number
  71.   * @retval None
  72.   */
  73. void assert_failed(uint8_t* file, uint32_t line)
  74. {
  75.   /* User can add his own implementation to report the file name and line number,
  76.      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  77.   /* Infinite loop */
  78.   while (1)
  79.   {}
  80. }
  81. #endif
復制代碼

所有資料51hei提供下載:
TCP服務器數據收發實驗.7z (613.2 KB, 下載次數: 44)



作者: daichenghe    時間: 2019-7-30 09:10
為什么PC無法連接上啊?




歡迎光臨 (http://www.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 国产91视频一区二区 | 久久久久国产精品 | 国产日韩一区二区三区 | 黄色免费在线网址 | 日本欧美在线观看视频 | 男人av在线播放 | 视频一区在线 | 国产日韩欧美 | 久操伊人| www.日韩系列 | 亚洲精品 在线播放 | 青青草这里只有精品 | 久久精品色视频 | 国产一区 在线视频 | 91在线精品一区二区 | 99re6在线视频精品免费 | 在线观看成人小视频 | 色播久久| 国产午夜高清 | 天天看片天天干 | 久久久久久久久久久久久9999 | 亚洲精品中文在线 | 91九色视频在线 | 精品久久久久久一区二区 | 日韩一区二区成人 | 最近中文字幕免费 | 二区亚洲| 国产99久久久国产精品下药 | 色综合网站 | 国产区在线看 | 欧美aaa级 | 成人免费视频 | 涩涩片影院 | 7777奇米影视 | 亚洲一区国产 | 国产片侵犯亲女视频播放 | 伊人春色在线观看 | 9191在线播放| 国产美女永久免费无遮挡 | 天堂在线www| 欧美色性|