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

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 3569|回復(fù): 1
打印 上一主題 下一主題
收起左側(cè)

STM32以太網(wǎng)lwip服務(wù)器實(shí)現(xiàn)程序

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:576178 發(fā)表于 2019-7-2 10:16 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
更具lwip移植到stm32上實(shí)現(xiàn)以太網(wǎng)服務(wù)器

單片機(jī)源程序如下:
  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);//設(shè)置系統(tǒng)中斷優(yōu)先級(jí)分組2
  20.         delay_init();         //初始化延時(shí)函數(shù)
  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");  //開發(fā)板作為服務(wù)器時(shí)的IP
  32. //        LCD_DisplayString(20,130,16,"TCP_Server_PORT:2040 ");     //開發(fā)板作為服務(wù)器時(shí)的端口號(hào)
  33.   
  34.         ETH_BSP_Config();     //DP83848相關(guān)IO初始化與ETH相關(guān)初始化
  35.         LwIP_Init();          //LWIP初始化
  36.         TCP_server_init();    //初始化開發(fā)板為服務(wù)器

  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
復(fù)制代碼

所有資料51hei提供下載:
TCP服務(wù)器數(shù)據(jù)收發(fā)實(shí)驗(yàn).7z (613.2 KB, 下載次數(shù): 44)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:529603 發(fā)表于 2019-7-30 09:10 | 只看該作者
為什么PC無法連接上啊?
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 黄色成人在线观看 | 久在线 | 久久久久久一区 | 免费观看的av | 日韩伦理一区二区 | 国产伦精品一区二区 | 亚洲小视频在线播放 | 91在线电影| 欧美视频1区| 欧美日韩电影在线 | 久久精品视频网站 | 天天久久| 天天精品综合 | 99热在线播放 | 九九久久精品视频 | 91欧美激情一区二区三区成人 | 亚洲网在线 | 国产中文原创 | 国产黄色大片网站 | 日本精品一区二区 | 国产精品国产精品国产专区不卡 | 日韩精品免费 | 欧美日韩1区2区3区 欧美久久一区 | 91免费视频 | 免费成人高清 | 特一级毛片| 精品日韩在线观看 | 激情五月婷婷在线 | 国产成人高清在线观看 | 久久久一区二区三区 | 国产日韩一区二区三区 | 亚洲高清久久 | 亚洲欧美日韩精品久久亚洲区 | 国产日韩精品视频 | 超碰人人做 | 91精品中文字幕一区二区三区 | 天天干夜夜操视频 | 日韩免费激情视频 | 天堂综合网久久 | 99久久久久 | 在线观看亚洲 |